From b430ca9572f042f11b29a0c9debada1a9f3ee98c Mon Sep 17 00:00:00 2001 From: theo-s68 <194042188+theo-s68@users.noreply.github.com> Date: Tue, 28 Jul 2026 15:40:54 +0700 Subject: [PATCH] Release web3-wallet v3.0.0 --- clients/web3-wallet/CHANGELOG.md | 13 + .../web3-wallet/docs/AddressPortfolioApi.md | 617 +++++ clients/web3-wallet/docs/BinanceChainId.md | 11 + .../docs/BroadcastTransactionsRequest.md | 6 +- .../docs/BroadcastTransactionsResponseData.md | 2 +- .../BuildSolanaSwapInstructionsResponse.md | 17 + ...BuildSolanaSwapInstructionsResponseData.md | 16 + ...ctionsResponseDataInstructionListsInner.md | 15 + ...eDataInstructionListsInnerAccountsInner.md | 15 + ...wapInstructionsResponseDataRouterResult.md | 24 + ...ponseDataRouterResultDexRouterListInner.md | 17 + ...uterResultDexRouterListInnerDexProtocol.md | 14 + ...RouterResultDexRouterListInnerFromToken.md | 14 + ...taRouterResultDexRouterListInnerToToken.md | 14 + ...ctionsResponseDataRouterResultFromToken.md | 16 + ...ructionsResponseDataRouterResultToToken.md | 16 + ...ildSolanaSwapInstructionsResponseDataTx.md | 17 + .../docs/BuildSwapTransactionResponseData.md | 2 + .../BuildSwapTransactionResponseDataRfq.md | 18 + .../docs/{MarketApi.md => GeneralDataApi.md} | 182 +- .../GetAddressPnLForSpecificTokenResponse.md | 17 + ...tAddressPnLForSpecificTokenResponseData.md | 28 + .../GetAddressPortfolioOverviewResponse.md | 17 + ...GetAddressPortfolioOverviewResponseData.md | 27 + ...tfolioOverviewResponseDataDailyPnlInner.md | 14 + ...rviewResponseDataTokenCountByPnlPercent.md | 19 + ...verviewResponseDataTopPnlTokenListInner.md | 16 + .../docs/GetAddressRecentPnLResponse.md | 17 + .../docs/GetAddressRecentPnLResponseData.md | 15 + ...ddressRecentPnLResponseDataPnlListInner.md | 27 + ...seDataPnlListInnerTokenPositionDuration.md | 14 + .../GetAggregatedQuoteResponseDataInner.md | 3 + .../docs/GetDexTradeHistoryResponse.md | 17 + .../docs/GetDexTradeHistoryResponseData.md | 15 + ...HistoryResponseDataTransactionListInner.md | 23 + .../web3-wallet/docs/GetGasLimitRequest.md | 7 +- .../docs/GetGasLimitRequestEvmTx.md | 2 +- .../docs/GetGasLimitRequestTronTx.md | 26 + ...imitRequestTronTxTransferContractParams.md | 15 + ...RequestTronTxTriggerSmartContractParams.md | 17 + .../docs/GetGasLimitResponseData.md | 9 +- .../docs/GetLeaderboardResponse.md | 17 + .../docs/GetLeaderboardResponseData.md | 15 + .../GetLeaderboardResponseDataItemsInner.md | 33 + ...oardResponseDataItemsInnerDailyPnlInner.md | 14 + ...nseDataItemsInnerTokenCountByPnlPercent.md | 17 + ...ponseDataItemsInnerTopPnlTokenListInner.md | 17 + .../GetPortfolioSupportedChainsResponse.md | 17 + ...rtfolioSupportedChainsResponseDataInner.md | 19 + .../docs/GetRfqOrderStatusResponse.md | 17 + .../docs/GetRfqOrderStatusResponseData.md | 20 + .../GetRwaTokenIssuancePlatformsResponse.md | 17 + ...TokenIssuancePlatformsResponseDataInner.md | 17 + ...ResponseDataInnerChainDistributionInner.md | 14 + .../docs/GetRwaTokenListResponse.md | 17 + .../docs/GetRwaTokenListResponseDataInner.md | 31 + ...RwaTokenListResponseDataInnerStatusInfo.md | 19 + .../docs/GetRwaTokenPriceResponse.md | 17 + .../docs/GetRwaTokenPriceResponseDataInner.md | 18 + .../docs/GetRwaUnderlyingInfoResponse.md | 17 + .../docs/GetRwaUnderlyingInfoResponseData.md | 22 + ...waUnderlyingInfoResponseDataCompanyInfo.md | 20 + ...erlyingInfoResponseDataProtectionsValue.md | 14 + .../GetRwaUnderlyingMarketDataResponse.md | 17 + .../GetRwaUnderlyingMarketDataResponseData.md | 19 + ...erlyingMarketDataResponseDataMarketData.md | 26 + ...erlyingMarketDataResponseDataStatusInfo.md | 19 + .../docs/GetTokenDevInfoResponse.md | 17 + .../docs/GetTokenDevInfoResponseData.md | 15 + ...tTokenDevInfoResponseDataDevHoldingInfo.md | 21 + ...TokenDevInfoResponseDataDevLaunchedInfo.md | 15 + .../docs/GetTrackedTradesResponse.md | 17 + .../docs/GetTrackedTradesResponseData.md | 14 + ...GetTrackedTradesResponseDataTradesInner.md | 21 + ...sactionSupportedChainsResponseDataInner.md | 2 +- clients/web3-wallet/docs/OrderType.md | 13 + clients/web3-wallet/docs/PlatformId.md | 13 + .../QuoteAndBuildSwapTransactionResponse.md | 17 + ...uoteAndBuildSwapTransactionResponseData.md | 16 + ...eAndBuildSwapTransactionResponseDataRfq.md | 18 + clients/web3-wallet/docs/RwaDataApi.md | 463 ++++ .../docs/SearchRwaTokenResponse.md | 17 + .../docs/SearchRwaTokenResponseDataInner.md | 15 + ...rchRwaTokenResponseDataInnerAssetsInner.md | 17 + .../docs/SimulateTransactionsRequest.md | 7 +- .../docs/SimulateTransactionsRequestEvmTx.md | 2 +- .../docs/SimulateTransactionsRequestSolTx.md | 2 +- .../docs/SimulateTransactionsRequestTronTx.md | 26 + clients/web3-wallet/docs/SortBy.md | 19 + .../web3-wallet/docs/SubmitRfqOrderRequest.md | 27 + .../docs/SubmitRfqOrderResponse.md | 17 + .../docs/SubmitRfqOrderResponseData.md | 16 + clients/web3-wallet/docs/TimeFrame.md | 15 + clients/web3-wallet/docs/TrackerType.md | 15 + clients/web3-wallet/docs/TradingApi.md | 391 ++- clients/web3-wallet/docs/TransactionApi.md | 12 +- clients/web3-wallet/docs/Vendor.md | 11 + clients/web3-wallet/docs/WalletType.md | 15 + clients/web3-wallet/example_rest.md | 84 +- clients/web3-wallet/pom.xml | 2 +- .../client/web3_wallet/rest/JSON.java | 241 ++ .../rest/api/AddressPortfolioApi.java | 2303 ++++++++++++++++ .../{MarketApi.java => GeneralDataApi.java} | 265 +- .../web3_wallet/rest/api/RwaDataApi.java | 1282 +++++++++ .../web3_wallet/rest/api/TradingApi.java | 2455 ++++++++++++++--- .../web3_wallet/rest/api/TransactionApi.java | 12 +- .../web3_wallet/rest/api/WalletApi.java | 2 +- .../rest/api/Web3WalletRestApi.java | 1224 +++++++- .../rest/model/BinanceChainId.java | 71 + .../model/BroadcastTransactionsRequest.java | 21 +- .../BroadcastTransactionsResponseData.java | 3 +- .../BuildSolanaSwapInstructionsResponse.java | 355 +++ ...ildSolanaSwapInstructionsResponseData.java | 409 +++ ...ionsResponseDataInstructionListsInner.java | 367 +++ ...ataInstructionListsInnerAccountsInner.java | 321 +++ ...pInstructionsResponseDataRouterResult.java | 740 +++++ ...nseDataRouterResultDexRouterListInner.java | 434 +++ ...erResultDexRouterListInnerDexProtocol.java | 295 ++ ...uterResultDexRouterListInnerFromToken.java | 301 ++ ...RouterResultDexRouterListInnerToToken.java | 299 ++ ...ionsResponseDataRouterResultFromToken.java | 330 +++ ...ctionsResponseDataRouterResultToToken.java | 329 +++ ...dSolanaSwapInstructionsResponseDataTx.java | 353 +++ .../BuildSwapTransactionResponseData.java | 106 +- .../BuildSwapTransactionResponseDataRfq.java | 415 +++ ...GetAddressPnLForSpecificTokenResponse.java | 357 +++ ...ddressPnLForSpecificTokenResponseData.java | 841 ++++++ .../GetAddressPortfolioOverviewResponse.java | 355 +++ ...tAddressPortfolioOverviewResponseData.java | 883 ++++++ ...olioOverviewResponseDataDailyPnlInner.java | 272 ++ ...iewResponseDataTokenCountByPnlPercent.java | 485 ++++ ...rviewResponseDataTopPnlTokenListInner.java | 373 +++ .../model/GetAddressRecentPnLResponse.java | 347 +++ .../GetAddressRecentPnLResponseData.java | 291 ++ ...ressRecentPnLResponseDataPnlListInner.java | 866 ++++++ ...DataPnlListInnerTokenPositionDuration.java | 241 ++ .../GetAggregatedQuoteResponseDataInner.java | 134 +- .../model/GetDexTradeHistoryResponse.java | 346 +++ .../model/GetDexTradeHistoryResponseData.java | 295 ++ ...storyResponseDataTransactionListInner.java | 670 +++++ .../rest/model/GetGasLimitRequest.java | 79 +- .../rest/model/GetGasLimitRequestEvmTx.java | 13 +- .../rest/model/GetGasLimitRequestTronTx.java | 423 +++ ...itRequestTronTxTransferContractParams.java | 276 ++ ...questTronTxTriggerSmartContractParams.java | 376 +++ .../rest/model/GetGasLimitResponseData.java | 283 +- .../rest/model/GetLeaderboardResponse.java | 345 +++ .../model/GetLeaderboardResponseData.java | 282 ++ .../GetLeaderboardResponseDataItemsInner.java | 1182 ++++++++ ...rdResponseDataItemsInnerDailyPnlInner.java | 269 ++ ...eDataItemsInnerTokenCountByPnlPercent.java | 386 +++ ...nseDataItemsInnerTopPnlTokenListInner.java | 415 +++ .../GetPortfolioSupportedChainsResponse.java | 391 +++ ...folioSupportedChainsResponseDataInner.java | 480 ++++ .../rest/model/GetRfqOrderStatusResponse.java | 346 +++ .../model/GetRfqOrderStatusResponseData.java | 464 ++++ .../GetRwaTokenIssuancePlatformsResponse.java | 392 +++ ...kenIssuancePlatformsResponseDataInner.java | 447 +++ ...sponseDataInnerChainDistributionInner.java | 279 ++ .../rest/model/GetRwaTokenListResponse.java | 378 +++ .../GetRwaTokenListResponseDataInner.java | 1019 +++++++ ...aTokenListResponseDataInnerStatusInfo.java | 437 +++ .../rest/model/GetRwaTokenPriceResponse.java | 378 +++ .../GetRwaTokenPriceResponseDataInner.java | 437 +++ .../model/GetRwaUnderlyingInfoResponse.java | 350 +++ .../GetRwaUnderlyingInfoResponseData.java | 595 ++++ ...UnderlyingInfoResponseDataCompanyInfo.java | 527 ++++ ...lyingInfoResponseDataProtectionsValue.java | 279 ++ .../GetRwaUnderlyingMarketDataResponse.java | 355 +++ ...etRwaUnderlyingMarketDataResponseData.java | 438 +++ ...lyingMarketDataResponseDataMarketData.java | 775 ++++++ ...lyingMarketDataResponseDataStatusInfo.java | 445 +++ .../rest/model/GetTokenDevInfoResponse.java | 346 +++ .../model/GetTokenDevInfoResponseData.java | 256 ++ ...okenDevInfoResponseDataDevHoldingInfo.java | 551 ++++ ...kenDevInfoResponseDataDevLaunchedInfo.java | 267 ++ .../rest/model/GetTrackedTradesResponse.java | 346 +++ .../model/GetTrackedTradesResponseData.java | 250 ++ ...tTrackedTradesResponseDataTradesInner.java | 574 ++++ ...ctionSupportedChainsResponseDataInner.java | 3 +- .../web3_wallet/rest/model/OrderType.java | 73 + .../web3_wallet/rest/model/PlatformId.java | 73 + .../QuoteAndBuildSwapTransactionResponse.java | 357 +++ ...teAndBuildSwapTransactionResponseData.java | 363 +++ ...ndBuildSwapTransactionResponseDataRfq.java | 421 +++ .../rest/model/SearchRwaTokenResponse.java | 377 +++ .../SearchRwaTokenResponseDataInner.java | 332 +++ ...hRwaTokenResponseDataInnerAssetsInner.java | 393 +++ .../model/SimulateTransactionsRequest.java | 80 +- .../SimulateTransactionsRequestEvmTx.java | 13 +- .../SimulateTransactionsRequestSolTx.java | 13 +- .../SimulateTransactionsRequestTronTx.java | 429 +++ .../client/web3_wallet/rest/model/SortBy.java | 79 + .../rest/model/SubmitRfqOrderRequest.java | 452 +++ .../rest/model/SubmitRfqOrderResponse.java | 345 +++ .../model/SubmitRfqOrderResponseData.java | 285 ++ .../web3_wallet/rest/model/TimeFrame.java | 75 + .../web3_wallet/rest/model/TrackerType.java | 75 + .../client/web3_wallet/rest/model/Vendor.java | 71 + .../web3_wallet/rest/model/WalletType.java | 75 + ...etApiTest.java => GeneralDataApiTest.java} | 50 +- .../web3_wallet/rest/api/TradingApiTest.java | 5 +- .../rest/api/TransactionApiTest.java | 38 +- examples/web3-wallet/pom.xml | 2 +- .../GetAddressPnLForSpecificTokenExample.java | 50 + .../GetAddressPortfolioOverviewExample.java | 51 + .../GetAddressRecentPnLExample.java} | 30 +- .../GetDexTradeHistoryExample.java | 54 + .../GetLeaderboardExample.java | 62 + .../GetPortfolioSupportedChainsExample.java | 45 + .../GetTrackedTradesExample.java} | 45 +- .../GetCandlesExample.java | 10 +- .../GetHoldersRankingExample.java | 10 +- .../GetHotTokenListExample.java | 11 +- .../GetSupportedChainsExample.java | 9 +- .../GetTokenAdvancedInfoExample.java | 11 +- .../GetTokenBasicInfoExample.java | 10 +- .../GetTokenDevInfoExample.java} | 31 +- .../GetTokenPriceExample.java | 8 +- .../GetTokenTradesExample.java | 10 +- .../GetTokenTradingInfoExample.java | 9 +- .../GetTopLiquidityPoolsExample.java | 11 +- .../GetTopTradersExample.java | 10 +- .../SearchTokenExample.java | 9 +- .../GetRwaTokenIssuancePlatformsExample.java} | 33 +- .../rest/rwadata/GetRwaTokenListExample.java | 48 + .../rest/rwadata/GetRwaTokenPriceExample.java | 46 + .../rwadata/GetRwaUnderlyingInfoExample.java | 46 + .../GetRwaUnderlyingMarketDataExample.java} | 32 +- .../rest/rwadata/SearchRwaTokenExample.java | 46 + .../BuildSolanaSwapInstructionsExample.java | 80 + .../trading/BuildSwapTransactionExample.java | 3 +- .../trading/GetAggregatedQuoteExample.java | 1 + .../GetErc20ApproveTransactionExample.java | 1 + .../trading/GetRfqOrderStatusExample.java | 48 + .../QuoteAndBuildSwapTransactionExample.java | 78 + .../rest/trading/SubmitRfqOrderExample.java | 56 + .../BroadcastTransactionsExample.java | 3 +- .../rest/transaction/GetGasLimitExample.java | 10 +- .../rest/transaction/GetGasPriceExample.java | 6 +- .../SimulateTransactionsExample.java | 9 +- 241 files changed, 43654 insertions(+), 930 deletions(-) create mode 100644 clients/web3-wallet/CHANGELOG.md create mode 100644 clients/web3-wallet/docs/AddressPortfolioApi.md create mode 100644 clients/web3-wallet/docs/BinanceChainId.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponse.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseData.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataInstructionListsInner.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResult.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultToToken.md create mode 100644 clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataTx.md create mode 100644 clients/web3-wallet/docs/BuildSwapTransactionResponseDataRfq.md rename clients/web3-wallet/docs/{MarketApi.md => GeneralDataApi.md} (84%) create mode 100644 clients/web3-wallet/docs/GetAddressPnLForSpecificTokenResponse.md create mode 100644 clients/web3-wallet/docs/GetAddressPnLForSpecificTokenResponseData.md create mode 100644 clients/web3-wallet/docs/GetAddressPortfolioOverviewResponse.md create mode 100644 clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseData.md create mode 100644 clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataDailyPnlInner.md create mode 100644 clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.md create mode 100644 clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.md create mode 100644 clients/web3-wallet/docs/GetAddressRecentPnLResponse.md create mode 100644 clients/web3-wallet/docs/GetAddressRecentPnLResponseData.md create mode 100644 clients/web3-wallet/docs/GetAddressRecentPnLResponseDataPnlListInner.md create mode 100644 clients/web3-wallet/docs/GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.md create mode 100644 clients/web3-wallet/docs/GetDexTradeHistoryResponse.md create mode 100644 clients/web3-wallet/docs/GetDexTradeHistoryResponseData.md create mode 100644 clients/web3-wallet/docs/GetDexTradeHistoryResponseDataTransactionListInner.md create mode 100644 clients/web3-wallet/docs/GetGasLimitRequestTronTx.md create mode 100644 clients/web3-wallet/docs/GetGasLimitRequestTronTxTransferContractParams.md create mode 100644 clients/web3-wallet/docs/GetGasLimitRequestTronTxTriggerSmartContractParams.md create mode 100644 clients/web3-wallet/docs/GetLeaderboardResponse.md create mode 100644 clients/web3-wallet/docs/GetLeaderboardResponseData.md create mode 100644 clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInner.md create mode 100644 clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerDailyPnlInner.md create mode 100644 clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.md create mode 100644 clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.md create mode 100644 clients/web3-wallet/docs/GetPortfolioSupportedChainsResponse.md create mode 100644 clients/web3-wallet/docs/GetPortfolioSupportedChainsResponseDataInner.md create mode 100644 clients/web3-wallet/docs/GetRfqOrderStatusResponse.md create mode 100644 clients/web3-wallet/docs/GetRfqOrderStatusResponseData.md create mode 100644 clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponse.md create mode 100644 clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponseDataInner.md create mode 100644 clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.md create mode 100644 clients/web3-wallet/docs/GetRwaTokenListResponse.md create mode 100644 clients/web3-wallet/docs/GetRwaTokenListResponseDataInner.md create mode 100644 clients/web3-wallet/docs/GetRwaTokenListResponseDataInnerStatusInfo.md create mode 100644 clients/web3-wallet/docs/GetRwaTokenPriceResponse.md create mode 100644 clients/web3-wallet/docs/GetRwaTokenPriceResponseDataInner.md create mode 100644 clients/web3-wallet/docs/GetRwaUnderlyingInfoResponse.md create mode 100644 clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseData.md create mode 100644 clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseDataCompanyInfo.md create mode 100644 clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseDataProtectionsValue.md create mode 100644 clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponse.md create mode 100644 clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseData.md create mode 100644 clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseDataMarketData.md create mode 100644 clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseDataStatusInfo.md create mode 100644 clients/web3-wallet/docs/GetTokenDevInfoResponse.md create mode 100644 clients/web3-wallet/docs/GetTokenDevInfoResponseData.md create mode 100644 clients/web3-wallet/docs/GetTokenDevInfoResponseDataDevHoldingInfo.md create mode 100644 clients/web3-wallet/docs/GetTokenDevInfoResponseDataDevLaunchedInfo.md create mode 100644 clients/web3-wallet/docs/GetTrackedTradesResponse.md create mode 100644 clients/web3-wallet/docs/GetTrackedTradesResponseData.md create mode 100644 clients/web3-wallet/docs/GetTrackedTradesResponseDataTradesInner.md create mode 100644 clients/web3-wallet/docs/OrderType.md create mode 100644 clients/web3-wallet/docs/PlatformId.md create mode 100644 clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponse.md create mode 100644 clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponseData.md create mode 100644 clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponseDataRfq.md create mode 100644 clients/web3-wallet/docs/RwaDataApi.md create mode 100644 clients/web3-wallet/docs/SearchRwaTokenResponse.md create mode 100644 clients/web3-wallet/docs/SearchRwaTokenResponseDataInner.md create mode 100644 clients/web3-wallet/docs/SearchRwaTokenResponseDataInnerAssetsInner.md create mode 100644 clients/web3-wallet/docs/SimulateTransactionsRequestTronTx.md create mode 100644 clients/web3-wallet/docs/SortBy.md create mode 100644 clients/web3-wallet/docs/SubmitRfqOrderRequest.md create mode 100644 clients/web3-wallet/docs/SubmitRfqOrderResponse.md create mode 100644 clients/web3-wallet/docs/SubmitRfqOrderResponseData.md create mode 100644 clients/web3-wallet/docs/TimeFrame.md create mode 100644 clients/web3-wallet/docs/TrackerType.md create mode 100644 clients/web3-wallet/docs/Vendor.md create mode 100644 clients/web3-wallet/docs/WalletType.md create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/AddressPortfolioApi.java rename clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/{MarketApi.java => GeneralDataApi.java} (94%) create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/RwaDataApi.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BinanceChainId.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataInstructionListsInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResult.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultToToken.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataTx.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSwapTransactionResponseDataRfq.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPnLForSpecificTokenResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPnLForSpecificTokenResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataDailyPnlInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseDataPnlListInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponseDataTransactionListInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTx.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTxTransferContractParams.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTxTriggerSmartContractParams.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerDailyPnlInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetPortfolioSupportedChainsResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetPortfolioSupportedChainsResponseDataInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRfqOrderStatusResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRfqOrderStatusResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponseDataInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponseDataInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponseDataInnerStatusInfo.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenPriceResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenPriceResponseDataInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseDataCompanyInfo.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseDataProtectionsValue.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseDataMarketData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseDataStatusInfo.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseDataDevHoldingInfo.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseDataDevLaunchedInfo.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponseDataTradesInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/OrderType.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/PlatformId.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponseDataRfq.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponseDataInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponseDataInnerAssetsInner.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestTronTx.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SortBy.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderRequest.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderResponse.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderResponseData.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/TimeFrame.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/TrackerType.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/Vendor.java create mode 100644 clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/WalletType.java rename clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/{MarketApiTest.java => GeneralDataApiTest.java} (92%) create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPnLForSpecificTokenExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPortfolioOverviewExample.java rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{wallet/GetWalletSupportedChainsExample.java => addressportfolio/GetAddressRecentPnLExample.java} (58%) create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetDexTradeHistoryExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetLeaderboardExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetPortfolioSupportedChainsExample.java rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{wallet/GetTransactionsByAddressExample.java => addressportfolio/GetTrackedTradesExample.java} (51%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetCandlesExample.java (85%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetHoldersRankingExample.java (85%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetHotTokenListExample.java (93%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetSupportedChainsExample.java (84%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetTokenAdvancedInfoExample.java (83%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetTokenBasicInfoExample.java (84%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{wallet/GetTokenBalancesByAddressExample.java => generaldata/GetTokenDevInfoExample.java} (53%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetTokenPriceExample.java (85%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetTokenTradesExample.java (86%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetTokenTradingInfoExample.java (85%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetTopLiquidityPoolsExample.java (83%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/GetTopTradersExample.java (86%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{market => generaldata}/SearchTokenExample.java (84%) rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{wallet/GetAllTokenBalancesByAddressExample.java => rwadata/GetRwaTokenIssuancePlatformsExample.java} (52%) create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenListExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenPriceExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingInfoExample.java rename examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/{wallet/GetTransactionDetailByHashExample.java => rwadata/GetRwaUnderlyingMarketDataExample.java} (54%) create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/SearchRwaTokenExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSolanaSwapInstructionsExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetRfqOrderStatusExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/QuoteAndBuildSwapTransactionExample.java create mode 100644 examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/SubmitRfqOrderExample.java diff --git a/clients/web3-wallet/CHANGELOG.md b/clients/web3-wallet/CHANGELOG.md new file mode 100644 index 0000000..f485a59 --- /dev/null +++ b/clients/web3-wallet/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## 1.0.0 - 2026-07-24 + +### Changed (1) + +- Modified response for `getGasLimit()` (`POST /api/v1/dex/pre-transaction/gas-limit`): + - `data`: property `energyFee` added + - `data`: property `energyRequired` added + - `data`: property `freeBandwidth` added + - `data`: property `freeEnergy` added + - `data`: property `bandwidthFee` added + - `data`: property `bandwidthRequired` added diff --git a/clients/web3-wallet/docs/AddressPortfolioApi.md b/clients/web3-wallet/docs/AddressPortfolioApi.md new file mode 100644 index 0000000..dcc2ad3 --- /dev/null +++ b/clients/web3-wallet/docs/AddressPortfolioApi.md @@ -0,0 +1,617 @@ +# AddressPortfolioApi + +All URIs are relative to *https://web3.binance.com/build* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getAddressPnLForSpecificToken**](AddressPortfolioApi.md#getAddressPnLForSpecificToken) | **GET** /api/v1/dex/market/portfolio/token/latest-pnl | Get Address PnL for Specific Token | +| [**getAddressPortfolioOverview**](AddressPortfolioApi.md#getAddressPortfolioOverview) | **GET** /api/v1/dex/market/portfolio/overview | Get Address Portfolio Overview | +| [**getAddressRecentPnL**](AddressPortfolioApi.md#getAddressRecentPnL) | **GET** /api/v1/dex/market/portfolio/recent-pnl | Get Address Recent PnL | +| [**getDexTradeHistory**](AddressPortfolioApi.md#getDexTradeHistory) | **GET** /api/v1/dex/market/portfolio/dex-history | Get DEX Trade History | +| [**getLeaderboard**](AddressPortfolioApi.md#getLeaderboard) | **GET** /api/v1/dex/market/leaderboard/list | Get Leaderboard | +| [**getPortfolioSupportedChains**](AddressPortfolioApi.md#getPortfolioSupportedChains) | **GET** /api/v1/dex/market/portfolio/supported/chain | Get Portfolio Supported Chains | +| [**getTrackedTrades**](AddressPortfolioApi.md#getTrackedTrades) | **GET** /api/v1/dex/market/address-tracker/trades | Get Tracked Trades | + + + +# **getAddressPnLForSpecificToken** +> GetAddressPnLForSpecificTokenResponse getAddressPnLForSpecificToken(binanceChainId, walletAddress, tokenContractAddress).recvWindow(recvWindow).nonce(nonce).execute(); + +Get Address PnL for Specific Token + +Return the latest realized PnL detail for a specific token held by an address, including buy/sell stats, current balance, and holding duration. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + AddressPortfolioApi apiInstance = new AddressPortfolioApi(defaultClient); + String binanceChainId = "1"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60"; // String | Wallet address to query. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). + String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; // String | Token contract address. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + try { + GetAddressPnLForSpecificTokenResponse result = apiInstance.getAddressPnLForSpecificToken(binanceChainId, walletAddress, tokenContractAddress) + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AddressPortfolioApi#getAddressPnLForSpecificToken"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **walletAddress** | **String**| Wallet address to query. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). | | +| **tokenContractAddress** | **String**| Token contract address. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | + +### Return type + +[**GetAddressPnLForSpecificTokenResponse**](GetAddressPnLForSpecificTokenResponse.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** | Token latest PnL returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getAddressPortfolioOverview** +> GetAddressPortfolioOverviewResponse getAddressPortfolioOverview(binanceChainId, walletAddress, timeFrame).recvWindow(recvWindow).nonce(nonce).execute(); + +Get Address Portfolio Overview + +Return trading performance overview for an address within the selected time frame, including realized PnL, daily PnL breakdown, win rate, and top 3 profitable tokens. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + AddressPortfolioApi apiInstance = new AddressPortfolioApi(defaultClient); + String binanceChainId = "1"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60"; // String | Wallet address to query. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). + TimeFrame timeFrame = TimeFrame.fromValue("1"); // TimeFrame | Statistics time range. 1=1D, 2=7D, 3=1M, 4=3M. Note: these values differ from the leaderboard/list endpoint (where 1=7D, 2=1M, 3=3M); do not reuse enum knowledge across endpoints. + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + try { + GetAddressPortfolioOverviewResponse result = apiInstance.getAddressPortfolioOverview(binanceChainId, walletAddress, timeFrame) + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AddressPortfolioApi#getAddressPortfolioOverview"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **walletAddress** | **String**| Wallet address to query. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). | | +| **timeFrame** | [**TimeFrame**](.md)| Statistics time range. 1=1D, 2=7D, 3=1M, 4=3M. Note: these values differ from the leaderboard/list endpoint (where 1=7D, 2=1M, 3=3M); do not reuse enum knowledge across endpoints. | [enum: 1, 2, 3] | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | + +### Return type + +[**GetAddressPortfolioOverviewResponse**](GetAddressPortfolioOverviewResponse.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** | Portfolio overview returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getAddressRecentPnL** +> GetAddressRecentPnLResponse getAddressRecentPnL(binanceChainId, walletAddress).recvWindow(recvWindow).nonce(nonce).cursor(cursor).limit(limit).execute(); + +Get Address Recent PnL + +Return recent realized PnL list for an address. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + AddressPortfolioApi apiInstance = new AddressPortfolioApi(defaultClient); + String binanceChainId = "1"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60"; // String | Wallet address to query. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + String cursor = ""; // String | Pagination cursor. Omit or pass empty string for the first page; pass the cursor from the previous response to get the next page. + String limit = "20"; // String | Number of records per page. Default 20, max 100. + try { + GetAddressRecentPnLResponse result = apiInstance.getAddressRecentPnL(binanceChainId, walletAddress) + .recvWindow(recvWindow) + .nonce(nonce) + .cursor(cursor) + .limit(limit) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AddressPortfolioApi#getAddressRecentPnL"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **walletAddress** | **String**| Wallet address to query. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **cursor** | **String**| Pagination cursor. Omit or pass empty string for the first page; pass the cursor from the previous response to get the next page. | [optional] | +| **limit** | **String**| Number of records per page. Default 20, max 100. | [optional] | + +### Return type + +[**GetAddressRecentPnLResponse**](GetAddressRecentPnLResponse.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** | Recent PnL list returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getDexTradeHistory** +> GetDexTradeHistoryResponse getDexTradeHistory(binanceChainId, walletAddress).recvWindow(recvWindow).nonce(nonce).begin(begin).end(end).tokenContractAddress(tokenContractAddress).type(type).cursor(cursor).limit(limit).execute(); + +Get DEX Trade History + +Return swap trade history for a specific address. Supports filtering by time range, token, and trade type. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + AddressPortfolioApi apiInstance = new AddressPortfolioApi(defaultClient); + String binanceChainId = "1"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60"; // String | Wallet address to query. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + String begin = "1714000000000"; // String | Start timestamp (Unix milliseconds, inclusive). If both begin and end are omitted, no time filter is applied. + String end = "1748601600000"; // String | End timestamp (Unix milliseconds, inclusive). If both begin and end are omitted, no time filter is applied. + String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; // String | Filter by token contract address. Returns all tokens when omitted. + OrderType type = OrderType.fromValue("1"); // OrderType | Trade type filter. 1=Buy, 2=Sell. Omit to return all types. + String cursor = ""; // String | Pagination cursor. Omit or pass empty string for the first page. + String limit = "20"; // String | Number of records per page. Default 20, max 100. + try { + GetDexTradeHistoryResponse result = apiInstance.getDexTradeHistory(binanceChainId, walletAddress) + .recvWindow(recvWindow) + .nonce(nonce) + .begin(begin) + .end(end) + .tokenContractAddress(tokenContractAddress) + .type(type) + .cursor(cursor) + .limit(limit) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AddressPortfolioApi#getDexTradeHistory"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **walletAddress** | **String**| Wallet address to query. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **begin** | **String**| Start timestamp (Unix milliseconds, inclusive). If both begin and end are omitted, no time filter is applied. | [optional] | +| **end** | **String**| End timestamp (Unix milliseconds, inclusive). If both begin and end are omitted, no time filter is applied. | [optional] | +| **tokenContractAddress** | **String**| Filter by token contract address. Returns all tokens when omitted. | [optional] | +| **type** | [**OrderType**](.md)| Trade type filter. 1=Buy, 2=Sell. Omit to return all types. | [optional] [enum: 1, 2] | +| **cursor** | **String**| Pagination cursor. Omit or pass empty string for the first page. | [optional] | +| **limit** | **String**| Number of records per page. Default 20, max 100. | [optional] | + +### Return type + +[**GetDexTradeHistoryResponse**](GetDexTradeHistoryResponse.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** | DEX history returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getLeaderboard** +> GetLeaderboardResponse getLeaderboard(binanceChainId, timeFrame, sortBy).recvWindow(recvWindow).nonce(nonce).walletType(walletType).minRealizedPnlUsd(minRealizedPnlUsd).maxRealizedPnlUsd(maxRealizedPnlUsd).minWinRatePercent(minWinRatePercent).maxWinRatePercent(maxWinRatePercent).minTxs(minTxs).maxTxs(maxTxs).minTxVolume(minTxVolume).maxTxVolume(maxTxVolume).cursor(cursor).limit(limit).execute(); + +Get Leaderboard + +Return a leaderboard of top-performing wallets, with sorting and filtering by PnL, win rate, transaction count, and volume. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + AddressPortfolioApi apiInstance = new AddressPortfolioApi(defaultClient); + String binanceChainId = "1"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). Single chain only. + TimeFrame timeFrame = TimeFrame.fromValue("1"); // TimeFrame | Statistics time range. 1=7D, 2=1M, 3=3M. Note: these values differ from the portfolio/overview endpoint (where 1=1D, 2=7D, 3=1M, 4=3M); do not reuse enum knowledge across endpoints. + SortBy sortBy = SortBy.fromValue("1"); // SortBy | Sort field. 1=Realized PnL (USD), 2=Win Rate, 3=Transaction count, 4=Volume (USD), 5=Realized PnL %. + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + WalletType walletType = WalletType.fromValue("1"); // WalletType | Wallet type filter, single selection only. 1=Smart Money, 2=KOL, 3=Hot List. Returns all types when omitted. + String minRealizedPnlUsd = "1000"; // String | Minimum realized PnL filter, denominated in USD. + String maxRealizedPnlUsd = "50000"; // String | Maximum realized PnL filter, denominated in USD. + String minWinRatePercent = "50"; // String | Minimum win rate filter, without percent sign. \"50\" means ≥50%. + String maxWinRatePercent = "90"; // String | Maximum win rate filter, without percent sign. \"90\" means ≤90%. + String minTxs = "10"; // String | Minimum transaction count filter. + String maxTxs = "1000"; // String | Maximum transaction count filter. + String minTxVolume = "5000"; // String | Minimum total transaction volume filter, denominated in USD. + String maxTxVolume = "1000000"; // String | Maximum total transaction volume filter, denominated in USD. + String cursor = ""; // String | Pagination cursor. Omit or pass empty string for the first page. + String limit = "50"; // String | Number of records per page. Default 50, max 50. + try { + GetLeaderboardResponse result = apiInstance.getLeaderboard(binanceChainId, timeFrame, sortBy) + .recvWindow(recvWindow) + .nonce(nonce) + .walletType(walletType) + .minRealizedPnlUsd(minRealizedPnlUsd) + .maxRealizedPnlUsd(maxRealizedPnlUsd) + .minWinRatePercent(minWinRatePercent) + .maxWinRatePercent(maxWinRatePercent) + .minTxs(minTxs) + .maxTxs(maxTxs) + .minTxVolume(minTxVolume) + .maxTxVolume(maxTxVolume) + .cursor(cursor) + .limit(limit) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AddressPortfolioApi#getLeaderboard"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). Single chain only. | | +| **timeFrame** | [**TimeFrame**](.md)| Statistics time range. 1=7D, 2=1M, 3=3M. Note: these values differ from the portfolio/overview endpoint (where 1=1D, 2=7D, 3=1M, 4=3M); do not reuse enum knowledge across endpoints. | [enum: 1, 2, 3] | +| **sortBy** | [**SortBy**](.md)| Sort field. 1=Realized PnL (USD), 2=Win Rate, 3=Transaction count, 4=Volume (USD), 5=Realized PnL %. | [enum: 1, 2, 3, 4, 5] | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **walletType** | [**WalletType**](.md)| Wallet type filter, single selection only. 1=Smart Money, 2=KOL, 3=Hot List. Returns all types when omitted. | [optional] [enum: 1, 2, 3] | +| **minRealizedPnlUsd** | **String**| Minimum realized PnL filter, denominated in USD. | [optional] | +| **maxRealizedPnlUsd** | **String**| Maximum realized PnL filter, denominated in USD. | [optional] | +| **minWinRatePercent** | **String**| Minimum win rate filter, without percent sign. \"50\" means ≥50%. | [optional] | +| **maxWinRatePercent** | **String**| Maximum win rate filter, without percent sign. \"90\" means ≤90%. | [optional] | +| **minTxs** | **String**| Minimum transaction count filter. | [optional] | +| **maxTxs** | **String**| Maximum transaction count filter. | [optional] | +| **minTxVolume** | **String**| Minimum total transaction volume filter, denominated in USD. | [optional] | +| **maxTxVolume** | **String**| Maximum total transaction volume filter, denominated in USD. | [optional] | +| **cursor** | **String**| Pagination cursor. Omit or pass empty string for the first page. | [optional] | +| **limit** | **String**| Number of records per page. Default 50, max 50. | [optional] | + +### Return type + +[**GetLeaderboardResponse**](GetLeaderboardResponse.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** | Leaderboard list returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getPortfolioSupportedChains** +> GetPortfolioSupportedChainsResponse getPortfolioSupportedChains().recvWindow(recvWindow).nonce(nonce).execute(); + +Get Portfolio Supported Chains + +Return the list of blockchains supported by address portfolio analysis. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + AddressPortfolioApi apiInstance = new AddressPortfolioApi(defaultClient); + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + try { + GetPortfolioSupportedChainsResponse result = apiInstance.getPortfolioSupportedChains() + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AddressPortfolioApi#getPortfolioSupportedChains"); + 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**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | + +### Return type + +[**GetPortfolioSupportedChainsResponse**](GetPortfolioSupportedChainsResponse.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** | Supported chains returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getTrackedTrades** +> GetTrackedTradesResponse getTrackedTrades(trackerType).recvWindow(recvWindow).nonce(nonce).walletAddress(walletAddress).tradeType(tradeType).binanceChainId(binanceChainId).minVolume(minVolume).maxVolume(maxVolume).minMarketCap(minMarketCap).maxMarketCap(maxMarketCap).isHideRiskToken(isHideRiskToken).limit(limit).execute(); + +Get Tracked Trades + +Return the latest swap trades from tracked addresses (smart money, KOL, or custom address list). + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + AddressPortfolioApi apiInstance = new AddressPortfolioApi(defaultClient); + TrackerType trackerType = TrackerType.fromValue("1"); // TrackerType | Tracker type. 1=Smart Money, 2=KOL, 3=Custom address list (walletAddress required). + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60,0xd8da6bf26964af9d7eed9e03e53415d37aa96045"; // String | Required when trackerType=3. One or more wallet addresses, comma-separated, up to 20. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). + String tradeType = "0"; // String | Trade type filter. 0=All (default), 1=Buy, 2=Sell, 3=Add position, 4=Reduce position, 5=Open position, 6=Close position, 7=Transfer in, 8=Transfer out. Multiple values comma-separated. + String binanceChainId = "1"; // String | Filter by chain. Returns all chains when omitted. + String minVolume = "100"; // String | Minimum trade volume filter, denominated in USD. + String maxVolume = "100000"; // String | Maximum trade volume filter, denominated in USD. + String minMarketCap = "10000"; // String | Minimum market cap filter, denominated in USD. + String maxMarketCap = "10000000"; // String | Maximum market cap filter, denominated in USD. + Boolean isHideRiskToken = true; // Boolean | Whether to hide risk tokens. true=hide risk tokens (default), false=show all tokens including risk tokens. + Integer limit = 50; // Integer | Maximum number of trades to return. Effective only for trackerType=3 (custom address list); trackerType=1/2 ignore this and use the downstream public query fixed cap. Omit to use the downstream default. + try { + GetTrackedTradesResponse result = apiInstance.getTrackedTrades(trackerType) + .recvWindow(recvWindow) + .nonce(nonce) + .walletAddress(walletAddress) + .tradeType(tradeType) + .binanceChainId(binanceChainId) + .minVolume(minVolume) + .maxVolume(maxVolume) + .minMarketCap(minMarketCap) + .maxMarketCap(maxMarketCap) + .isHideRiskToken(isHideRiskToken) + .limit(limit) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AddressPortfolioApi#getTrackedTrades"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **trackerType** | [**TrackerType**](.md)| Tracker type. 1=Smart Money, 2=KOL, 3=Custom address list (walletAddress required). | [enum: 1, 2, 3] | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **walletAddress** | **String**| Required when trackerType=3. One or more wallet addresses, comma-separated, up to 20. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). | [optional] | +| **tradeType** | **String**| Trade type filter. 0=All (default), 1=Buy, 2=Sell, 3=Add position, 4=Reduce position, 5=Open position, 6=Close position, 7=Transfer in, 8=Transfer out. Multiple values comma-separated. | [optional] | +| **binanceChainId** | **String**| Filter by chain. Returns all chains when omitted. | [optional] | +| **minVolume** | **String**| Minimum trade volume filter, denominated in USD. | [optional] | +| **maxVolume** | **String**| Maximum trade volume filter, denominated in USD. | [optional] | +| **minMarketCap** | **String**| Minimum market cap filter, denominated in USD. | [optional] | +| **maxMarketCap** | **String**| Maximum market cap filter, denominated in USD. | [optional] | +| **isHideRiskToken** | **Boolean**| Whether to hide risk tokens. true=hide risk tokens (default), false=show all tokens including risk tokens. | [optional] | +| **limit** | **Integer**| Maximum number of trades to return. Effective only for trackerType=3 (custom address list); trackerType=1/2 ignore this and use the downstream public query fixed cap. Omit to use the downstream default. | [optional] | + +### Return type + +[**GetTrackedTradesResponse**](GetTrackedTradesResponse.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** | Address tracker trades returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + diff --git a/clients/web3-wallet/docs/BinanceChainId.md b/clients/web3-wallet/docs/BinanceChainId.md new file mode 100644 index 0000000..c5507d8 --- /dev/null +++ b/clients/web3-wallet/docs/BinanceChainId.md @@ -0,0 +1,11 @@ + + +# BinanceChainId + +## Enum + + +* `CT_501` (value: `"CT_501"`) + + + diff --git a/clients/web3-wallet/docs/BroadcastTransactionsRequest.md b/clients/web3-wallet/docs/BroadcastTransactionsRequest.md index a4ce593..e82f1be 100644 --- a/clients/web3-wallet/docs/BroadcastTransactionsRequest.md +++ b/clients/web3-wallet/docs/BroadcastTransactionsRequest.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | -|**signedTransaction** | **String** | Client-signed raw transaction. EVM chains use a hex-encoded RLP transaction; Solana uses a base64-encoded signed transaction. | | -|**address** | **String** | Sender wallet address. Used for status attribution and signature verification. | | +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana, \"CT_195\"=Tron). | | +|**signedTransaction** | **String** | Client-signed raw transaction. Format depends on `binanceChainId`: - **EVM chains**: hex-encoded RLP transaction (e.g. `0xf86c...`). - **Solana (`CT_501`)**: base64-encoded signed transaction. - **Tron (`CT_195`)**: JSON string of the signed transaction returned by a Tron signer, containing `raw_data` (with `contract[].parameter.value.owner_address`) and a `signature` array. Example: `{\"raw_data\":{\"contract\":[{\"type\":\"TriggerSmartContract\",\"parameter\":{\"value\":{\"owner_address\":\"T...\",\"contract_address\":\"T...\",\"data\":\"<calldata hex>\",\"call_value\":0}}}]},\"signature\":[\"...\"]}`. Note for Tron: `signedTransaction` is NOT the calldata hex passed to `simulate` / `getGasLimit` under `tronTx.triggerSmartContractParams.data`. The signer is extracted from `raw_data.contract[0].parameter.value.owner_address` and must match `address`; passing calldata hex here will be rejected with `code=40001, invalid signedTransaction: failed to parse Tron signedTransaction: syntax error`. | | +|**address** | **String** | Sender wallet address. Used for status attribution and signature verification. On Tron and Solana the address is case-sensitive base58check. | | |**enableMevProtection** | **Boolean** | When true, route the transaction through a private mempool for MEV protection. | [optional] | diff --git a/clients/web3-wallet/docs/BroadcastTransactionsResponseData.md b/clients/web3-wallet/docs/BroadcastTransactionsResponseData.md index e8a19d1..19e0b54 100644 --- a/clients/web3-wallet/docs/BroadcastTransactionsResponseData.md +++ b/clients/web3-wallet/docs/BroadcastTransactionsResponseData.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**orderId** | **String** | Internal order identifier. Use this to query on-chain status via the post-transaction service. | [optional] | -|**txHash** | **String** | On-chain transaction hash. | [optional] | +|**txHash** | **String** | On-chain transaction hash. EVM chains return a hex hash; Tron returns a base58check hash; Solana returns a base58 hash. | [optional] | diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponse.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponse.md new file mode 100644 index 0000000..87940a4 --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponse.md @@ -0,0 +1,17 @@ + + +# BuildSolanaSwapInstructionsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**BuildSolanaSwapInstructionsResponseData**](BuildSolanaSwapInstructionsResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseData.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseData.md new file mode 100644 index 0000000..edd9746 --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseData.md @@ -0,0 +1,16 @@ + + +# BuildSolanaSwapInstructionsResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**addressLookupTableAccount** | **List<String>** | Address Lookup Table addresses (Base58) referenced by the transaction, including the platform-injected custom ALT. The caller must fetch each ALT account (`getAccountInfo`) and pass the parsed lookup data when compiling the v0 message. | [optional] | +|**instructionLists** | [**List<BuildSolanaSwapInstructionsResponseDataInstructionListsInner>**](BuildSolanaSwapInstructionsResponseDataInstructionListsInner.md) | Ordered uncompiled instructions to assemble into the v0 transaction. | [optional] | +|**routerResult** | [**BuildSolanaSwapInstructionsResponseDataRouterResult**](BuildSolanaSwapInstructionsResponseDataRouterResult.md) | | [optional] | +|**tx** | [**BuildSolanaSwapInstructionsResponseDataTx**](BuildSolanaSwapInstructionsResponseDataTx.md) | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataInstructionListsInner.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataInstructionListsInner.md new file mode 100644 index 0000000..9c6cc61 --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataInstructionListsInner.md @@ -0,0 +1,15 @@ + + +# BuildSolanaSwapInstructionsResponseDataInstructionListsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**programId** | **String** | Program that owns the instruction (Base58). | [optional] | +|**data** | **String** | Instruction data, Base64-encoded. May be an empty string for instructions without data. | [optional] | +|**accounts** | [**List<BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner>**](BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.md) | Accounts referenced by the instruction, in ABI order. | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.md new file mode 100644 index 0000000..056668f --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.md @@ -0,0 +1,15 @@ + + +# BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pubkey** | **String** | Account public key (Base58). | [optional] | +|**isSigner** | **Boolean** | Whether the account must sign the transaction. | [optional] | +|**isWritable** | **Boolean** | Whether the account is writable. | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResult.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResult.md new file mode 100644 index 0000000..889520d --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResult.md @@ -0,0 +1,24 @@ + + +# BuildSolanaSwapInstructionsResponseDataRouterResult + +Routing result (same shape and semantics as `/swap`'s `routerResult`). + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binanceChainId** | **String** | Chain identifier (always `CT_501`). | [optional] | +|**vendorName** | **String** | Vendor that supplied the executed quote (Solana vendors include Jupiter, LiquidMesh). | [optional] | +|**fromTokenAmount** | **String** | Sell-token amount (smallest unit, integer string). | [optional] | +|**toTokenAmount** | **String** | Estimated buy-token amount (smallest unit, integer string). | [optional] | +|**tradeFee** | **String** | Estimated network fee in USD. | [optional] | +|**estimateGasFee** | **String** | Estimated compute units for the transaction (echoes `computeUnitLimit`). | [optional] | +|**router** | **String** | Routing path description, mints joined with \"--\". | [optional] | +|**priceImpactPercent** | **String** | Price impact percentage. | [optional] | +|**dexRouterList** | [**List<BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner>**](BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.md) | Routing path segments (same shape as `/quote`'s `dexRouterList`). | [optional] | +|**fromToken** | [**BuildSolanaSwapInstructionsResponseDataRouterResultFromToken**](BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.md) | | [optional] | +|**toToken** | [**BuildSolanaSwapInstructionsResponseDataRouterResultToToken**](BuildSolanaSwapInstructionsResponseDataRouterResultToToken.md) | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.md new file mode 100644 index 0000000..ab54b3a --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.md @@ -0,0 +1,17 @@ + + +# BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dexProtocol** | [**BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol**](BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.md) | | [optional] | +|**fromToken** | [**BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken**](BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.md) | | [optional] | +|**fromTokenIndex** | **String** | | [optional] | +|**toToken** | [**BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken**](BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.md) | | [optional] | +|**toTokenIndex** | **String** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.md new file mode 100644 index 0000000..447d92b --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.md @@ -0,0 +1,14 @@ + + +# BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dexName** | **String** | | [optional] | +|**percent** | **String** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.md new file mode 100644 index 0000000..781fa3e --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.md @@ -0,0 +1,14 @@ + + +# BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenContractAddress** | **String** | | [optional] | +|**tokenSymbol** | **String** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.md new file mode 100644 index 0000000..63dd50e --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.md @@ -0,0 +1,14 @@ + + +# BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenContractAddress** | **String** | | [optional] | +|**tokenSymbol** | **String** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.md new file mode 100644 index 0000000..6e6040b --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.md @@ -0,0 +1,16 @@ + + +# BuildSolanaSwapInstructionsResponseDataRouterResultFromToken + +Sell-token metadata. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenContractAddress** | **String** | | [optional] | +|**tokenSymbol** | **String** | | [optional] | +|**decimal** | **String** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultToToken.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultToToken.md new file mode 100644 index 0000000..bf224f8 --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataRouterResultToToken.md @@ -0,0 +1,16 @@ + + +# BuildSolanaSwapInstructionsResponseDataRouterResultToToken + +Buy-token metadata. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenContractAddress** | **String** | | [optional] | +|**tokenSymbol** | **String** | | [optional] | +|**decimal** | **String** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataTx.md b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataTx.md new file mode 100644 index 0000000..ac3aef8 --- /dev/null +++ b/clients/web3-wallet/docs/BuildSolanaSwapInstructionsResponseDataTx.md @@ -0,0 +1,17 @@ + + +# BuildSolanaSwapInstructionsResponseDataTx + +Transaction summary (no `data` field — replaced by `instructionLists`). Contains the fields the caller needs to display or audit before signing. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**from** | **String** | User wallet address (transaction sender / fee payer). | [optional] | +|**to** | **String** | Platform Router program address (the swap target program). | [optional] | +|**minReceiveAmount** | **String** | Minimum buy-token amount the user accepts at the slippage limit (smallest unit, integer string). | [optional] | +|**slippagePercent** | **String** | Slippage value applied to this transaction (percentage string). | [optional] | + + + diff --git a/clients/web3-wallet/docs/BuildSwapTransactionResponseData.md b/clients/web3-wallet/docs/BuildSwapTransactionResponseData.md index 0e4f3a7..b91543a 100644 --- a/clients/web3-wallet/docs/BuildSwapTransactionResponseData.md +++ b/clients/web3-wallet/docs/BuildSwapTransactionResponseData.md @@ -9,6 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**routerResult** | [**BuildSwapTransactionResponseDataRouterResult**](BuildSwapTransactionResponseDataRouterResult.md) | | [optional] | |**tx** | [**BuildSwapTransactionResponseDataTx**](BuildSwapTransactionResponseDataTx.md) | | [optional] | +|**executionMode** | **String** | Execution mode for this swap. `SWAP` = sign the `tx` object and broadcast to the chain. `RFQ` = sign `rfq.typedDataToSign` with EIP-712 (`eth_signTypedData_v4`), then submit via `POST /order/submit` and poll `GET /order/{orderId}` for settlement status. Equity / RWA tokens always return `RFQ`. | [optional] | +|**rfq** | [**BuildSwapTransactionResponseDataRfq**](BuildSwapTransactionResponseDataRfq.md) | | [optional] | diff --git a/clients/web3-wallet/docs/BuildSwapTransactionResponseDataRfq.md b/clients/web3-wallet/docs/BuildSwapTransactionResponseDataRfq.md new file mode 100644 index 0000000..471acb1 --- /dev/null +++ b/clients/web3-wallet/docs/BuildSwapTransactionResponseDataRfq.md @@ -0,0 +1,18 @@ + + +# BuildSwapTransactionResponseDataRfq + +RFQ order payload. Present only when `executionMode=RFQ`. Contains the EIP-712 typed data to sign, the target vendor, the signing scheme, and (when requested) the approve transaction data. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**vendor** | **String** | RFQ vendor that will settle this order on-chain. Pass this as the `vendor` field in `POST /order/submit`. | [optional] | +|**txType** | **String** | Transaction type for this RFQ order. Currently always `EIP712` (all three RFQ vendors use EIP-712 typed-data signing); reserved for future signing schemes. | [optional] | +|**typedDataToSign** | **String** | EIP-712 typed data payload for `eth_signTypedData_v4`, serialized as a hex string (or JSON-encoded string). Sign with the wallet that matches `userWalletAddress` from `/quote`. Pass the resulting signature as `userSignature` in `POST /order/submit`. | [optional] | +|**signingScheme** | **String** | Signing scheme required by this vendor. Pass this as `signingScheme` in `POST /order/submit`. | [optional] | +|**signatureData** | **List<String>** | Approve transaction data, present only when `approveTransaction=true` was passed and the from-token is an EVM ERC-20. Each element is a JSON string containing `approveContract` (the spender address, resolved per vendor: InchFusion→router, PcsXRfq→Permit2, CowSwap→VaultRelayer) and `approveTxCalldata` (the ERC-20 `approve()` calldata). Empty list otherwise. | [optional] | + + + diff --git a/clients/web3-wallet/docs/MarketApi.md b/clients/web3-wallet/docs/GeneralDataApi.md similarity index 84% rename from clients/web3-wallet/docs/MarketApi.md rename to clients/web3-wallet/docs/GeneralDataApi.md index e0e0e40..9ce1919 100644 --- a/clients/web3-wallet/docs/MarketApi.md +++ b/clients/web3-wallet/docs/GeneralDataApi.md @@ -1,21 +1,22 @@ -# MarketApi +# GeneralDataApi All URIs are relative to *https://web3.binance.com/build* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**getCandles**](MarketApi.md#getCandles) | **GET** /api/v1/dex/market/candles | Get Candles | -| [**getHoldersRanking**](MarketApi.md#getHoldersRanking) | **GET** /api/v1/dex/market/token/holder | Get Holders Ranking | -| [**getHotTokenList**](MarketApi.md#getHotTokenList) | **GET** /api/v1/dex/market/token/hot-token | Get Hot Token List | -| [**getSupportedChains**](MarketApi.md#getSupportedChains) | **GET** /api/v1/dex/market/supported/chain | Get Supported Chains | -| [**getTokenAdvancedInfo**](MarketApi.md#getTokenAdvancedInfo) | **GET** /api/v1/dex/market/token/advanced-info | Get Token Advanced Info | -| [**getTokenBasicInfo**](MarketApi.md#getTokenBasicInfo) | **POST** /api/v1/dex/market/token/basic-info | Get Token Basic Info | -| [**getTokenPrice**](MarketApi.md#getTokenPrice) | **POST** /api/v1/dex/market/price | Get Token Price | -| [**getTokenTrades**](MarketApi.md#getTokenTrades) | **GET** /api/v1/dex/market/trades | Get Token Trades | -| [**getTokenTradingInfo**](MarketApi.md#getTokenTradingInfo) | **POST** /api/v1/dex/market/price-info | Get Token Trading Info | -| [**getTopLiquidityPools**](MarketApi.md#getTopLiquidityPools) | **GET** /api/v1/dex/market/token/top-liquidity | Get Top Liquidity Pools | -| [**getTopTraders**](MarketApi.md#getTopTraders) | **GET** /api/v1/dex/market/token/top-trader | Get Top Traders | -| [**searchToken**](MarketApi.md#searchToken) | **GET** /api/v1/dex/market/token/search | Search Token | +| [**getCandles**](GeneralDataApi.md#getCandles) | **GET** /api/v1/dex/market/candles | Get Candles | +| [**getHoldersRanking**](GeneralDataApi.md#getHoldersRanking) | **GET** /api/v1/dex/market/token/holder | Get Holders Ranking | +| [**getHotTokenList**](GeneralDataApi.md#getHotTokenList) | **GET** /api/v1/dex/market/token/hot-token | Get Hot Token List | +| [**getSupportedChains**](GeneralDataApi.md#getSupportedChains) | **GET** /api/v1/dex/market/supported/chain | Get Supported Chains | +| [**getTokenAdvancedInfo**](GeneralDataApi.md#getTokenAdvancedInfo) | **GET** /api/v1/dex/market/token/advanced-info | Get Token Advanced Info | +| [**getTokenBasicInfo**](GeneralDataApi.md#getTokenBasicInfo) | **POST** /api/v1/dex/market/token/basic-info | Get Token Basic Info | +| [**getTokenDevInfo**](GeneralDataApi.md#getTokenDevInfo) | **GET** /api/v1/dex/market/memepump/tokenDevInfo | Get Token Dev Info | +| [**getTokenPrice**](GeneralDataApi.md#getTokenPrice) | **POST** /api/v1/dex/market/price | Get Token Price | +| [**getTokenTrades**](GeneralDataApi.md#getTokenTrades) | **GET** /api/v1/dex/market/trades | Get Token Trades | +| [**getTokenTradingInfo**](GeneralDataApi.md#getTokenTradingInfo) | **POST** /api/v1/dex/market/price-info | Get Token Trading Info | +| [**getTopLiquidityPools**](GeneralDataApi.md#getTopLiquidityPools) | **GET** /api/v1/dex/market/token/top-liquidity | Get Top Liquidity Pools | +| [**getTopTraders**](GeneralDataApi.md#getTopTraders) | **GET** /api/v1/dex/market/token/top-trader | Get Top Traders | +| [**searchToken**](GeneralDataApi.md#searchToken) | **GET** /api/v1/dex/market/token/search | Search Token | @@ -33,14 +34,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); String binanceChainId = "1"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). String tokenContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"; // String | Token contract address. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -60,7 +61,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getCandles"); + System.err.println("Exception when calling GeneralDataApi#getCandles"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -119,14 +120,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); String binanceChainId = "1"; // String | Unique chain identifier. String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; // String | Token contract address. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -140,7 +141,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getHoldersRanking"); + System.err.println("Exception when calling GeneralDataApi#getHoldersRanking"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -183,7 +184,7 @@ No authorization required # **getHotTokenList** -> GetHotTokenListResponse getHotTokenList().recvWindow(recvWindow).nonce(nonce).binanceChainId(binanceChainId).rankBy(rankBy).rankingTimeFrame(rankingTimeFrame).priceChangePercentMin(priceChangePercentMin).priceChangePercentMax(priceChangePercentMax).volumeMin(volumeMin).volumeMax(volumeMax).txsMin(txsMin).txsMax(txsMax).marketCapMin(marketCapMin).marketCapMax(marketCapMax).liquidityMin(liquidityMin).liquidityMax(liquidityMax).devHoldingPercentMin(devHoldingPercentMin).devHoldingPercentMax(devHoldingPercentMax).inflowUsdMin(inflowUsdMin).inflowUsdMax(inflowUsdMax).holdersMin(holdersMin).holdersMax(holdersMax).bnHolderCountMin(bnHolderCountMin).bnHolderCountMax(bnHolderCountMax).top10HoldingPercentMin(top10HoldingPercentMin).top10HoldingPercentMax(top10HoldingPercentMax).sniperHoldingPercentMin(sniperHoldingPercentMin).sniperHoldingPercentMax(sniperHoldingPercentMax).smartMoneyHoldingPercentMin(smartMoneyHoldingPercentMin).smartMoneyHoldingPercentMax(smartMoneyHoldingPercentMax).kolHoldingPercentMin(kolHoldingPercentMin).kolHoldingPercentMax(kolHoldingPercentMax).proHoldingPercentMin(proHoldingPercentMin).proHoldingPercentMax(proHoldingPercentMax).freshWalletHoldingPercentMin(freshWalletHoldingPercentMin).freshWalletHoldingPercentMax(freshWalletHoldingPercentMax).insiderHoldingPercentMin(insiderHoldingPercentMin).insiderHoldingPercentMax(insiderHoldingPercentMax).bundlerHoldingPercentMin(bundlerHoldingPercentMin).bundlerHoldingPercentMax(bundlerHoldingPercentMax).devCreatedTokenCountMin(devCreatedTokenCountMin).devCreatedTokenCountMax(devCreatedTokenCountMax).devMigratedTokenCountMin(devMigratedTokenCountMin).devMigratedTokenCountMax(devMigratedTokenCountMax).devMigratedTokenPercentMin(devMigratedTokenPercentMin).devMigratedTokenPercentMax(devMigratedTokenPercentMax).isDevSoldAll(isDevSoldAll).isDevBurned(isDevBurned).isMint(isMint).isFreeze(isFreeze).isHideWashTradingTokens(isHideWashTradingTokens).isHideDevWashTradingTokens(isHideDevWashTradingTokens).isHideInternalWashTradingTokens(isHideInternalWashTradingTokens).pageId(pageId).size(size).execute(); +> GetHotTokenListResponse getHotTokenList(binanceChainId).recvWindow(recvWindow).nonce(nonce).rankBy(rankBy).rankingTimeFrame(rankingTimeFrame).priceChangePercentMin(priceChangePercentMin).priceChangePercentMax(priceChangePercentMax).volumeMin(volumeMin).volumeMax(volumeMax).txsMin(txsMin).txsMax(txsMax).marketCapMin(marketCapMin).marketCapMax(marketCapMax).liquidityMin(liquidityMin).liquidityMax(liquidityMax).devHoldingPercentMin(devHoldingPercentMin).devHoldingPercentMax(devHoldingPercentMax).inflowUsdMin(inflowUsdMin).inflowUsdMax(inflowUsdMax).holdersMin(holdersMin).holdersMax(holdersMax).bnHolderCountMin(bnHolderCountMin).bnHolderCountMax(bnHolderCountMax).top10HoldingPercentMin(top10HoldingPercentMin).top10HoldingPercentMax(top10HoldingPercentMax).sniperHoldingPercentMin(sniperHoldingPercentMin).sniperHoldingPercentMax(sniperHoldingPercentMax).smartMoneyHoldingPercentMin(smartMoneyHoldingPercentMin).smartMoneyHoldingPercentMax(smartMoneyHoldingPercentMax).kolHoldingPercentMin(kolHoldingPercentMin).kolHoldingPercentMax(kolHoldingPercentMax).proHoldingPercentMin(proHoldingPercentMin).proHoldingPercentMax(proHoldingPercentMax).freshWalletHoldingPercentMin(freshWalletHoldingPercentMin).freshWalletHoldingPercentMax(freshWalletHoldingPercentMax).insiderHoldingPercentMin(insiderHoldingPercentMin).insiderHoldingPercentMax(insiderHoldingPercentMax).bundlerHoldingPercentMin(bundlerHoldingPercentMin).bundlerHoldingPercentMax(bundlerHoldingPercentMax).devCreatedTokenCountMin(devCreatedTokenCountMin).devCreatedTokenCountMax(devCreatedTokenCountMax).devMigratedTokenCountMin(devMigratedTokenCountMin).devMigratedTokenCountMax(devMigratedTokenCountMax).devMigratedTokenPercentMin(devMigratedTokenPercentMin).devMigratedTokenPercentMax(devMigratedTokenPercentMax).isDevSoldAll(isDevSoldAll).isDevBurned(isDevBurned).isMint(isMint).isFreeze(isFreeze).isHideWashTradingTokens(isHideWashTradingTokens).isHideDevWashTradingTokens(isHideDevWashTradingTokens).isHideInternalWashTradingTokens(isHideInternalWashTradingTokens).pageId(pageId).size(size).execute(); Get Hot Token List @@ -196,17 +197,17 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); + String binanceChainId = "1"; // String | Chain identifier. Single value only. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. - String binanceChainId = "1"; // String | Chain identifier. Single value only. Omit to return mixed results across all chains. RankBy rankBy = RankBy.fromValue("1"); // RankBy | Ranking field. 1=price, 2=price change, 3=transactions, 4=volume, 5=market cap, 6=liquidity, 7=creation time, 8=holders, 9=Binance MPC wallet holders, 10=net inflow. RankingTimeFrame rankingTimeFrame = RankingTimeFrame.fromValue("1"); // RankingTimeFrame | Data time range. 1=1 min, 2=5 min, 3=1 hour, 4=4 hours, 5=24 hours. Default 1 hour. String priceChangePercentMin = "5"; // String | Minimum price change filter. \"5\" means 5%. @@ -259,10 +260,9 @@ public class Example { Integer pageId = 1; // Integer | Pagination identifier. Do not pass on the first request; pass the page value from the previous response to get the next page. Integer size = 100; // Integer | Page size. Maximum 100. Defaults to 100. try { - GetHotTokenListResponse result = apiInstance.getHotTokenList() + GetHotTokenListResponse result = apiInstance.getHotTokenList(binanceChainId) .recvWindow(recvWindow) .nonce(nonce) - .binanceChainId(binanceChainId) .rankBy(rankBy) .rankingTimeFrame(rankingTimeFrame) .priceChangePercentMin(priceChangePercentMin) @@ -317,7 +317,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getHotTokenList"); + System.err.println("Exception when calling GeneralDataApi#getHotTokenList"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -331,9 +331,9 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Chain identifier. Single value only. | | | **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | | **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | -| **binanceChainId** | **String**| Chain identifier. Single value only. Omit to return mixed results across all chains. | [optional] | | **rankBy** | [**RankBy**](.md)| Ranking field. 1=price, 2=price change, 3=transactions, 4=volume, 5=market cap, 6=liquidity, 7=creation time, 8=holders, 9=Binance MPC wallet holders, 10=net inflow. | [optional] [enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | | **rankingTimeFrame** | [**RankingTimeFrame**](.md)| Data time range. 1=1 min, 2=5 min, 3=1 hour, 4=4 hours, 5=24 hours. Default 1 hour. | [optional] [default to 3] [enum: 1, 2, 3, 4, 5] | | **priceChangePercentMin** | **String**| Minimum price change filter. \"5\" means 5%. | [optional] | @@ -422,14 +422,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. try { @@ -439,7 +439,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getSupportedChains"); + System.err.println("Exception when calling GeneralDataApi#getSupportedChains"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -492,14 +492,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); String binanceChainId = "1"; // String | Unique chain identifier. String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; // String | Token contract address. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -511,7 +511,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getTokenAdvancedInfo"); + System.err.println("Exception when calling GeneralDataApi#getTokenAdvancedInfo"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -566,14 +566,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); String binanceChainId = "1"; // String | Unique chain identifier. String tokenContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"; // String | Token contract address. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -585,7 +585,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getTokenBasicInfo"); + System.err.println("Exception when calling GeneralDataApi#getTokenBasicInfo"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -626,6 +626,80 @@ No authorization required | **403** | Forbidden. The API key does not have permission to access this endpoint. | - | | **404** | Not Found. The requested resource or endpoint does not exist. | - | + +# **getTokenDevInfo** +> GetTokenDevInfoResponse getTokenDevInfo(binanceChainId, tokenContractAddress).recvWindow(recvWindow).nonce(nonce).execute(); + +Get Token Dev Info + +Return developer profile for a token, including historical token launch stats, current holding percentage, and initial funding source. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); + String binanceChainId = "CT_501"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String tokenContractAddress = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"; // String | Token contract address. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + try { + GetTokenDevInfoResponse result = apiInstance.getTokenDevInfo(binanceChainId, tokenContractAddress) + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GeneralDataApi#getTokenDevInfo"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **tokenContractAddress** | **String**| Token contract address. EVM chains accept lowercase 42-character hex addresses; Solana accepts base58 addresses (case-sensitive). | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | + +### Return type + +[**GetTokenDevInfoResponse**](GetTokenDevInfoResponse.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** | Token dev info returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + # **getTokenPrice** > GetTokenPriceResponse getTokenPrice().recvWindow(recvWindow).nonce(nonce).execute(); @@ -641,14 +715,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. try { @@ -658,7 +732,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getTokenPrice"); + System.err.println("Exception when calling GeneralDataApi#getTokenPrice"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -712,14 +786,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); String binanceChainId = "1"; // String | Unique chain identifier. String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; // String | Token contract address. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -739,7 +813,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getTokenTrades"); + System.err.println("Exception when calling GeneralDataApi#getTokenTrades"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -798,14 +872,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. try { @@ -815,7 +889,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getTokenTradingInfo"); + System.err.println("Exception when calling GeneralDataApi#getTokenTradingInfo"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -869,14 +943,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); String binanceChainId = "1"; // String | Unique chain identifier. String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; // String | Token contract address. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -888,7 +962,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getTopLiquidityPools"); + System.err.println("Exception when calling GeneralDataApi#getTopLiquidityPools"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -943,14 +1017,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); String binanceChainId = "1"; // String | Unique chain identifier. String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; // String | Token contract address. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -964,7 +1038,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#getTopTraders"); + System.err.println("Exception when calling GeneralDataApi#getTopTraders"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1020,14 +1094,14 @@ import com.binance.connector.client.web3_wallet.ApiClient; import com.binance.connector.client.web3_wallet.ApiException; import com.binance.connector.client.web3_wallet.Configuration; import com.binance.connector.client.web3_wallet.models.*; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://web3.binance.com/build"); - MarketApi apiInstance = new MarketApi(defaultClient); + GeneralDataApi apiInstance = new GeneralDataApi(defaultClient); String chains = "1,56,CT_501"; // String | List of chain IDs to search, comma-separated. String search = "USDT"; // String | Search keyword. Can be a token address or token symbol. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -1039,7 +1113,7 @@ public class Example { .execute(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#searchToken"); + System.err.println("Exception when calling GeneralDataApi#searchToken"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); diff --git a/clients/web3-wallet/docs/GetAddressPnLForSpecificTokenResponse.md b/clients/web3-wallet/docs/GetAddressPnLForSpecificTokenResponse.md new file mode 100644 index 0000000..ebcc07e --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressPnLForSpecificTokenResponse.md @@ -0,0 +1,17 @@ + + +# GetAddressPnLForSpecificTokenResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**GetAddressPnLForSpecificTokenResponseData**](GetAddressPnLForSpecificTokenResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressPnLForSpecificTokenResponseData.md b/clients/web3-wallet/docs/GetAddressPnLForSpecificTokenResponseData.md new file mode 100644 index 0000000..c19c0f7 --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressPnLForSpecificTokenResponseData.md @@ -0,0 +1,28 @@ + + +# GetAddressPnLForSpecificTokenResponseData + +Token latest PnL details. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**realizedPnlUsd** | **String** | Cumulative realized PnL for this token, denominated in USD. Positive means profit, negative means loss. | [optional] | +|**realizedPnlPercent** | **String** | Realized PnL percentage. No percent sign included. | [optional] | +|**buyTxVolume** | **String** | Cumulative buy spend for this token, denominated in USD. | [optional] | +|**buyAmount** | **String** | Cumulative buy quantity (token units). | [optional] | +|**buyTxCount** | **String** | Number of buy transactions. | [optional] | +|**sellTxVolume** | **String** | Cumulative sell proceeds for this token, denominated in USD. | [optional] | +|**sellAmount** | **String** | Cumulative sell quantity (token units). | [optional] | +|**sellTxCount** | **String** | Number of sell transactions. | [optional] | +|**buyAvgPrice** | **String** | Average buy price, denominated in USD. | [optional] | +|**sellAvgPrice** | **String** | Average sell price, denominated in USD. | [optional] | +|**tokenBalanceUsd** | **String** | Current market value of the address's holding in this token, denominated in USD. Returns \"0\" when fully sold. | [optional] | +|**tokenBalanceAmount** | **String** | Current holding amount (token units). Returns \"0\" when fully sold. | [optional] | +|**maxBalanceAmount** | **String** | Maximum historical holding amount (token units). | [optional] | +|**holdingDuration** | **String** | Cumulative holding duration in milliseconds. Counts only actual holding periods; gaps between sell and re-buy are excluded. If still holding, counts up to the current time. | [optional] | +|**isPnlSupported** | **Boolean** | Whether PnL calculation is meaningful for this token. true=supported; false=not supported. Returns false for stablecoins (USDT/USDC/DAI etc.), native tokens (ETH/BNB/SOL etc.), and wrapped tokens (WETH/WBNB/WSOL etc.). Returns true for regular trading tokens. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponse.md b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponse.md new file mode 100644 index 0000000..cd36c0a --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponse.md @@ -0,0 +1,17 @@ + + +# GetAddressPortfolioOverviewResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**GetAddressPortfolioOverviewResponseData**](GetAddressPortfolioOverviewResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseData.md b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseData.md new file mode 100644 index 0000000..c40928b --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseData.md @@ -0,0 +1,27 @@ + + +# GetAddressPortfolioOverviewResponseData + +Address portfolio overview. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**realizedPnlUsd** | **String** | Total realized PnL within the time frame, denominated in USD. Positive means profit, negative means loss. | [optional] | +|**realizedPnlPercent** | **String** | Realized PnL percentage within the time frame. \"16.44\" means +16.44%. No percent sign included. | [optional] | +|**dailyPnl** | [**List<GetAddressPortfolioOverviewResponseDataDailyPnlInner>**](GetAddressPortfolioOverviewResponseDataDailyPnlInner.md) | Daily realized PnL breakdown, sorted by date descending (most recent first). Number of entries matches the timeFrame. | [optional] | +|**winRate** | **String** | Win rate within the time frame. \"61.11\" means 61.11%. No percent sign included. | [optional] | +|**tokenCountByPnlPercent** | [**GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent**](GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.md) | | [optional] | +|**buyTxCount** | **String** | Number of buy transactions within the time frame. | [optional] | +|**sellTxCount** | **String** | Number of sell transactions within the time frame. | [optional] | +|**totalTokenCount** | **String** | Total number of distinct tokens traded within the time frame. | [optional] | +|**buyTxVolume** | **String** | Total buy volume within the time frame, denominated in USD. | [optional] | +|**sellTxVolume** | **String** | Total sell volume within the time frame, denominated in USD. | [optional] | +|**avgBuyValueUsd** | **String** | Average buy value per transaction within the time frame, denominated in USD. | [optional] | +|**top3PnlTokenSumUsd** | **String** | Total realized PnL of the top 3 profit tokens, denominated in USD. | [optional] | +|**top3PnlTokenPercent** | **String** | Percentage of total realized PnL contributed by the top 3 profit tokens. No percent sign included. | [optional] | +|**topPnlTokenList** | [**List<GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner>**](GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.md) | Top 3 tokens by realized PnL. Returns fewer items if fewer than 3 tokens were traded. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataDailyPnlInner.md b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataDailyPnlInner.md new file mode 100644 index 0000000..449ed41 --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataDailyPnlInner.md @@ -0,0 +1,14 @@ + + +# GetAddressPortfolioOverviewResponseDataDailyPnlInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**date** | **String** | Date in YYYY-MM-DD format. | [optional] | +|**pnlUsd** | **String** | Realized PnL for this day, denominated in USD. Positive means profit, negative means loss. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.md b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.md new file mode 100644 index 0000000..2fe87c0 --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.md @@ -0,0 +1,19 @@ + + +# GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + +Token count breakdown by realized PnL percentage range. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**over500Percent** | **String** | Number of tokens with realized PnL ≥500%. | [optional] | +|**from200To500Percent** | **String** | Number of tokens with realized PnL in [200%, 500%). | [optional] | +|**from50To200Percent** | **String** | Number of tokens with realized PnL in [50%, 200%). | [optional] | +|**zeroTo50Percent** | **String** | Number of tokens with realized PnL in [0%, 50%). | [optional] | +|**zeroToMinus50Percent** | **String** | Number of tokens with realized PnL in [-50%, 0%). | [optional] | +|**overMinus50Percent** | **String** | Number of tokens with realized PnL < -50%. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.md b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.md new file mode 100644 index 0000000..0d57a2a --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.md @@ -0,0 +1,16 @@ + + +# GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenContractAddress** | **String** | Token contract address. EVM addresses are lowercase; Solana addresses are case-sensitive. | [optional] | +|**tokenSymbol** | **String** | Token symbol. | [optional] | +|**tokenPnLUsd** | **String** | Realized PnL for this token, denominated in USD. Positive means profit, negative means loss. | [optional] | +|**tokenPnLPercent** | **String** | Realized PnL percentage for this token. No percent sign included. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressRecentPnLResponse.md b/clients/web3-wallet/docs/GetAddressRecentPnLResponse.md new file mode 100644 index 0000000..f048403 --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressRecentPnLResponse.md @@ -0,0 +1,17 @@ + + +# GetAddressRecentPnLResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**GetAddressRecentPnLResponseData**](GetAddressRecentPnLResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressRecentPnLResponseData.md b/clients/web3-wallet/docs/GetAddressRecentPnLResponseData.md new file mode 100644 index 0000000..e0f0f65 --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressRecentPnLResponseData.md @@ -0,0 +1,15 @@ + + +# GetAddressRecentPnLResponseData + +Paginated PnL list. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cursor** | **String** | Pagination cursor for the next page. Empty string when no more data. | [optional] | +|**pnlList** | [**List<GetAddressRecentPnLResponseDataPnlListInner>**](GetAddressRecentPnLResponseDataPnlListInner.md) | PnL records sorted by lastActiveTimestamp descending. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressRecentPnLResponseDataPnlListInner.md b/clients/web3-wallet/docs/GetAddressRecentPnLResponseDataPnlListInner.md new file mode 100644 index 0000000..256d9f9 --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressRecentPnLResponseDataPnlListInner.md @@ -0,0 +1,27 @@ + + +# GetAddressRecentPnLResponseDataPnlListInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binanceChainId** | **String** | Unique chain identifier. | [optional] | +|**tokenContractAddress** | **String** | Token contract address. EVM addresses are lowercase; Solana addresses are case-sensitive. | [optional] | +|**tokenSymbol** | **String** | Token symbol. | [optional] | +|**lastActiveTimestamp** | **String** | Timestamp of the last transaction for this token, Unix millisecond timestamp. | [optional] | +|**realizedPnlUsd** | **String** | Realized PnL for this token, denominated in USD. Positive means profit, negative means loss. | [optional] | +|**realizedPnlPercent** | **String** | Realized PnL percentage for this token. No percent sign included. | [optional] | +|**tokenBalanceUsd** | **String** | Current market value of the address's holding in this token, denominated in USD. | [optional] | +|**tokenBalanceAmount** | **String** | Current holding amount of this token (token units). | [optional] | +|**tokenPositionDuration** | [**GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration**](GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.md) | | [optional] | +|**buyTxCount** | **String** | Number of buy transactions for this token. | [optional] | +|**buyTxVolume** | **String** | Total buy spend for this token, denominated in USD. | [optional] | +|**buyAvgPrice** | **String** | Average buy price for this token, denominated in USD. | [optional] | +|**sellTxCount** | **String** | Number of sell transactions for this token. | [optional] | +|**sellTxVolume** | **String** | Total sell proceeds for this token, denominated in USD. | [optional] | +|**sellAvgPrice** | **String** | Average sell price for this token, denominated in USD. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.md b/clients/web3-wallet/docs/GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.md new file mode 100644 index 0000000..c84e36e --- /dev/null +++ b/clients/web3-wallet/docs/GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.md @@ -0,0 +1,14 @@ + + +# GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + +Holding duration information for this token. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**holdingTimestamp** | **String** | Timestamp of the first buy for this token, Unix millisecond timestamp. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetAggregatedQuoteResponseDataInner.md b/clients/web3-wallet/docs/GetAggregatedQuoteResponseDataInner.md index 75a1423..fc926ef 100644 --- a/clients/web3-wallet/docs/GetAggregatedQuoteResponseDataInner.md +++ b/clients/web3-wallet/docs/GetAggregatedQuoteResponseDataInner.md @@ -19,6 +19,9 @@ |**fromToken** | [**GetAggregatedQuoteResponseDataInnerFromToken**](GetAggregatedQuoteResponseDataInnerFromToken.md) | | [optional] | |**toToken** | [**GetAggregatedQuoteResponseDataInnerToToken**](GetAggregatedQuoteResponseDataInnerToToken.md) | | [optional] | |**dexRouterList** | [**List<GetAggregatedQuoteResponseDataInnerDexRouterListInner>**](GetAggregatedQuoteResponseDataInnerDexRouterListInner.md) | Routing path segments. Each segment corresponds to one hop on one DEX protocol; multi-DEX hops are flattened. | [optional] | +|**executionMode** | **String** | Execution mode for this route. `SWAP` = standard on-chain swap (sign the `tx` object from `/swap` and broadcast). `RFQ` = signed order flow (sign `rfq.typedDataToSign` from `/swap` with EIP-712, submit via `POST /order/submit`, poll `GET /order/{orderId}`). Equity / RWA tokens always return `RFQ`. | [optional] | +|**approveTarget** | **String** | The spender contract address the backend will encode into the approve calldata for this route. To obtain that calldata, call `/approve-transaction` with `vendor=<vendorName>` (the string name, e.g. `\"PcsXRfq\"`) — the backend resolves the spender address internally from the vendor name. This field is provided for informational purposes only (e.g. to call ERC-20 `approve()` directly without going through `/approve-transaction`). Null when no approval is needed (e.g. native-token swap or already approved). | [optional] | +|**isBest** | **Boolean** | Whether this route has the highest `toTokenAmount` among all routes returned in this response. At most one route per response has `isBest=true`. | [optional] | diff --git a/clients/web3-wallet/docs/GetDexTradeHistoryResponse.md b/clients/web3-wallet/docs/GetDexTradeHistoryResponse.md new file mode 100644 index 0000000..6b4ec47 --- /dev/null +++ b/clients/web3-wallet/docs/GetDexTradeHistoryResponse.md @@ -0,0 +1,17 @@ + + +# GetDexTradeHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**GetDexTradeHistoryResponseData**](GetDexTradeHistoryResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetDexTradeHistoryResponseData.md b/clients/web3-wallet/docs/GetDexTradeHistoryResponseData.md new file mode 100644 index 0000000..341250b --- /dev/null +++ b/clients/web3-wallet/docs/GetDexTradeHistoryResponseData.md @@ -0,0 +1,15 @@ + + +# GetDexTradeHistoryResponseData + +Paginated DEX transaction list. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cursor** | **String** | Pagination cursor for the next page. Empty string when no more data. | [optional] | +|**transactionList** | [**List<GetDexTradeHistoryResponseDataTransactionListInner>**](GetDexTradeHistoryResponseDataTransactionListInner.md) | DEX transaction records sorted by time descending. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetDexTradeHistoryResponseDataTransactionListInner.md b/clients/web3-wallet/docs/GetDexTradeHistoryResponseDataTransactionListInner.md new file mode 100644 index 0000000..199b913 --- /dev/null +++ b/clients/web3-wallet/docs/GetDexTradeHistoryResponseDataTransactionListInner.md @@ -0,0 +1,23 @@ + + +# GetDexTradeHistoryResponseDataTransactionListInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | Trade type. 1=Buy, 2=Sell. | [optional] | +|**binanceChainId** | **String** | Unique chain identifier. | [optional] | +|**tokenContractAddress** | **String** | Token contract address. EVM addresses are lowercase; Solana addresses are case-sensitive. | [optional] | +|**tokenSymbol** | **String** | Token symbol. | [optional] | +|**valueUsd** | **String** | Transaction value, denominated in USD. | [optional] | +|**amount** | **String** | Token quantity involved in this transaction (token units). | [optional] | +|**price** | **String** | Execution price of this transaction, denominated in USD. | [optional] | +|**marketCap** | **String** | Token market cap at the time of this transaction, denominated in USD. | [optional] | +|**txHash** | **String** | On-chain transaction hash. | [optional] | +|**chainLogoUrl** | **String** | Chain logo image URL. | [optional] | +|**time** | **String** | Transaction on-chain time, Unix millisecond timestamp. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetGasLimitRequest.md b/clients/web3-wallet/docs/GetGasLimitRequest.md index 140406d..2a05709 100644 --- a/clients/web3-wallet/docs/GetGasLimitRequest.md +++ b/clients/web3-wallet/docs/GetGasLimitRequest.md @@ -7,9 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | -|**evmTx** | [**GetGasLimitRequestEvmTx**](GetGasLimitRequestEvmTx.md) | | [optional] | -|**solTx** | [**GetGasLimitRequestSolTx**](GetGasLimitRequestSolTx.md) | | [optional] | +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana, \"CT_195\"=Tron). Provide `evmTx` for EVM chains, `solTx` for Solana, or `tronTx` for Tron — exactly one must be present. Note: `evmTx`, `solTx`, and `tronTx` are marked required in this schema for rendering purposes only; in practice supply exactly one matching `binanceChainId`. | | +|**evmTx** | [**GetGasLimitRequestEvmTx**](GetGasLimitRequestEvmTx.md) | | | +|**solTx** | [**GetGasLimitRequestSolTx**](GetGasLimitRequestSolTx.md) | | | +|**tronTx** | [**GetGasLimitRequestTronTx**](GetGasLimitRequestTronTx.md) | | | diff --git a/clients/web3-wallet/docs/GetGasLimitRequestEvmTx.md b/clients/web3-wallet/docs/GetGasLimitRequestEvmTx.md index f88b551..9a9858f 100644 --- a/clients/web3-wallet/docs/GetGasLimitRequestEvmTx.md +++ b/clients/web3-wallet/docs/GetGasLimitRequestEvmTx.md @@ -11,7 +11,7 @@ EVM transaction payload. Required when `binanceChainId` belongs to an EVM chain. |**from** | **String** | Sender address. | | |**to** | **String** | Destination address (contract or EOA). | | |**value** | **String** | Native token amount in wei (integer string). Use \"0\" for ERC-20 transfers. | | -|**data** | **String** | ABI-encoded calldata (hex). Optional when no contract call is involved. | [optional] | +|**data** | **String** | ABI-encoded calldata (hex). Optional when no contract call is involved. | | diff --git a/clients/web3-wallet/docs/GetGasLimitRequestTronTx.md b/clients/web3-wallet/docs/GetGasLimitRequestTronTx.md new file mode 100644 index 0000000..aeef223 --- /dev/null +++ b/clients/web3-wallet/docs/GetGasLimitRequestTronTx.md @@ -0,0 +1,26 @@ + + +# GetGasLimitRequestTronTx + +Tron transaction payload. Required when `binanceChainId=CT_195`. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**from** | **String** | Sender address (base58check). | | +|**txType** | [**TxTypeEnum**](#TxTypeEnum) | Tron contract type. `TRIGGER_SMART_CONTRACT` requires `triggerSmartContractParams`; `TRANSFER_CONTRACT` requires `transferContractParams`. | | +|**triggerSmartContractParams** | [**GetGasLimitRequestTronTxTriggerSmartContractParams**](GetGasLimitRequestTronTxTriggerSmartContractParams.md) | | [optional] | +|**transferContractParams** | [**GetGasLimitRequestTronTxTransferContractParams**](GetGasLimitRequestTronTxTransferContractParams.md) | | [optional] | + + + +## Enum: TxTypeEnum + +| Name | Value | +|---- | -----| +| TRIGGER_SMART_CONTRACT | "TRIGGER_SMART_CONTRACT" | +| TRANSFER_CONTRACT | "TRANSFER_CONTRACT" | + + + diff --git a/clients/web3-wallet/docs/GetGasLimitRequestTronTxTransferContractParams.md b/clients/web3-wallet/docs/GetGasLimitRequestTronTxTransferContractParams.md new file mode 100644 index 0000000..914d9a6 --- /dev/null +++ b/clients/web3-wallet/docs/GetGasLimitRequestTronTxTransferContractParams.md @@ -0,0 +1,15 @@ + + +# GetGasLimitRequestTronTxTransferContractParams + +Required when `txType=TRANSFER_CONTRACT`. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**toAddress** | **String** | Recipient address (base58check). | | +|**amount** | **Long** | TRX amount in sun (1 TRX = 1_000_000 sun). | | + + + diff --git a/clients/web3-wallet/docs/GetGasLimitRequestTronTxTriggerSmartContractParams.md b/clients/web3-wallet/docs/GetGasLimitRequestTronTxTriggerSmartContractParams.md new file mode 100644 index 0000000..4c0896b --- /dev/null +++ b/clients/web3-wallet/docs/GetGasLimitRequestTronTxTriggerSmartContractParams.md @@ -0,0 +1,17 @@ + + +# GetGasLimitRequestTronTxTriggerSmartContractParams + +Required when `txType=TRIGGER_SMART_CONTRACT`. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**contractAddress** | **String** | Smart-contract address (base58check). | | +|**data** | **String** | ABI-encoded calldata (hex, no `0x` prefix). | | +|**callValue** | **Long** | Amount of TRX (in sun) to attach as `call_value`. | | +|**feeLimitSun** | **Long** | Optional max fee the caller is willing to pay (in sun). If omitted, server default applies. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetGasLimitResponseData.md b/clients/web3-wallet/docs/GetGasLimitResponseData.md index eb93989..5cf3563 100644 --- a/clients/web3-wallet/docs/GetGasLimitResponseData.md +++ b/clients/web3-wallet/docs/GetGasLimitResponseData.md @@ -2,12 +2,19 @@ # GetGasLimitResponseData +Estimated gas limit. On Tron, the response additionally carries energy/bandwidth fields; non-applicable fields are returned as `null`. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**gasLimit** | **String** | Estimated gas limit (EVM) or compute-unit ceiling (Solana), as an integer string. | [optional] | +|**gasLimit** | **String** | Estimated gas limit (EVM), compute-unit ceiling (Solana), or fee limit in sun (Tron), as an integer string. | [optional] | +|**energyRequired** | **String** | Energy consumed by the Tron transaction (integer string). Null on non-Tron chains. | [optional] | +|**bandwidthRequired** | **String** | Bandwidth consumed by the Tron transaction (integer string). Null on non-Tron chains. | [optional] | +|**freeEnergy** | **String** | Free energy available to the account on Tron (integer string). Null on non-Tron chains. | [optional] | +|**freeBandwidth** | **String** | Free bandwidth available to the account on Tron (integer string). Null on non-Tron chains. | [optional] | +|**energyFee** | **String** | Unit price of energy on Tron (sun per energy, integer string). Null on non-Tron chains. | [optional] | +|**bandwidthFee** | **String** | Unit price of bandwidth on Tron (sun per byte, integer string). Null on non-Tron chains. | [optional] | diff --git a/clients/web3-wallet/docs/GetLeaderboardResponse.md b/clients/web3-wallet/docs/GetLeaderboardResponse.md new file mode 100644 index 0000000..d2cd1b5 --- /dev/null +++ b/clients/web3-wallet/docs/GetLeaderboardResponse.md @@ -0,0 +1,17 @@ + + +# GetLeaderboardResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**GetLeaderboardResponseData**](GetLeaderboardResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetLeaderboardResponseData.md b/clients/web3-wallet/docs/GetLeaderboardResponseData.md new file mode 100644 index 0000000..580801f --- /dev/null +++ b/clients/web3-wallet/docs/GetLeaderboardResponseData.md @@ -0,0 +1,15 @@ + + +# GetLeaderboardResponseData + +Paginated leaderboard data. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cursor** | **String** | Pagination cursor for the next page. Empty string when no more data. | [optional] | +|**items** | [**List<GetLeaderboardResponseDataItemsInner>**](GetLeaderboardResponseDataItemsInner.md) | List of leaderboard wallet entries. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInner.md b/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInner.md new file mode 100644 index 0000000..e14dd00 --- /dev/null +++ b/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInner.md @@ -0,0 +1,33 @@ + + +# GetLeaderboardResponseDataItemsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**walletAddress** | **String** | Wallet address. | [optional] | +|**walletName** | **String** | Wallet display name. Empty string when unavailable. | [optional] | +|**walletLogoUrl** | **String** | Wallet avatar URL. Empty string when unavailable. | [optional] | +|**walletTwitterUrl** | **String** | Associated Twitter/X profile URL. Empty string when unavailable. | [optional] | +|**walletType** | **String** | Wallet type tags, comma-separated if multiple. 1=Smart Money, 2=KOL, 3=Hot List. Empty string when no tag applies. | [optional] | +|**nativeTokenBalance** | **String** | Native token balance of this address on the queried chain. | [optional] | +|**nativeTokenBalanceUsd** | **String** | Native token balance of this address, denominated in USD. | [optional] | +|**realizedPnlUsd** | **String** | Cumulative realized PnL within the time frame, denominated in USD. Positive means profit, negative means loss. | [optional] | +|**realizedPnlPercent** | **String** | Realized PnL percentage within the time frame. No percent sign included. | [optional] | +|**dailyPnl** | [**List<GetLeaderboardResponseDataItemsInnerDailyPnlInner>**](GetLeaderboardResponseDataItemsInnerDailyPnlInner.md) | Daily realized PnL within the selected time frame, sorted by date descending. | [optional] | +|**winRatePercent** | **String** | Win rate within the time frame. No percent sign included. | [optional] | +|**txVolume** | **String** | Total transaction volume within the time frame, denominated in USD. Equals buyTxVolume + sellTxVolume. | [optional] | +|**buyTxVolume** | **String** | Total buy volume within the time frame, denominated in USD. | [optional] | +|**sellTxVolume** | **String** | Total sell volume within the time frame, denominated in USD. | [optional] | +|**avgBuyValueUsd** | **String** | Average buy value per transaction within the time frame, denominated in USD. Returns \"0\" when no buy transactions. | [optional] | +|**txs** | **String** | Total transaction count within the time frame. Equals buyTxCount + sellTxCount. | [optional] | +|**buyTxCount** | **String** | Buy transaction count within the time frame. | [optional] | +|**sellTxCount** | **String** | Sell transaction count within the time frame. | [optional] | +|**topPnlTokenList** | [**List<GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner>**](GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.md) | Top 3 tokens by realized PnL. Returns fewer items if fewer than 3 tokens were traded. | [optional] | +|**tokenCountByPnlPercent** | [**GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent**](GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.md) | | [optional] | +|**lastActiveTimestamp** | **String** | Timestamp of the address's last trade, Unix millisecond timestamp. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerDailyPnlInner.md b/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerDailyPnlInner.md new file mode 100644 index 0000000..8734d09 --- /dev/null +++ b/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerDailyPnlInner.md @@ -0,0 +1,14 @@ + + +# GetLeaderboardResponseDataItemsInnerDailyPnlInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**date** | **String** | Date in YYYY-MM-DD format. | [optional] | +|**pnlUsd** | **String** | Realized PnL for this day, denominated in USD. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.md b/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.md new file mode 100644 index 0000000..0d2b96c --- /dev/null +++ b/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.md @@ -0,0 +1,17 @@ + + +# GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + +Token count breakdown by realized PnL percentage range within the time frame. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**above500Percent** | **String** | Number of tokens with realized PnL >500%. | [optional] | +|**between0And500Percent** | **String** | Number of tokens with realized PnL in [0%, 500%]. | [optional] | +|**betweenNeg50And0Percent** | **String** | Number of tokens with realized PnL in [-50%, 0%]. | [optional] | +|**belowNeg50Percent** | **String** | Number of tokens with realized PnL < -50%. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.md b/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.md new file mode 100644 index 0000000..454d090 --- /dev/null +++ b/clients/web3-wallet/docs/GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.md @@ -0,0 +1,17 @@ + + +# GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tokenContractAddress** | **String** | Token contract address. EVM addresses are lowercase; Solana addresses are case-sensitive. | [optional] | +|**tokenSymbol** | **String** | Token symbol. | [optional] | +|**tokenLogoUrl** | **String** | Token logo URL. | [optional] | +|**tokenPnLUsd** | **String** | Realized PnL for this token, denominated in USD. Positive means profit, negative means loss. | [optional] | +|**tokenPnLPercent** | **String** | Realized PnL percentage for this token. No percent sign included. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetPortfolioSupportedChainsResponse.md b/clients/web3-wallet/docs/GetPortfolioSupportedChainsResponse.md new file mode 100644 index 0000000..76133af --- /dev/null +++ b/clients/web3-wallet/docs/GetPortfolioSupportedChainsResponse.md @@ -0,0 +1,17 @@ + + +# GetPortfolioSupportedChainsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**List<GetPortfolioSupportedChainsResponseDataInner>**](GetPortfolioSupportedChainsResponseDataInner.md) | List of supported blockchain networks. | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetPortfolioSupportedChainsResponseDataInner.md b/clients/web3-wallet/docs/GetPortfolioSupportedChainsResponseDataInner.md new file mode 100644 index 0000000..ad113f3 --- /dev/null +++ b/clients/web3-wallet/docs/GetPortfolioSupportedChainsResponseDataInner.md @@ -0,0 +1,19 @@ + + +# GetPortfolioSupportedChainsResponseDataInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | [optional] | +|**name** | **String** | Full chain name. | [optional] | +|**shortName** | **String** | Short chain name (uppercase). | [optional] | +|**logoUrl** | **String** | Chain logo image URL. | [optional] | +|**caseSensitive** | **Boolean** | Whether addresses on this chain are case-sensitive. true=case-sensitive (e.g. Solana), false=case-insensitive (e.g. EVM chains). | [optional] | +|**nativeTokenSymbol** | **String** | Symbol of the chain's native asset (uppercase). | [optional] | +|**nativeTokenDecimals** | **Integer** | Native token decimals. Display value = raw value / 10^nativeTokenDecimals. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRfqOrderStatusResponse.md b/clients/web3-wallet/docs/GetRfqOrderStatusResponse.md new file mode 100644 index 0000000..5219127 --- /dev/null +++ b/clients/web3-wallet/docs/GetRfqOrderStatusResponse.md @@ -0,0 +1,17 @@ + + +# GetRfqOrderStatusResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**GetRfqOrderStatusResponseData**](GetRfqOrderStatusResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRfqOrderStatusResponseData.md b/clients/web3-wallet/docs/GetRfqOrderStatusResponseData.md new file mode 100644 index 0000000..86aee27 --- /dev/null +++ b/clients/web3-wallet/docs/GetRfqOrderStatusResponseData.md @@ -0,0 +1,20 @@ + + +# GetRfqOrderStatusResponseData + +Order status details. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderId** | **String** | Platform order ID. | [optional] | +|**status** | **String** | Current order status. - **Terminal**: `FILLED` (settled on-chain), `FAILED` (settlement failed), `EXPIRED` (vendor could not settle before the order deadline), `CANCELLED` (cancelled by the user or vendor). - **Intermediate**: `PENDING_VENDOR` (forwarded to vendor, awaiting settlement), `PENDING_ONCHAIN` (vendor has broadcast the on-chain transaction, awaiting block confirmation). | [optional] | +|**txHash** | **String** | On-chain transaction hash. Present only when `status=FILLED`. | [optional] | +|**fromAmount** | **String** | Actual sell-token amount settled (smallest unit, integer string). Present when filled. | [optional] | +|**toAmount** | **String** | Actual buy-token amount received (smallest unit, integer string). Present when filled. | [optional] | +|**filledAt** | **Long** | Settlement timestamp (Unix epoch milliseconds). Present when filled. | [optional] | +|**createdAt** | **Long** | Order creation timestamp (Unix epoch milliseconds). | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponse.md b/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponse.md new file mode 100644 index 0000000..a8e1396 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponse.md @@ -0,0 +1,17 @@ + + +# GetRwaTokenIssuancePlatformsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | Status message. | [optional] | +|**data** | [**List<GetRwaTokenIssuancePlatformsResponseDataInner>**](GetRwaTokenIssuancePlatformsResponseDataInner.md) | List of RWA token issuance platforms. | [optional] | +|**timestamp** | **Long** | Server response time, Unix millisecond timestamp. | [optional] | +|**success** | **Boolean** | Whether the request was successful. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponseDataInner.md b/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponseDataInner.md new file mode 100644 index 0000000..165c79a --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponseDataInner.md @@ -0,0 +1,17 @@ + + +# GetRwaTokenIssuancePlatformsResponseDataInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**platformId** | **String** | Unique platform identifier. Examples: ondo=Ondo Finance, bstock=bStocks. | [optional] | +|**tickerCount** | **Integer** | Number of underlying assets corresponding to the RWA tokens. | [optional] | +|**chainDistribution** | [**List<GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner>**](GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.md) | RWA token distribution across chains. | [optional] | +|**website** | **String** | Platform official website. Null when unavailable. | [optional] | +|**logoUrl** | **String** | Platform logo URL. Null when unavailable. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.md b/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.md new file mode 100644 index 0000000..e43f313 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.md @@ -0,0 +1,14 @@ + + +# GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | [optional] | +|**tokenCount** | **Integer** | Number of RWA tokens on this chain (the same underlying asset deployed on different chains is counted separately). | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaTokenListResponse.md b/clients/web3-wallet/docs/GetRwaTokenListResponse.md new file mode 100644 index 0000000..a78f2df --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaTokenListResponse.md @@ -0,0 +1,17 @@ + + +# GetRwaTokenListResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | Status message. | [optional] | +|**data** | [**List<GetRwaTokenListResponseDataInner>**](GetRwaTokenListResponseDataInner.md) | List of RWA tokenized assets. | [optional] | +|**timestamp** | **Long** | Server response time, Unix millisecond timestamp. | [optional] | +|**success** | **Boolean** | Whether the request was successful. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaTokenListResponseDataInner.md b/clients/web3-wallet/docs/GetRwaTokenListResponseDataInner.md new file mode 100644 index 0000000..988a531 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaTokenListResponseDataInner.md @@ -0,0 +1,31 @@ + + +# GetRwaTokenListResponseDataInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | [optional] | +|**tokenContractAddress** | **String** | Token contract address. | [optional] | +|**platformId** | **String** | Unique platform identifier. | [optional] | +|**assetType** | **Integer** | Asset type. 1=Stock, 2=Pre-IPO, 3=ETF. | [optional] | +|**tokenName** | **String** | Token full name. | [optional] | +|**tokenSymbol** | **String** | Token symbol. | [optional] | +|**tokenLogoUrl** | **String** | Token logo URL. | [optional] | +|**decimals** | **String** | Token decimals. | [optional] | +|**underlyingTicker** | **String** | Underlying asset ticker symbol. | [optional] | +|**underlyingName** | **String** | Underlying company English name. | [optional] | +|**underlyingNameZh** | **String** | Underlying company Chinese name. Falls back to English if unavailable. | [optional] | +|**tokenToShareRatio** | **String** | Token-to-share exchange ratio. E.g. \"1.003701\" means 1 token ≈ 1.003701 underlying shares. | [optional] | +|**tags** | **List<String>** | Token tag array. Enum: alpha, communityRecognized, volumeSurge, volumePlunge. | [optional] | +|**statusInfo** | [**GetRwaTokenListResponseDataInnerStatusInfo**](GetRwaTokenListResponseDataInnerStatusInfo.md) | | [optional] | +|**tokenPrice** | **String** | On-chain token price (USD). | [optional] | +|**referencePrice** | **String** | Underlying reference price (USD). A per-share converted price derived from the on-chain token price, not an official quote from the traditional stock market. | [optional] | +|**volume24H** | **String** | 24-hour trading volume (USD). | [optional] | +|**marketCap** | **String** | Market capitalization (USD). | [optional] | +|**peRatioTTM** | **String** | Price-to-Earnings ratio (TTM). Null when unavailable. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaTokenListResponseDataInnerStatusInfo.md b/clients/web3-wallet/docs/GetRwaTokenListResponseDataInnerStatusInfo.md new file mode 100644 index 0000000..be606df --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaTokenListResponseDataInnerStatusInfo.md @@ -0,0 +1,19 @@ + + +# GetRwaTokenListResponseDataInnerStatusInfo + +Market status information. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**openState** | **Boolean** | Whether the underlying market is currently tradable. | [optional] | +|**marketStatus** | **String** | Current market status: premarket, regular (normal hours), postmarket, overnight, closed, or pause (trading halt/circuit breaker). | [optional] | +|**reasonCode** | **String** | Reason code when the market is not tradable (returned when openState=false). Market-level: MARKET_CLOSED (closed), MARKET_PAUSED (whole market paused), MARKET_MAINTENANCE (system maintenance). Asset-level: ASSET_PAUSED (single asset paused, incl. corporate actions — see reasonMsg), ASSET_LIMITED (single asset restricted but not paused, e.g. earnings window). Others: TRADING (normal), UNSUPPORTED (not supported). | [optional] | +|**reasonMsg** | **String** | Human-readable reason when the market is not tradable. Common case e.g. \"Weekend or Holiday\". For ASSET_PAUSED (corporate actions): cash_dividend, stock_dividend, stock_split, merger, acquisition, spinoff, maintenance, corporate action. For ASSET_LIMITED: earnings. | [optional] | +|**nextOpenTime** | **Long** | Expected next market open time, Unix millisecond timestamp. | [optional] | +|**nextCloseTime** | **Long** | Expected next market close time, Unix millisecond timestamp. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaTokenPriceResponse.md b/clients/web3-wallet/docs/GetRwaTokenPriceResponse.md new file mode 100644 index 0000000..bc95606 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaTokenPriceResponse.md @@ -0,0 +1,17 @@ + + +# GetRwaTokenPriceResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | Status message. | [optional] | +|**data** | [**List<GetRwaTokenPriceResponseDataInner>**](GetRwaTokenPriceResponseDataInner.md) | List of token price data. | [optional] | +|**timestamp** | **Long** | Server response time, Unix millisecond timestamp. | [optional] | +|**success** | **Boolean** | Whether the request was successful. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaTokenPriceResponseDataInner.md b/clients/web3-wallet/docs/GetRwaTokenPriceResponseDataInner.md new file mode 100644 index 0000000..c1b7a38 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaTokenPriceResponseDataInner.md @@ -0,0 +1,18 @@ + + +# GetRwaTokenPriceResponseDataInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | [optional] | +|**tokenContractAddress** | **String** | Token contract address. | [optional] | +|**platformId** | **String** | Unique platform identifier. | [optional] | +|**tokenPrice** | **String** | On-chain token price (USD). | [optional] | +|**referencePrice** | **String** | Underlying reference price (USD). A per-share converted price derived from the on-chain token price, not an official quote from the traditional stock market. | [optional] | +|**tokenPriceUpdatedAt** | **Long** | Token price last updated time, Unix millisecond timestamp. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponse.md b/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponse.md new file mode 100644 index 0000000..fa75a53 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponse.md @@ -0,0 +1,17 @@ + + +# GetRwaUnderlyingInfoResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | Status message. | [optional] | +|**data** | [**GetRwaUnderlyingInfoResponseData**](GetRwaUnderlyingInfoResponseData.md) | | [optional] | +|**timestamp** | **Long** | Server response time, Unix millisecond timestamp. | [optional] | +|**success** | **Boolean** | Whether the request was successful. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseData.md b/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseData.md new file mode 100644 index 0000000..d97cad1 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseData.md @@ -0,0 +1,22 @@ + + +# GetRwaUnderlyingInfoResponseData + +Underlying company information and protections. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | [optional] | +|**tokenContractAddress** | **String** | Token contract address. | [optional] | +|**platformId** | **String** | Unique platform identifier. | [optional] | +|**underlyingTicker** | **String** | Underlying asset ticker symbol. | [optional] | +|**underlyingFullName** | **String** | Underlying asset full name. | [optional] | +|**assetType** | **Integer** | Asset type. 1=Stock, 2=Pre-IPO, 3=ETF. | [optional] | +|**tokenToShareRatio** | **String** | Token-to-share exchange ratio. E.g. \"1.003701\" means 1 token ≈ 1.003701 underlying shares. | [optional] | +|**protections** | [**Map<String, GetRwaUnderlyingInfoResponseDataProtectionsValue>**](GetRwaUnderlyingInfoResponseDataProtectionsValue.md) | Investor protection mechanisms, keyed by mechanism type. Each entry includes whether it is supported and a related proof/report link. Known keys: dailyAttestationReport, monthlyAttestationReport, collateralReport. New keys may be added per platform. | [optional] | +|**companyInfo** | [**GetRwaUnderlyingInfoResponseDataCompanyInfo**](GetRwaUnderlyingInfoResponseDataCompanyInfo.md) | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseDataCompanyInfo.md b/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseDataCompanyInfo.md new file mode 100644 index 0000000..b89337f --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseDataCompanyInfo.md @@ -0,0 +1,20 @@ + + +# GetRwaUnderlyingInfoResponseDataCompanyInfo + +Underlying company information; for ETF type, returns fund company info (e.g. Invesco, iShares). + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ceo** | **String** | CEO name. | [optional] | +|**website** | **String** | Company official website. | [optional] | +|**industry** | **String** | Industry (English). | [optional] | +|**conceptsEn** | **List<String>** | Concept/sector tags (English). | [optional] | +|**conceptsCn** | **List<String>** | Concept/sector tags (Chinese). | [optional] | +|**descriptionEn** | **String** | Company description (English). | [optional] | +|**descriptionZh** | **String** | Company description (Chinese). | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseDataProtectionsValue.md b/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseDataProtectionsValue.md new file mode 100644 index 0000000..8d685b6 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaUnderlyingInfoResponseDataProtectionsValue.md @@ -0,0 +1,14 @@ + + +# GetRwaUnderlyingInfoResponseDataProtectionsValue + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**supported** | **Boolean** | Whether this protection is supported. | [optional] | +|**url** | **String** | URL to related report or proof. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponse.md b/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponse.md new file mode 100644 index 0000000..2ee0b9e --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponse.md @@ -0,0 +1,17 @@ + + +# GetRwaUnderlyingMarketDataResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | Status message. | [optional] | +|**data** | [**GetRwaUnderlyingMarketDataResponseData**](GetRwaUnderlyingMarketDataResponseData.md) | | [optional] | +|**timestamp** | **Long** | Server response time, Unix millisecond timestamp. | [optional] | +|**success** | **Boolean** | Whether the request was successful. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseData.md b/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseData.md new file mode 100644 index 0000000..cd5141f --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseData.md @@ -0,0 +1,19 @@ + + +# GetRwaUnderlyingMarketDataResponseData + +Underlying market data for the RWA token. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | [optional] | +|**tokenContractAddress** | **String** | Token contract address. | [optional] | +|**platformId** | **String** | Unique platform identifier. | [optional] | +|**assetType** | **Integer** | Asset type. 1=Stock, 2=Pre-IPO, 3=ETF. | [optional] | +|**statusInfo** | [**GetRwaUnderlyingMarketDataResponseDataStatusInfo**](GetRwaUnderlyingMarketDataResponseDataStatusInfo.md) | | [optional] | +|**marketData** | [**GetRwaUnderlyingMarketDataResponseDataMarketData**](GetRwaUnderlyingMarketDataResponseDataMarketData.md) | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseDataMarketData.md b/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseDataMarketData.md new file mode 100644 index 0000000..8d3d4e5 --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseDataMarketData.md @@ -0,0 +1,26 @@ + + +# GetRwaUnderlyingMarketDataResponseDataMarketData + +Underlying asset market data. Fields vary by asset type. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**referencePrice** | **String** | Underlying reference price (USD). A per-share converted price derived from the on-chain token price, not an official quote from the traditional stock market. | [optional] | +|**high52W** | **String** | 52-week high price. Applicable to Stock and ETF only. | [optional] | +|**low52W** | **String** | 52-week low price. Applicable to Stock and ETF only. | [optional] | +|**volumeShares24H** | **String** | 24-hour trading volume in shares. | [optional] | +|**avgDailyVolume1Y** | **String** | 1-year average daily volume. Applicable to Stock and ETF only. | [optional] | +|**totalShares** | **String** | Total outstanding shares (Stock) or total units (ETF). Applicable to Stock and ETF only. | [optional] | +|**marketCap** | **String** | Market capitalization (USD) for Stock/ETF, or implied total valuation for Pre-IPO. | [optional] | +|**turnoverRate** | **String** | Turnover rate. \"23.81\" means 23.81%. Applicable to Stock and ETF only. | [optional] | +|**amplitude** | **String** | Price amplitude (intraday). \"3.05\" means 3.05%, i.e. (intraday high − low) / previous close. Applicable to Stock and ETF only. | [optional] | +|**peRatioTTM** | **String** | Price-to-Earnings ratio (TTM = Trailing Twelve Months, based on earnings of the most recent 12 months). Applicable to Stock only. | [optional] | +|**pbRatio** | **String** | Price-to-Book ratio. Applicable to Stock only. | [optional] | +|**dividendYield** | **String** | Dividend yield. \"0.85\" means 0.85%. Applicable to Stock and ETF only. | [optional] | +|**latestDividend** | **String** | Latest dividend amount (USD). Applicable to Stock and ETF only. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseDataStatusInfo.md b/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseDataStatusInfo.md new file mode 100644 index 0000000..be597ff --- /dev/null +++ b/clients/web3-wallet/docs/GetRwaUnderlyingMarketDataResponseDataStatusInfo.md @@ -0,0 +1,19 @@ + + +# GetRwaUnderlyingMarketDataResponseDataStatusInfo + +Market status information. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**openState** | **Boolean** | Whether the underlying market is currently tradable. | [optional] | +|**marketStatus** | **String** | Current market status: premarket, regular (normal hours), postmarket, overnight, closed, or pause (trading halt/circuit breaker). | [optional] | +|**reasonCode** | **String** | Reason code when the market is not tradable (returned when openState=false). Market-level: MARKET_CLOSED (closed), MARKET_PAUSED (whole market paused), MARKET_MAINTENANCE (system maintenance). Asset-level: ASSET_PAUSED (single asset paused, incl. corporate actions — see reasonMsg), ASSET_LIMITED (single asset restricted but not paused, e.g. earnings window). Others: TRADING (normal), UNSUPPORTED (not supported). | [optional] | +|**reasonMsg** | **String** | Human-readable reason when the market is not tradable. Common case e.g. \"Weekend or Holiday\". For ASSET_PAUSED (corporate actions): cash_dividend, stock_dividend, stock_split, merger, acquisition, spinoff, maintenance, corporate action. For ASSET_LIMITED: earnings. | [optional] | +|**nextOpenTime** | **Long** | Expected next market open time, Unix millisecond timestamp. | [optional] | +|**nextCloseTime** | **Long** | Expected next market close time, Unix millisecond timestamp. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetTokenDevInfoResponse.md b/clients/web3-wallet/docs/GetTokenDevInfoResponse.md new file mode 100644 index 0000000..1294e1d --- /dev/null +++ b/clients/web3-wallet/docs/GetTokenDevInfoResponse.md @@ -0,0 +1,17 @@ + + +# GetTokenDevInfoResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**GetTokenDevInfoResponseData**](GetTokenDevInfoResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetTokenDevInfoResponseData.md b/clients/web3-wallet/docs/GetTokenDevInfoResponseData.md new file mode 100644 index 0000000..49d5e7f --- /dev/null +++ b/clients/web3-wallet/docs/GetTokenDevInfoResponseData.md @@ -0,0 +1,15 @@ + + +# GetTokenDevInfoResponseData + +Token developer information. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**devLaunchedInfo** | [**GetTokenDevInfoResponseDataDevLaunchedInfo**](GetTokenDevInfoResponseDataDevLaunchedInfo.md) | | [optional] | +|**devHoldingInfo** | [**GetTokenDevInfoResponseDataDevHoldingInfo**](GetTokenDevInfoResponseDataDevHoldingInfo.md) | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetTokenDevInfoResponseDataDevHoldingInfo.md b/clients/web3-wallet/docs/GetTokenDevInfoResponseDataDevHoldingInfo.md new file mode 100644 index 0000000..6f09854 --- /dev/null +++ b/clients/web3-wallet/docs/GetTokenDevInfoResponseDataDevHoldingInfo.md @@ -0,0 +1,21 @@ + + +# GetTokenDevInfoResponseDataDevHoldingInfo + +Developer's current holding information for this token. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**devHoldingPercent** | **String** | Developer's current holding percentage for this token. No percent sign included. Empty string means fully sold. | [optional] | +|**devAddress** | **String** | Developer (creator) wallet address. | [optional] | +|**fundingSource** | **String** | Funding source address — the originator of the first inbound native-token transfer. Empty string when no inbound transfer is recorded. | [optional] | +|**fundingSourceLabel** | **String** | Funding source name (e.g. exchange name). Empty string when unknown. | [optional] | +|**fundingSourceHash** | **String** | Transaction hash of the first inbound native-token transfer. | [optional] | +|**fundingSourceTime** | **String** | Timestamp of the first inbound native-token transfer, Unix millisecond timestamp. | [optional] | +|**fundingSourceAmount** | **String** | Amount of the first inbound native-token transfer (native token units). | [optional] | +|**devBalance** | **String** | Developer wallet's native token balance (e.g. SOL). Empty string when unavailable. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetTokenDevInfoResponseDataDevLaunchedInfo.md b/clients/web3-wallet/docs/GetTokenDevInfoResponseDataDevLaunchedInfo.md new file mode 100644 index 0000000..5db64bf --- /dev/null +++ b/clients/web3-wallet/docs/GetTokenDevInfoResponseDataDevLaunchedInfo.md @@ -0,0 +1,15 @@ + + +# GetTokenDevInfoResponseDataDevLaunchedInfo + +Historical token launch summary for this developer. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**totalToken** | **String** | Total number of tokens launched by this developer via launch platforms. | [optional] | +|**migratedCount** | **String** | Number of tokens successfully migrated to external DEX by this developer. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetTrackedTradesResponse.md b/clients/web3-wallet/docs/GetTrackedTradesResponse.md new file mode 100644 index 0000000..dd5daa2 --- /dev/null +++ b/clients/web3-wallet/docs/GetTrackedTradesResponse.md @@ -0,0 +1,17 @@ + + +# GetTrackedTradesResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**GetTrackedTradesResponseData**](GetTrackedTradesResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetTrackedTradesResponseData.md b/clients/web3-wallet/docs/GetTrackedTradesResponseData.md new file mode 100644 index 0000000..b7c11ad --- /dev/null +++ b/clients/web3-wallet/docs/GetTrackedTradesResponseData.md @@ -0,0 +1,14 @@ + + +# GetTrackedTradesResponseData + +Tracker trade results. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**trades** | [**List<GetTrackedTradesResponseDataTradesInner>**](GetTrackedTradesResponseDataTradesInner.md) | List of tracked address trades. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetTrackedTradesResponseDataTradesInner.md b/clients/web3-wallet/docs/GetTrackedTradesResponseDataTradesInner.md new file mode 100644 index 0000000..9152d47 --- /dev/null +++ b/clients/web3-wallet/docs/GetTrackedTradesResponseDataTradesInner.md @@ -0,0 +1,21 @@ + + +# GetTrackedTradesResponseDataTradesInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**txHash** | **String** | On-chain transaction hash. | [optional] | +|**walletAddress** | **String** | Wallet address that initiated this trade. EVM addresses are lowercase; Solana addresses are case-sensitive. | [optional] | +|**tokenSymbol** | **String** | Symbol of the traded token. | [optional] | +|**tokenContractAddress** | **String** | Contract address of the traded token. EVM addresses are lowercase; Solana addresses are case-sensitive. | [optional] | +|**binanceChainId** | **String** | Unique chain identifier of the traded token. | [optional] | +|**tokenPrice** | **String** | Token price at the time of this trade, denominated in USD. | [optional] | +|**marketCap** | **String** | Token market cap at the time of this trade, denominated in USD. | [optional] | +|**tradeType** | **String** | Trade type. 1=Buy, 2=Sell, 3=Add position, 4=Reduce position, 5=Open position, 6=Close position, 7=Transfer in, 8=Transfer out. | [optional] | +|**tradeTime** | **String** | On-chain time of this trade, Unix millisecond timestamp. | [optional] | + + + diff --git a/clients/web3-wallet/docs/GetTransactionSupportedChainsResponseDataInner.md b/clients/web3-wallet/docs/GetTransactionSupportedChainsResponseDataInner.md index 4ae6212..b659c20 100644 --- a/clients/web3-wallet/docs/GetTransactionSupportedChainsResponseDataInner.md +++ b/clients/web3-wallet/docs/GetTransactionSupportedChainsResponseDataInner.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**binanceChainId** | **String** | Unique chain identifier (follows EIP-155 chainId for EVM chains; e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | [optional] | +|**binanceChainId** | **String** | Unique chain identifier (follows EIP-155 chainId for EVM chains; e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana, \"CT_195\"=Tron). | [optional] | |**name** | **String** | Full chain name. | [optional] | |**shortName** | **String** | Short chain name / ticker. | [optional] | |**logoUrl** | **String** | Chain logo image URL. | [optional] | diff --git a/clients/web3-wallet/docs/OrderType.md b/clients/web3-wallet/docs/OrderType.md new file mode 100644 index 0000000..709305c --- /dev/null +++ b/clients/web3-wallet/docs/OrderType.md @@ -0,0 +1,13 @@ + + +# OrderType + +## Enum + + +* `TYPE_1` (value: `"1"`) + +* `TYPE_2` (value: `"2"`) + + + diff --git a/clients/web3-wallet/docs/PlatformId.md b/clients/web3-wallet/docs/PlatformId.md new file mode 100644 index 0000000..8f17d71 --- /dev/null +++ b/clients/web3-wallet/docs/PlatformId.md @@ -0,0 +1,13 @@ + + +# PlatformId + +## Enum + + +* `ondo` (value: `"ondo"`) + +* `bstock` (value: `"bstock"`) + + + diff --git a/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponse.md b/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponse.md new file mode 100644 index 0000000..369b5d9 --- /dev/null +++ b/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponse.md @@ -0,0 +1,17 @@ + + +# QuoteAndBuildSwapTransactionResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**QuoteAndBuildSwapTransactionResponseData**](QuoteAndBuildSwapTransactionResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponseData.md b/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponseData.md new file mode 100644 index 0000000..c404403 --- /dev/null +++ b/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponseData.md @@ -0,0 +1,16 @@ + + +# QuoteAndBuildSwapTransactionResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**routerResult** | [**BuildSwapTransactionResponseDataRouterResult**](BuildSwapTransactionResponseDataRouterResult.md) | | [optional] | +|**tx** | [**BuildSwapTransactionResponseDataTx**](BuildSwapTransactionResponseDataTx.md) | | [optional] | +|**executionMode** | **String** | Always `SWAP` for this endpoint — returns executable calldata / swapTransaction to sign and broadcast on-chain (no `RFQ` mode). | [optional] | +|**rfq** | [**QuoteAndBuildSwapTransactionResponseDataRfq**](QuoteAndBuildSwapTransactionResponseDataRfq.md) | | [optional] | + + + diff --git a/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponseDataRfq.md b/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponseDataRfq.md new file mode 100644 index 0000000..05a4247 --- /dev/null +++ b/clients/web3-wallet/docs/QuoteAndBuildSwapTransactionResponseDataRfq.md @@ -0,0 +1,18 @@ + + +# QuoteAndBuildSwapTransactionResponseDataRfq + +Always `null` for this endpoint (only `SWAP` mode is returned). + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**vendor** | **String** | RFQ vendor that will settle this order on-chain. Pass this as the `vendor` field in `POST /order/submit`. | [optional] | +|**txType** | **String** | Transaction type for this RFQ order. Currently always `EIP712` (all three RFQ vendors use EIP-712 typed-data signing); reserved for future signing schemes. | [optional] | +|**typedDataToSign** | **String** | EIP-712 typed data payload for `eth_signTypedData_v4`, serialized as a hex string (or JSON-encoded string). Sign with the wallet that matches `userWalletAddress` from `/quote`. Pass the resulting signature as `userSignature` in `POST /order/submit`. | [optional] | +|**signingScheme** | **String** | Signing scheme required by this vendor. Pass this as `signingScheme` in `POST /order/submit`. | [optional] | +|**signatureData** | **List<String>** | Approve transaction data, present only when `approveTransaction=true` was passed and the from-token is an EVM ERC-20. Each element is a JSON string containing `approveContract` (the spender address, resolved per vendor: InchFusion→router, PcsXRfq→Permit2, CowSwap→VaultRelayer) and `approveTxCalldata` (the ERC-20 `approve()` calldata). Empty list otherwise. | [optional] | + + + diff --git a/clients/web3-wallet/docs/RwaDataApi.md b/clients/web3-wallet/docs/RwaDataApi.md new file mode 100644 index 0000000..d6e834a --- /dev/null +++ b/clients/web3-wallet/docs/RwaDataApi.md @@ -0,0 +1,463 @@ +# RwaDataApi + +All URIs are relative to *https://web3.binance.com/build* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getRwaTokenIssuancePlatforms**](RwaDataApi.md#getRwaTokenIssuancePlatforms) | **GET** /api/v1/dex/market/rwa/platforms | Get RWA Token Issuance Platforms | +| [**getRwaTokenList**](RwaDataApi.md#getRwaTokenList) | **GET** /api/v1/dex/market/rwa/tokens | Get RWA Token List | +| [**getRwaTokenPrice**](RwaDataApi.md#getRwaTokenPrice) | **GET** /api/v1/dex/market/rwa/price | Get RWA Token Price | +| [**getRwaUnderlyingInfo**](RwaDataApi.md#getRwaUnderlyingInfo) | **GET** /api/v1/dex/market/rwa/underlying-profile | Get RWA Underlying Info | +| [**getRwaUnderlyingMarketData**](RwaDataApi.md#getRwaUnderlyingMarketData) | **GET** /api/v1/dex/market/rwa/underlying-market | Get RWA Underlying Market Data | +| [**searchRwaToken**](RwaDataApi.md#searchRwaToken) | **GET** /api/v1/dex/market/rwa/search | Search RWA Token | + + + +# **getRwaTokenIssuancePlatforms** +> GetRwaTokenIssuancePlatformsResponse getRwaTokenIssuancePlatforms().recvWindow(recvWindow).nonce(nonce).platformId(platformId).execute(); + +Get RWA Token Issuance Platforms + +Return the list of supported RWA token issuance platforms and their basic info. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + RwaDataApi apiInstance = new RwaDataApi(defaultClient); + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds. Default 5000, max 60000. + String nonce = "unique-nonce-string"; // String | Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. + PlatformId platformId = PlatformId.fromValue("ondo"); // PlatformId | Platform identifier (ondo=Ondo Finance, bstock=bStocks). Optional. If not specified, returns all platforms; when specified, returns only that platform. + try { + GetRwaTokenIssuancePlatformsResponse result = apiInstance.getRwaTokenIssuancePlatforms() + .recvWindow(recvWindow) + .nonce(nonce) + .platformId(platformId) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwaDataApi#getRwaTokenIssuancePlatforms"); + 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**| Allowed time deviation in milliseconds. Default 5000, max 60000. | [optional] | +| **nonce** | **String**| Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. | [optional] | +| **platformId** | [**PlatformId**](.md)| Platform identifier (ondo=Ondo Finance, bstock=bStocks). Optional. If not specified, returns all platforms; when specified, returns only that platform. | [optional] [enum: ondo, bstock] | + +### Return type + +[**GetRwaTokenIssuancePlatformsResponse**](GetRwaTokenIssuancePlatformsResponse.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** | RWA token issuance platform list returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getRwaTokenList** +> GetRwaTokenListResponse getRwaTokenList().recvWindow(recvWindow).nonce(nonce).binanceChainId(binanceChainId).platformId(platformId).tabId(tabId).execute(); + +Get RWA Token List + +Get the list of RWA tokens with underlying asset info. Supports filtering by platform and sector tab. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + RwaDataApi apiInstance = new RwaDataApi(defaultClient); + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds. Default 5000, max 60000. + String nonce = "unique-nonce-string"; // String | Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. + String binanceChainId = "56"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). Optional. If not specified, returns data from all chains. + PlatformId platformId = PlatformId.fromValue("ondo"); // PlatformId | Platform filter (ondo=Ondo Finance, bstock=bStocks). Optional. If not specified, returns all platforms. + Integer tabId = 9; // Integer | Sector tab filter. Optional. If not specified, returns all sectors. Enum: 1=Serenity Call, 2=SpaceX (SpaceX-related and commercial spaceflight concept stocks), 3=Upcoming Earnings, 4=AI Chips, 5=Storage, 6=Energy, 7=Precious Metals, 8=China ADR (Chinese companies listed in the US), 9=Magnificent 7 (the seven largest US tech giants: Apple, Microsoft, Alphabet, Amazon, Nvidia, Meta, Tesla), 10=Crypto, 11=ETF, 12=Tech Leaders, 13=Buffett Portfolio. + try { + GetRwaTokenListResponse result = apiInstance.getRwaTokenList() + .recvWindow(recvWindow) + .nonce(nonce) + .binanceChainId(binanceChainId) + .platformId(platformId) + .tabId(tabId) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwaDataApi#getRwaTokenList"); + 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**| Allowed time deviation in milliseconds. Default 5000, max 60000. | [optional] | +| **nonce** | **String**| Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. | [optional] | +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). Optional. If not specified, returns data from all chains. | [optional] | +| **platformId** | [**PlatformId**](.md)| Platform filter (ondo=Ondo Finance, bstock=bStocks). Optional. If not specified, returns all platforms. | [optional] [enum: ondo, bstock] | +| **tabId** | **Integer**| Sector tab filter. Optional. If not specified, returns all sectors. Enum: 1=Serenity Call, 2=SpaceX (SpaceX-related and commercial spaceflight concept stocks), 3=Upcoming Earnings, 4=AI Chips, 5=Storage, 6=Energy, 7=Precious Metals, 8=China ADR (Chinese companies listed in the US), 9=Magnificent 7 (the seven largest US tech giants: Apple, Microsoft, Alphabet, Amazon, Nvidia, Meta, Tesla), 10=Crypto, 11=ETF, 12=Tech Leaders, 13=Buffett Portfolio. | [optional] | + +### Return type + +[**GetRwaTokenListResponse**](GetRwaTokenListResponse.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** | RWA token list returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getRwaTokenPrice** +> GetRwaTokenPriceResponse getRwaTokenPrice(binanceChainId, tokenContractAddresses).recvWindow(recvWindow).nonce(nonce).execute(); + +Get RWA Token Price + +Batch query RWA token prices, including on-chain price and underlying reference price. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + RwaDataApi apiInstance = new RwaDataApi(defaultClient); + String binanceChainId = "56"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String tokenContractAddresses = "0x8755c5c39b1aa9053a83ac731242a2cf4d04b0fe"; // String | Comma-separated token contract addresses. Maximum 100 per request. + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds. Default 5000, max 60000. + String nonce = "unique-nonce-string"; // String | Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. + try { + GetRwaTokenPriceResponse result = apiInstance.getRwaTokenPrice(binanceChainId, tokenContractAddresses) + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwaDataApi#getRwaTokenPrice"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **tokenContractAddresses** | **String**| Comma-separated token contract addresses. Maximum 100 per request. | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds. Default 5000, max 60000. | [optional] | +| **nonce** | **String**| Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. | [optional] | + +### Return type + +[**GetRwaTokenPriceResponse**](GetRwaTokenPriceResponse.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** | Quote data returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getRwaUnderlyingInfo** +> GetRwaUnderlyingInfoResponse getRwaUnderlyingInfo(binanceChainId, tokenContractAddress).recvWindow(recvWindow).nonce(nonce).execute(); + +Get RWA Underlying Info + +Get the underlying company information for an RWA token. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + RwaDataApi apiInstance = new RwaDataApi(defaultClient); + String binanceChainId = "56"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String tokenContractAddress = "0x8755c5c39b1aa9053a83ac731242a2cf4d04b0fe"; // String | Token contract address. + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds. Default 5000, max 60000. + String nonce = "unique-nonce-string"; // String | Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. + try { + GetRwaUnderlyingInfoResponse result = apiInstance.getRwaUnderlyingInfo(binanceChainId, tokenContractAddress) + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwaDataApi#getRwaUnderlyingInfo"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **tokenContractAddress** | **String**| Token contract address. | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds. Default 5000, max 60000. | [optional] | +| **nonce** | **String**| Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. | [optional] | + +### Return type + +[**GetRwaUnderlyingInfoResponse**](GetRwaUnderlyingInfoResponse.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** | Token detail returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **getRwaUnderlyingMarketData** +> GetRwaUnderlyingMarketDataResponse getRwaUnderlyingMarketData(binanceChainId, tokenContractAddress).recvWindow(recvWindow).nonce(nonce).execute(); + +Get RWA Underlying Market Data + +Get market data for the underlying asset of an RWA token. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + RwaDataApi apiInstance = new RwaDataApi(defaultClient); + String binanceChainId = "56"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String tokenContractAddress = "0x8755c5c39b1aa9053a83ac731242a2cf4d04b0fe"; // String | Token contract address. + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds. Default 5000, max 60000. + String nonce = "unique-nonce-string"; // String | Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. + try { + GetRwaUnderlyingMarketDataResponse result = apiInstance.getRwaUnderlyingMarketData(binanceChainId, tokenContractAddress) + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwaDataApi#getRwaUnderlyingMarketData"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **tokenContractAddress** | **String**| Token contract address. | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds. Default 5000, max 60000. | [optional] | +| **nonce** | **String**| Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. | [optional] | + +### Return type + +[**GetRwaUnderlyingMarketDataResponse**](GetRwaUnderlyingMarketDataResponse.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** | Underlying market data returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **searchRwaToken** +> SearchRwaTokenResponse searchRwaToken(keyword).recvWindow(recvWindow).nonce(nonce).platformId(platformId).execute(); + +Search RWA Token + +Search RWA tokens by keyword or contract address. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + RwaDataApi apiInstance = new RwaDataApi(defaultClient); + String keyword = "NVDA"; // String | Search keyword (ticker, company name, or contract address). Case-insensitive. + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds. Default 5000, max 60000. + String nonce = "unique-nonce-string"; // String | Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. + PlatformId platformId = PlatformId.fromValue("ondo"); // PlatformId | Platform filter (ondo=Ondo Finance, bstock=bStocks). Optional. If not specified, returns results from all platforms. + try { + SearchRwaTokenResponse result = apiInstance.searchRwaToken(keyword) + .recvWindow(recvWindow) + .nonce(nonce) + .platformId(platformId) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RwaDataApi#searchRwaToken"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **keyword** | **String**| Search keyword (ticker, company name, or contract address). Case-insensitive. | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds. Default 5000, max 60000. | [optional] | +| **nonce** | **String**| Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN when omitted. | [optional] | +| **platformId** | [**PlatformId**](.md)| Platform filter (ondo=Ondo Finance, bstock=bStocks). Optional. If not specified, returns results from all platforms. | [optional] [enum: ondo, bstock] | + +### Return type + +[**SearchRwaTokenResponse**](SearchRwaTokenResponse.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** | Ticker lookup results returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + diff --git a/clients/web3-wallet/docs/SearchRwaTokenResponse.md b/clients/web3-wallet/docs/SearchRwaTokenResponse.md new file mode 100644 index 0000000..4653008 --- /dev/null +++ b/clients/web3-wallet/docs/SearchRwaTokenResponse.md @@ -0,0 +1,17 @@ + + +# SearchRwaTokenResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | Business status code. 0 indicates success. | [optional] | +|**msg** | **String** | Status message. | [optional] | +|**data** | [**List<SearchRwaTokenResponseDataInner>**](SearchRwaTokenResponseDataInner.md) | List of matched tickers and their tokenized assets. | [optional] | +|**timestamp** | **Long** | Server response time, Unix millisecond timestamp. | [optional] | +|**success** | **Boolean** | Whether the request was successful. | [optional] | + + + diff --git a/clients/web3-wallet/docs/SearchRwaTokenResponseDataInner.md b/clients/web3-wallet/docs/SearchRwaTokenResponseDataInner.md new file mode 100644 index 0000000..b7f5780 --- /dev/null +++ b/clients/web3-wallet/docs/SearchRwaTokenResponseDataInner.md @@ -0,0 +1,15 @@ + + +# SearchRwaTokenResponseDataInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ticker** | **String** | Matched stock ticker symbol. | [optional] | +|**companyName** | **String** | Company English name. | [optional] | +|**assets** | [**List<SearchRwaTokenResponseDataInnerAssetsInner>**](SearchRwaTokenResponseDataInnerAssetsInner.md) | Tokenized assets for this ticker across platforms and chains. | [optional] | + + + diff --git a/clients/web3-wallet/docs/SearchRwaTokenResponseDataInnerAssetsInner.md b/clients/web3-wallet/docs/SearchRwaTokenResponseDataInnerAssetsInner.md new file mode 100644 index 0000000..7145c52 --- /dev/null +++ b/clients/web3-wallet/docs/SearchRwaTokenResponseDataInnerAssetsInner.md @@ -0,0 +1,17 @@ + + +# SearchRwaTokenResponseDataInnerAssetsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**platformId** | **String** | Unique platform identifier. | [optional] | +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | [optional] | +|**tokenContractAddress** | **String** | Token contract address. | [optional] | +|**tokenSymbol** | **String** | Token symbol. | [optional] | +|**assetType** | **Integer** | Asset type. 1=Stock, 2=Pre-IPO, 3=ETF. | [optional] | + + + diff --git a/clients/web3-wallet/docs/SimulateTransactionsRequest.md b/clients/web3-wallet/docs/SimulateTransactionsRequest.md index 396e0ce..d958516 100644 --- a/clients/web3-wallet/docs/SimulateTransactionsRequest.md +++ b/clients/web3-wallet/docs/SimulateTransactionsRequest.md @@ -7,9 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | -|**evmTx** | [**SimulateTransactionsRequestEvmTx**](SimulateTransactionsRequestEvmTx.md) | | [optional] | -|**solTx** | [**SimulateTransactionsRequestSolTx**](SimulateTransactionsRequestSolTx.md) | | [optional] | +|**binanceChainId** | **String** | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana, \"CT_195\"=Tron). Provide `evmTx` for EVM chains, `solTx` for Solana, or `tronTx` for Tron — exactly one must be present. Note: `evmTx`, `solTx`, and `tronTx` are marked required in this schema for rendering purposes only; in practice supply exactly one matching `binanceChainId`. | | +|**evmTx** | [**SimulateTransactionsRequestEvmTx**](SimulateTransactionsRequestEvmTx.md) | | | +|**solTx** | [**SimulateTransactionsRequestSolTx**](SimulateTransactionsRequestSolTx.md) | | | +|**tronTx** | [**SimulateTransactionsRequestTronTx**](SimulateTransactionsRequestTronTx.md) | | | diff --git a/clients/web3-wallet/docs/SimulateTransactionsRequestEvmTx.md b/clients/web3-wallet/docs/SimulateTransactionsRequestEvmTx.md index 087f062..b80ee0e 100644 --- a/clients/web3-wallet/docs/SimulateTransactionsRequestEvmTx.md +++ b/clients/web3-wallet/docs/SimulateTransactionsRequestEvmTx.md @@ -11,7 +11,7 @@ EVM transaction payload. Required when `binanceChainId` belongs to an EVM chain. |**from** | **String** | Sender address. | | |**to** | **String** | Destination address (contract or EOA). | | |**value** | **String** | Native token amount in wei (integer string). | | -|**data** | **String** | ABI-encoded calldata (hex). Optional. | [optional] | +|**data** | **String** | ABI-encoded calldata (hex). Optional. | | diff --git a/clients/web3-wallet/docs/SimulateTransactionsRequestSolTx.md b/clients/web3-wallet/docs/SimulateTransactionsRequestSolTx.md index 45e6641..4e4ac60 100644 --- a/clients/web3-wallet/docs/SimulateTransactionsRequestSolTx.md +++ b/clients/web3-wallet/docs/SimulateTransactionsRequestSolTx.md @@ -9,7 +9,7 @@ Solana transaction payload. Required when `binanceChainId=CT_501`. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**base64Tx** | **String** | Base64-encoded unsigned Solana transaction. | | -|**address** | **String** | Owner / fee-payer Solana address used to attribute balance changes. | | +|**address** | **String** | Owner / fee-payer Solana address used to attribute balance changes. | [optional] | diff --git a/clients/web3-wallet/docs/SimulateTransactionsRequestTronTx.md b/clients/web3-wallet/docs/SimulateTransactionsRequestTronTx.md new file mode 100644 index 0000000..6760328 --- /dev/null +++ b/clients/web3-wallet/docs/SimulateTransactionsRequestTronTx.md @@ -0,0 +1,26 @@ + + +# SimulateTransactionsRequestTronTx + +Tron transaction payload. Required when `binanceChainId=CT_195`. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**from** | **String** | Sender address (base58check), also used to attribute balance changes. | | +|**txType** | [**TxTypeEnum**](#TxTypeEnum) | Tron contract type. `TRIGGER_SMART_CONTRACT` requires `triggerSmartContractParams`; `TRANSFER_CONTRACT` requires `transferContractParams`. | | +|**triggerSmartContractParams** | [**GetGasLimitRequestTronTxTriggerSmartContractParams**](GetGasLimitRequestTronTxTriggerSmartContractParams.md) | | [optional] | +|**transferContractParams** | [**GetGasLimitRequestTronTxTransferContractParams**](GetGasLimitRequestTronTxTransferContractParams.md) | | [optional] | + + + +## Enum: TxTypeEnum + +| Name | Value | +|---- | -----| +| TRIGGER_SMART_CONTRACT | "TRIGGER_SMART_CONTRACT" | +| TRANSFER_CONTRACT | "TRANSFER_CONTRACT" | + + + diff --git a/clients/web3-wallet/docs/SortBy.md b/clients/web3-wallet/docs/SortBy.md new file mode 100644 index 0000000..23f7666 --- /dev/null +++ b/clients/web3-wallet/docs/SortBy.md @@ -0,0 +1,19 @@ + + +# SortBy + +## Enum + + +* `SORT_BY_1` (value: `"1"`) + +* `SORT_BY_2` (value: `"2"`) + +* `SORT_BY_3` (value: `"3"`) + +* `SORT_BY_4` (value: `"4"`) + +* `SORT_BY_5` (value: `"5"`) + + + diff --git a/clients/web3-wallet/docs/SubmitRfqOrderRequest.md b/clients/web3-wallet/docs/SubmitRfqOrderRequest.md new file mode 100644 index 0000000..f452a7d --- /dev/null +++ b/clients/web3-wallet/docs/SubmitRfqOrderRequest.md @@ -0,0 +1,27 @@ + + +# SubmitRfqOrderRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**requestId** | **String** | Idempotency key (UUID v4). Within 30 minutes, re-submitting with the same `requestId` returns the original result without re-calling the vendor. Generate a new UUID for each new order; reuse the same UUID when retrying the same attempt. | | +|**userSignature** | **String** | EIP-712 signature of `rfq.typedDataToSign` from the `/swap` response. Must be a hex string with `0x` prefix (132 chars = `0x` + 65 bytes). The signing wallet must match `userWalletAddress` used in `/quote`. The backend automatically corrects Ethereum `v` values `00`/`01` to `1b`/`1c`. | | +|**vendor** | [**VendorEnum**](#VendorEnum) | RFQ vendor name — must match `rfq.vendor` from the `/swap` response. The backend validates this against `quoteId` to prevent misrouted submissions. | | +|**quoteId** | **String** | `rfq.orderId` from the `/swap` response. The backend uses this to look up the vendor and chain context required to forward the signed order. | | +|**signingScheme** | **String** | Signing scheme from `rfq.signingScheme` in the `/swap` response. Optional — when omitted the backend infers the default per vendor. | [optional] | + + + +## Enum: VendorEnum + +| Name | Value | +|---- | -----| +| InchFusion | "InchFusion" | +| CowSwap | "CowSwap" | +| PcsXRfq | "PcsXRfq" | + + + diff --git a/clients/web3-wallet/docs/SubmitRfqOrderResponse.md b/clients/web3-wallet/docs/SubmitRfqOrderResponse.md new file mode 100644 index 0000000..14957a5 --- /dev/null +++ b/clients/web3-wallet/docs/SubmitRfqOrderResponse.md @@ -0,0 +1,17 @@ + + +# SubmitRfqOrderResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**msg** | **String** | | [optional] | +|**data** | [**SubmitRfqOrderResponseData**](SubmitRfqOrderResponseData.md) | | [optional] | +|**timestamp** | **Long** | | [optional] | +|**success** | **Boolean** | | [optional] | + + + diff --git a/clients/web3-wallet/docs/SubmitRfqOrderResponseData.md b/clients/web3-wallet/docs/SubmitRfqOrderResponseData.md new file mode 100644 index 0000000..f69db47 --- /dev/null +++ b/clients/web3-wallet/docs/SubmitRfqOrderResponseData.md @@ -0,0 +1,16 @@ + + +# SubmitRfqOrderResponseData + +Submitted order details. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderId** | **String** | Platform-generated order ID. Use this to poll `GET /order/{orderId}` for the final settlement status. | [optional] | +|**status** | **String** | Initial order status after submission. Typical value: `PENDING_VENDOR` (forwarded to vendor, awaiting settlement). | [optional] | +|**createdAt** | **Long** | Order creation timestamp (Unix epoch milliseconds). | [optional] | + + + diff --git a/clients/web3-wallet/docs/TimeFrame.md b/clients/web3-wallet/docs/TimeFrame.md new file mode 100644 index 0000000..aea19fc --- /dev/null +++ b/clients/web3-wallet/docs/TimeFrame.md @@ -0,0 +1,15 @@ + + +# TimeFrame + +## Enum + + +* `TIME_FRAME_1` (value: `"1"`) + +* `TIME_FRAME_2` (value: `"2"`) + +* `TIME_FRAME_3` (value: `"3"`) + + + diff --git a/clients/web3-wallet/docs/TrackerType.md b/clients/web3-wallet/docs/TrackerType.md new file mode 100644 index 0000000..e951666 --- /dev/null +++ b/clients/web3-wallet/docs/TrackerType.md @@ -0,0 +1,15 @@ + + +# TrackerType + +## Enum + + +* `TRACKER_TYPE_1` (value: `"1"`) + +* `TRACKER_TYPE_2` (value: `"2"`) + +* `TRACKER_TYPE_3` (value: `"3"`) + + + diff --git a/clients/web3-wallet/docs/TradingApi.md b/clients/web3-wallet/docs/TradingApi.md index 698ec1b..2d9f40d 100644 --- a/clients/web3-wallet/docs/TradingApi.md +++ b/clients/web3-wallet/docs/TradingApi.md @@ -4,16 +4,125 @@ All URIs are relative to *https://web3.binance.com/build* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**buildSolanaSwapInstructions**](TradingApi.md#buildSolanaSwapInstructions) | **GET** /api/v1/dex/aggregator/swap-instruction | Build Solana Swap Instructions | | [**buildSwapTransaction**](TradingApi.md#buildSwapTransaction) | **GET** /api/v1/dex/aggregator/swap | Build Swap Transaction | | [**getAggregatedQuote**](TradingApi.md#getAggregatedQuote) | **GET** /api/v1/dex/aggregator/quote | Get Aggregated Quote | | [**getAggregatorSupportedChains**](TradingApi.md#getAggregatorSupportedChains) | **GET** /api/v1/dex/aggregator/supported/chain | Get Aggregator Supported Chains | | [**getErc20ApproveTransaction**](TradingApi.md#getErc20ApproveTransaction) | **GET** /api/v1/dex/aggregator/approve-transaction | Get ERC-20 Approve Transaction | +| [**getRfqOrderStatus**](TradingApi.md#getRfqOrderStatus) | **GET** /api/v1/dex/aggregator/order/{orderId} | Get RFQ Order Status | | [**getTransactionStatus**](TradingApi.md#getTransactionStatus) | **GET** /api/v1/dex/aggregator/history | Get Transaction Status | +| [**quoteAndBuildSwapTransaction**](TradingApi.md#quoteAndBuildSwapTransaction) | **GET** /api/v1/dex/aggregator/quote-and-swap | Quote and Build Swap Transaction (Flash API) | +| [**submitRfqOrder**](TradingApi.md#submitRfqOrder) | **POST** /api/v1/dex/aggregator/order/submit | Submit RFQ Order | + +# **buildSolanaSwapInstructions** +> BuildSolanaSwapInstructionsResponse buildSolanaSwapInstructions(binanceChainId, amount, fromTokenAddress, toTokenAddress, slippagePercent, userWalletAddress, quoteId).recvWindow(recvWindow).nonce(nonce).priceImpactProtectionPercent(priceImpactProtectionPercent).autoSlippage(autoSlippage).maxAutoSlippagePercent(maxAutoSlippagePercent).computeUnitLimit(computeUnitLimit).computeUnitPrice(computeUnitPrice).gasLevel(gasLevel).tips(tips).execute(); + +Build Solana Swap Instructions + +Solana-only counterpart to `/swap`. Shares the full quote → route → vendor `buildSwapTx` → priceImpact → minReceive → instruction-assembly pipeline; the only difference is the response: instead of returning a signed-and-serialized base64 transaction, this endpoint returns the **uncompiled** instruction list plus the address-lookup-table (ALT) address list, leaving v0-transaction compilation, signing, and submission to the caller. Use this when the caller needs to: - prepend / append their own instructions (e.g. fee splitting, custom logging) before signing; - reuse the platform-curated route, slippage, PS-variant rewriting, ALT injection, ComputeBudget overwrite, and ATA batching while still controlling the final wire format. Only supports `binanceChainId=CT_501` (Solana). Other chains return `CHAIN_NOT_SUPPORTED` (40411). Parameters mirror the Solana subset of `/swap` (no EVM-only `approveTransaction` / `approveAmount` / `gasLimit`). + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.TradingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + TradingApi apiInstance = new TradingApi(defaultClient); + BinanceChainId binanceChainId = BinanceChainId.fromValue("CT_501"); // BinanceChainId | Chain identifier. Only `CT_501` (Solana) is accepted; other values return `CHAIN_NOT_SUPPORTED` (40411). + String amount = "12000000"; // String | Sell-token amount in the token's smallest unit (positive integer string, no decimals). + String fromTokenAddress = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"; // String | Sell-token mint address (Solana Base58, case-sensitive). + String toTokenAddress = "So11111111111111111111111111111111111111112"; // String | Buy-token mint address (Solana Base58, case-sensitive). + String slippagePercent = "0.5"; // String | Maximum slippage as a percentage. Solana range 0 to less than 100. \"0.5\" means 0.5%. + String userWalletAddress = "J5CBzXpcYn6WR2JBah8zU4Yxct985CAFGwXRcFaX2pbS"; // String | User wallet address (Solana Base58); becomes the v0 transaction's `feePayer`. + String quoteId = "a1b2c3d4e5f64a8b9c0d1e2f3a4b5c6d"; // String | quoteId returned from `/quote` for the route to execute. TTL ~30s; expired entries return `QUOTE_EXPIRED` (40401). + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + String priceImpactProtectionPercent = "90"; // String | Maximum allowed price impact percentage (0–100). Defaults to 90; set to 100 to disable. + AutoSlippage autoSlippage = AutoSlippage.fromValue("true"); // AutoSlippage | When \"true\", slippage is auto-derived from market data and overrides `slippagePercent`. Defaults to false. + String maxAutoSlippagePercent = "3"; // String | Cap on auto-derived slippage (only applies when `autoSlippage=true`). + String computeUnitLimit = "1400000"; // String | Maximum compute units the transaction may consume (analogous to EVM gasLimit). Defaults to the platform value when omitted. + String computeUnitPrice = "1000"; // String | Priority fee per compute unit (micro-lamports). When omitted, the platform computes a value either from the `gasLevel` tier or from chain-side defaults. + GasLevel gasLevel = GasLevel.fromValue("slow"); // GasLevel | Priority-fee tier; consulted only when `computeUnitPrice` is omitted. Defaults to \"average\". + String tips = "0.001"; // String | Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] (minimum 1 lamport). When specified, it is recommended to set `computeUnitPrice=0`. The platform picks one of Jito's tip accounts at random per request. + try { + BuildSolanaSwapInstructionsResponse result = apiInstance.buildSolanaSwapInstructions(binanceChainId, amount, fromTokenAddress, toTokenAddress, slippagePercent, userWalletAddress, quoteId) + .recvWindow(recvWindow) + .nonce(nonce) + .priceImpactProtectionPercent(priceImpactProtectionPercent) + .autoSlippage(autoSlippage) + .maxAutoSlippagePercent(maxAutoSlippagePercent) + .computeUnitLimit(computeUnitLimit) + .computeUnitPrice(computeUnitPrice) + .gasLevel(gasLevel) + .tips(tips) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradingApi#buildSolanaSwapInstructions"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | [**BinanceChainId**](.md)| Chain identifier. Only `CT_501` (Solana) is accepted; other values return `CHAIN_NOT_SUPPORTED` (40411). | [enum: CT_501] | +| **amount** | **String**| Sell-token amount in the token's smallest unit (positive integer string, no decimals). | | +| **fromTokenAddress** | **String**| Sell-token mint address (Solana Base58, case-sensitive). | | +| **toTokenAddress** | **String**| Buy-token mint address (Solana Base58, case-sensitive). | | +| **slippagePercent** | **String**| Maximum slippage as a percentage. Solana range 0 to less than 100. \"0.5\" means 0.5%. | | +| **userWalletAddress** | **String**| User wallet address (Solana Base58); becomes the v0 transaction's `feePayer`. | | +| **quoteId** | **String**| quoteId returned from `/quote` for the route to execute. TTL ~30s; expired entries return `QUOTE_EXPIRED` (40401). | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **priceImpactProtectionPercent** | **String**| Maximum allowed price impact percentage (0–100). Defaults to 90; set to 100 to disable. | [optional] | +| **autoSlippage** | [**AutoSlippage**](.md)| When \"true\", slippage is auto-derived from market data and overrides `slippagePercent`. Defaults to false. | [optional] [enum: true, false] | +| **maxAutoSlippagePercent** | **String**| Cap on auto-derived slippage (only applies when `autoSlippage=true`). | [optional] | +| **computeUnitLimit** | **String**| Maximum compute units the transaction may consume (analogous to EVM gasLimit). Defaults to the platform value when omitted. | [optional] | +| **computeUnitPrice** | **String**| Priority fee per compute unit (micro-lamports). When omitted, the platform computes a value either from the `gasLevel` tier or from chain-side defaults. | [optional] | +| **gasLevel** | [**GasLevel**](.md)| Priority-fee tier; consulted only when `computeUnitPrice` is omitted. Defaults to \"average\". | [optional] [enum: slow, average, fast] | +| **tips** | **String**| Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] (minimum 1 lamport). When specified, it is recommended to set `computeUnitPrice=0`. The platform picks one of Jito's tip accounts at random per request. | [optional] | + +### Return type + +[**BuildSolanaSwapInstructionsResponse**](BuildSolanaSwapInstructionsResponse.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** | Uncompiled Solana instruction list and ALT addresses returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + # **buildSwapTransaction** -> BuildSwapTransactionResponse buildSwapTransaction(binanceChainId, amount, fromTokenAddress, toTokenAddress, slippagePercent, userWalletAddress, quoteId).recvWindow(recvWindow).nonce(nonce).approveTransaction(approveTransaction).approveAmount(approveAmount).gasLimit(gasLimit).gasLevel(gasLevel).priceImpactProtectionPercent(priceImpactProtectionPercent).autoSlippage(autoSlippage).maxAutoSlippagePercent(maxAutoSlippagePercent).computeUnitLimit(computeUnitLimit).computeUnitPrice(computeUnitPrice).tips(tips).execute(); +> BuildSwapTransactionResponse buildSwapTransaction(binanceChainId, amount, fromTokenAddress, toTokenAddress, userWalletAddress, quoteId).recvWindow(recvWindow).nonce(nonce).slippagePercent(slippagePercent).approveTransaction(approveTransaction).approveAmount(approveAmount).gasLimit(gasLimit).gasLevel(gasLevel).priceImpactProtectionPercent(priceImpactProtectionPercent).autoSlippage(autoSlippage).maxAutoSlippagePercent(maxAutoSlippagePercent).computeUnitLimit(computeUnitLimit).computeUnitPrice(computeUnitPrice).tips(tips).execute(); Build Swap Transaction @@ -38,25 +147,26 @@ public class Example { String amount = "1000000"; // String | Sell-token amount in the token's smallest unit (positive integer string, no decimals). String fromTokenAddress = "0x55d398326f99059fF775485246999027B3197955"; // String | Sell-token contract address. String toTokenAddress = "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"; // String | Buy-token contract address. - String slippagePercent = "0.5"; // String | Maximum slippage as a percentage. EVM range 0–100; Solana range 0 to less than 100. \"0.5\" means 0.5%. String userWalletAddress = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; // String | User wallet address (transaction sender). String quoteId = "a1b2c3d4e5f64a8b9c0d1e2f3a4b5c6d"; // String | quoteId returned from `/quote` for the route to execute. TTL ~30s; expired entries return `QUOTE_EXPIRED` (40401). Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + String slippagePercent = "0.5"; // String | Maximum slippage tolerance as a percentage string. Required unless `autoSlippage=true`. **Range by chain:** - EVM chains (BSC, Ethereum, Base, etc.): `0` to `100` (inclusive) - Solana (`CT_501`): `0` to less than `100` (i.e. `< 100`) **Range by vendor:** - 1inch, PancakeSwap: `0` to `50` (values above 50 are rejected) - LiFi, LiquidMesh: `0` to `100` (EVM) or `0` to `< 100` (Solana) - Jupiter (Solana): `0` to less than `100`; the value is converted to basis points (`slippageBps = ceil(slippagePercent × 100)`) and applied to the on-chain swap `\"0.5\"` means 0.5% maximum slippage. When `autoSlippage=true` this field is overridden by the auto-computed value. ApproveTransaction approveTransaction = ApproveTransaction.fromValue("true"); // ApproveTransaction | When \"true\", `signatureData` includes the spender address and approve calldata so the client can submit it before the swap. Defaults to false. String approveAmount = "1000000"; // String | Override approve amount (smallest unit, positive integer string). Defaults to the swap amount. String gasLimit = "200000"; // String | Gas limit override (positive integer string). EVM only. GasLevel gasLevel = GasLevel.fromValue("slow"); // GasLevel | Gas price tier. Defaults to \"average\". String priceImpactProtectionPercent = "90"; // String | Maximum allowed price impact percentage (0–100). Defaults to 90; set to 100 to disable. - AutoSlippage autoSlippage = AutoSlippage.fromValue("true"); // AutoSlippage | When \"true\", slippage is auto-derived from market data and overrides `slippagePercent`. Defaults to false. + AutoSlippage autoSlippage = AutoSlippage.fromValue("true"); // AutoSlippage | When `\"true\"`, slippage is auto-derived from market data and overrides `slippagePercent`. Either `slippagePercent` or `autoSlippage=true` must be provided — omitting both returns a parameter error. Defaults to `\"false\"`. String maxAutoSlippagePercent = "3"; // String | Cap on auto-derived slippage (only applies when `autoSlippage=true`). String computeUnitLimit = "1400000"; // String | Solana only — maximum compute units the transaction may consume (analogous to EVM gasLimit). Applies only when `binanceChainId=CT_501`. String computeUnitPrice = "1000"; // String | Solana only — priority fee per compute unit (micro-lamports), analogous to EVM gasPrice. When omitted, the platform computes a value dynamically. Applies only when `binanceChainId=CT_501`. String tips = "0.001"; // String | Solana only — Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] (minimum 1 lamport). When specified, it is recommended to set `computeUnitPrice=0`. Applies only when `binanceChainId=CT_501`. try { - BuildSwapTransactionResponse result = apiInstance.buildSwapTransaction(binanceChainId, amount, fromTokenAddress, toTokenAddress, slippagePercent, userWalletAddress, quoteId) + BuildSwapTransactionResponse result = apiInstance.buildSwapTransaction(binanceChainId, amount, fromTokenAddress, toTokenAddress, userWalletAddress, quoteId) .recvWindow(recvWindow) .nonce(nonce) + .slippagePercent(slippagePercent) .approveTransaction(approveTransaction) .approveAmount(approveAmount) .gasLimit(gasLimit) @@ -88,17 +198,17 @@ public class Example { | **amount** | **String**| Sell-token amount in the token's smallest unit (positive integer string, no decimals). | | | **fromTokenAddress** | **String**| Sell-token contract address. | | | **toTokenAddress** | **String**| Buy-token contract address. | | -| **slippagePercent** | **String**| Maximum slippage as a percentage. EVM range 0–100; Solana range 0 to less than 100. \"0.5\" means 0.5%. | | | **userWalletAddress** | **String**| User wallet address (transaction sender). | | | **quoteId** | **String**| quoteId returned from `/quote` for the route to execute. TTL ~30s; expired entries return `QUOTE_EXPIRED` (40401). | | | **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | | **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **slippagePercent** | **String**| Maximum slippage tolerance as a percentage string. Required unless `autoSlippage=true`. **Range by chain:** - EVM chains (BSC, Ethereum, Base, etc.): `0` to `100` (inclusive) - Solana (`CT_501`): `0` to less than `100` (i.e. `< 100`) **Range by vendor:** - 1inch, PancakeSwap: `0` to `50` (values above 50 are rejected) - LiFi, LiquidMesh: `0` to `100` (EVM) or `0` to `< 100` (Solana) - Jupiter (Solana): `0` to less than `100`; the value is converted to basis points (`slippageBps = ceil(slippagePercent × 100)`) and applied to the on-chain swap `\"0.5\"` means 0.5% maximum slippage. When `autoSlippage=true` this field is overridden by the auto-computed value. | [optional] | | **approveTransaction** | [**ApproveTransaction**](.md)| When \"true\", `signatureData` includes the spender address and approve calldata so the client can submit it before the swap. Defaults to false. | [optional] [enum: true, false] | | **approveAmount** | **String**| Override approve amount (smallest unit, positive integer string). Defaults to the swap amount. | [optional] | | **gasLimit** | **String**| Gas limit override (positive integer string). EVM only. | [optional] | | **gasLevel** | [**GasLevel**](.md)| Gas price tier. Defaults to \"average\". | [optional] [enum: slow, average, fast] | | **priceImpactProtectionPercent** | **String**| Maximum allowed price impact percentage (0–100). Defaults to 90; set to 100 to disable. | [optional] | -| **autoSlippage** | [**AutoSlippage**](.md)| When \"true\", slippage is auto-derived from market data and overrides `slippagePercent`. Defaults to false. | [optional] [enum: true, false] | +| **autoSlippage** | [**AutoSlippage**](.md)| When `\"true\"`, slippage is auto-derived from market data and overrides `slippagePercent`. Either `slippagePercent` or `autoSlippage=true` must be provided — omitting both returns a parameter error. Defaults to `\"false\"`. | [optional] [enum: true, false] | | **maxAutoSlippagePercent** | **String**| Cap on auto-derived slippage (only applies when `autoSlippage=true`). | [optional] | | **computeUnitLimit** | **String**| Solana only — maximum compute units the transaction may consume (analogous to EVM gasLimit). Applies only when `binanceChainId=CT_501`. | [optional] | | **computeUnitPrice** | **String**| Solana only — priority fee per compute unit (micro-lamports), analogous to EVM gasPrice. When omitted, the platform computes a value dynamically. Applies only when `binanceChainId=CT_501`. | [optional] | @@ -127,7 +237,7 @@ No authorization required # **getAggregatedQuote** -> GetAggregatedQuoteResponse getAggregatedQuote(binanceChainId, amount, fromTokenAddress, toTokenAddress).recvWindow(recvWindow).nonce(nonce).execute(); +> GetAggregatedQuoteResponse getAggregatedQuote(binanceChainId, amount, fromTokenAddress, toTokenAddress).recvWindow(recvWindow).nonce(nonce).userWalletAddress(userWalletAddress).execute(); Get Aggregated Quote @@ -154,10 +264,12 @@ public class Example { String toTokenAddress = "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"; // String | Buy-token contract address. Must differ from `fromTokenAddress`. Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + String userWalletAddress = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; // String | User wallet address. Required when quoting RFQ routes (equity / RWA tokens such as Ondo and BStock). This address is used as the receiver in the RFQ order and must match the wallet that signs `rfq.typedDataToSign` in the subsequent `/swap` call. try { GetAggregatedQuoteResponse result = apiInstance.getAggregatedQuote(binanceChainId, amount, fromTokenAddress, toTokenAddress) .recvWindow(recvWindow) .nonce(nonce) + .userWalletAddress(userWalletAddress) .execute(); System.out.println(result); } catch (ApiException e) { @@ -181,6 +293,7 @@ public class Example { | **toTokenAddress** | **String**| Buy-token contract address. Must differ from `fromTokenAddress`. | | | **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | | **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **userWalletAddress** | **String**| User wallet address. Required when quoting RFQ routes (equity / RWA tokens such as Ondo and BStock). This address is used as the receiver in the RFQ order and must match the wallet that signs `rfq.typedDataToSign` in the subsequent `/swap` call. | [optional] | ### Return type @@ -278,7 +391,7 @@ No authorization required # **getErc20ApproveTransaction** -> GetErc20ApproveTransactionResponse getErc20ApproveTransaction(binanceChainId, tokenContractAddress, approveAmount).recvWindow(recvWindow).nonce(nonce).execute(); +> GetErc20ApproveTransactionResponse getErc20ApproveTransaction(binanceChainId, tokenContractAddress, approveAmount).recvWindow(recvWindow).nonce(nonce).vendor(vendor).execute(); Get ERC-20 Approve Transaction @@ -304,10 +417,12 @@ public class Example { String approveAmount = "1000000"; // String | Approval amount in the token's smallest unit (positive integer string). Example \"1000000\" = 1 USDT (decimals=6). Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + String vendor = "PcsXRfq"; // String | RFQ vendor name. **Required for equity / RWA tokens (Ondo, BStock)**; pass the `vendorName` from the `/quote` response (e.g. `InchFusion`, `CowSwap`, `PcsXRfq`). When provided, the backend returns approve calldata targeting the vendor-specific spender contract (e.g. 1inch Router, PcsX Permit2, CowSwap VaultRelayer) instead of the default DEX router. For regular (non-RWA) tokens, this parameter is optional. If omitted, the backend uses the standard DEX router. If a valid RFQ vendor is passed, the backend resolves that vendor's spender — used when buying Ondo/BStock with a stablecoin, where the from-token (e.g. USDT) itself is not an RFQ token but must be approved to the RFQ vendor's router. try { GetErc20ApproveTransactionResponse result = apiInstance.getErc20ApproveTransaction(binanceChainId, tokenContractAddress, approveAmount) .recvWindow(recvWindow) .nonce(nonce) + .vendor(vendor) .execute(); System.out.println(result); } catch (ApiException e) { @@ -330,6 +445,7 @@ public class Example { | **approveAmount** | **String**| Approval amount in the token's smallest unit (positive integer string). Example \"1000000\" = 1 USDT (decimals=6). | | | **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | | **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **vendor** | **String**| RFQ vendor name. **Required for equity / RWA tokens (Ondo, BStock)**; pass the `vendorName` from the `/quote` response (e.g. `InchFusion`, `CowSwap`, `PcsXRfq`). When provided, the backend returns approve calldata targeting the vendor-specific spender contract (e.g. 1inch Router, PcsX Permit2, CowSwap VaultRelayer) instead of the default DEX router. For regular (non-RWA) tokens, this parameter is optional. If omitted, the backend uses the standard DEX router. If a valid RFQ vendor is passed, the backend resolves that vendor's spender — used when buying Ondo/BStock with a stablecoin, where the from-token (e.g. USDT) itself is not an RFQ token but must be approved to the RFQ vendor's router. | [optional] | ### Return type @@ -352,6 +468,78 @@ No authorization required | **403** | Forbidden. The API key does not have permission to access this endpoint. | - | | **404** | Not Found. The requested resource or endpoint does not exist. | - | + +# **getRfqOrderStatus** +> GetRfqOrderStatusResponse getRfqOrderStatus(orderId).recvWindow(recvWindow).nonce(nonce).execute(); + +Get RFQ Order Status + +Query the settlement status of an RFQ order by its platform `orderId` (returned by `POST /order/submit`). Poll this endpoint until `status` reaches a terminal state: `FILLED` (settled on-chain) or `FAILED` (settlement failed). + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.TradingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + TradingApi apiInstance = new TradingApi(defaultClient); + String orderId = "oc-o-abc123def456"; // String | Platform order ID returned by `POST /order/submit`. + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + try { + GetRfqOrderStatusResponse result = apiInstance.getRfqOrderStatus(orderId) + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradingApi#getRfqOrderStatus"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| Platform order ID returned by `POST /order/submit`. | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | + +### Return type + +[**GetRfqOrderStatusResponse**](GetRfqOrderStatusResponse.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** | Order status returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + # **getTransactionStatus** > GetTransactionStatusResponse getTransactionStatus(binanceChainId, txHash).recvWindow(recvWindow).nonce(nonce).execute(); @@ -426,3 +614,190 @@ No authorization required | **403** | Forbidden. The API key does not have permission to access this endpoint. | - | | **404** | Not Found. The requested resource or endpoint does not exist. | - | + +# **quoteAndBuildSwapTransaction** +> QuoteAndBuildSwapTransactionResponse quoteAndBuildSwapTransaction(binanceChainId, amount, fromTokenAddress, toTokenAddress, userWalletAddress, vendor).recvWindow(recvWindow).nonce(nonce).slippagePercent(slippagePercent).approveTransaction(approveTransaction).approveAmount(approveAmount).gasLimit(gasLimit).gasLevel(gasLevel).priceImpactProtectionPercent(priceImpactProtectionPercent).autoSlippage(autoSlippage).maxAutoSlippagePercent(maxAutoSlippagePercent).computeUnitLimit(computeUnitLimit).computeUnitPrice(computeUnitPrice).tips(tips).execute(); + +Quote and Build Swap Transaction (Flash API) + +Combines quoting and swap-transaction construction into a single call. Unlike the two-step `/quote` + `/swap` flow, this endpoint does not require a prior `/quote` call or a `quoteId` — it returns the executable calldata / swapTransaction directly, eliminating one HTTP round-trip. Use this endpoint for latency-sensitive trading when the vendor is known upfront. The response shape is identical to `/swap`, so clients can reuse the same response parsing logic for both endpoints. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.TradingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + TradingApi apiInstance = new TradingApi(defaultClient); + String binanceChainId = "56"; // String | Unique chain identifier (e.g. \"56\"=BSC, \"1\"=Ethereum, \"CT_501\"=Solana). + String amount = "1000000"; // String | Sell-token amount in the token's smallest unit (positive integer string, no decimals). + String fromTokenAddress = "0x55d398326f99059fF775485246999027B3197955"; // String | Sell-token contract address. + String toTokenAddress = "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"; // String | Buy-token contract address. + String userWalletAddress = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; // String | User wallet address (transaction sender). For Solana, a Base58 system-account address with sufficient SOL for gas. + Vendor vendor = Vendor.fromValue("LiquidMesh"); // Vendor | Swap vendor to use for this request. **Required** — case-sensitive; must match one of the enum values. Any other value returns `PARAM_ERROR` (40001). For multi-vendor aggregation, use `/swap` with a `quoteId` instead. + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + String slippagePercent = "0.5"; // String | Maximum slippage tolerance as a percentage string. Required unless `autoSlippage=true`. **Range by chain:** - EVM chains (BSC, Ethereum, Base, etc.): `0` to `100` (inclusive) - Solana (`CT_501`): `0` to less than `100` (i.e. `< 100`) `\"0.5\"` means 0.5% maximum slippage. When `autoSlippage=true` this field is overridden by the auto-computed value. + ApproveTransaction approveTransaction = ApproveTransaction.fromValue("true"); // ApproveTransaction | When \"true\", `signatureData` includes the spender address and approve calldata so the client can submit it before the swap. Defaults to false. + String approveAmount = "1000000"; // String | Override approve amount (smallest unit, positive integer string). Defaults to the swap amount. + String gasLimit = "200000"; // String | Gas limit override (positive integer string). EVM only. + GasLevel gasLevel = GasLevel.fromValue("slow"); // GasLevel | Gas price tier. Defaults to \"average\". + String priceImpactProtectionPercent = "90"; // String | Maximum allowed price impact percentage (0–100). Defaults to 90; set to 100 to disable. + AutoSlippage autoSlippage = AutoSlippage.fromValue("true"); // AutoSlippage | When `\"true\"`, slippage is auto-derived from market data and overrides `slippagePercent`. Either `slippagePercent` or `autoSlippage=true` must be provided — omitting both returns a parameter error. Defaults to `\"false\"`. + String maxAutoSlippagePercent = "3"; // String | Cap on auto-derived slippage (only applies when `autoSlippage=true`). + String computeUnitLimit = "1400000"; // String | Solana only — maximum compute units the transaction may consume (analogous to EVM gasLimit). Applies only when `binanceChainId=CT_501`. + String computeUnitPrice = "1000"; // String | Solana only — priority fee per compute unit (micro-lamports), analogous to EVM gasPrice. When omitted, the platform computes a value dynamically. Applies only when `binanceChainId=CT_501`. + String tips = "0.001"; // String | Solana only — Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] (minimum 1 lamport). When specified, it is recommended to set `computeUnitPrice=0`. Applies only when `binanceChainId=CT_501`. + try { + QuoteAndBuildSwapTransactionResponse result = apiInstance.quoteAndBuildSwapTransaction(binanceChainId, amount, fromTokenAddress, toTokenAddress, userWalletAddress, vendor) + .recvWindow(recvWindow) + .nonce(nonce) + .slippagePercent(slippagePercent) + .approveTransaction(approveTransaction) + .approveAmount(approveAmount) + .gasLimit(gasLimit) + .gasLevel(gasLevel) + .priceImpactProtectionPercent(priceImpactProtectionPercent) + .autoSlippage(autoSlippage) + .maxAutoSlippagePercent(maxAutoSlippagePercent) + .computeUnitLimit(computeUnitLimit) + .computeUnitPrice(computeUnitPrice) + .tips(tips) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradingApi#quoteAndBuildSwapTransaction"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"56\"=BSC, \"1\"=Ethereum, \"CT_501\"=Solana). | | +| **amount** | **String**| Sell-token amount in the token's smallest unit (positive integer string, no decimals). | | +| **fromTokenAddress** | **String**| Sell-token contract address. | | +| **toTokenAddress** | **String**| Buy-token contract address. | | +| **userWalletAddress** | **String**| User wallet address (transaction sender). For Solana, a Base58 system-account address with sufficient SOL for gas. | | +| **vendor** | [**Vendor**](.md)| Swap vendor to use for this request. **Required** — case-sensitive; must match one of the enum values. Any other value returns `PARAM_ERROR` (40001). For multi-vendor aggregation, use `/swap` with a `quoteId` instead. | [enum: LiquidMesh] | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | +| **slippagePercent** | **String**| Maximum slippage tolerance as a percentage string. Required unless `autoSlippage=true`. **Range by chain:** - EVM chains (BSC, Ethereum, Base, etc.): `0` to `100` (inclusive) - Solana (`CT_501`): `0` to less than `100` (i.e. `< 100`) `\"0.5\"` means 0.5% maximum slippage. When `autoSlippage=true` this field is overridden by the auto-computed value. | [optional] | +| **approveTransaction** | [**ApproveTransaction**](.md)| When \"true\", `signatureData` includes the spender address and approve calldata so the client can submit it before the swap. Defaults to false. | [optional] [enum: true, false] | +| **approveAmount** | **String**| Override approve amount (smallest unit, positive integer string). Defaults to the swap amount. | [optional] | +| **gasLimit** | **String**| Gas limit override (positive integer string). EVM only. | [optional] | +| **gasLevel** | [**GasLevel**](.md)| Gas price tier. Defaults to \"average\". | [optional] [enum: slow, average, fast] | +| **priceImpactProtectionPercent** | **String**| Maximum allowed price impact percentage (0–100). Defaults to 90; set to 100 to disable. | [optional] | +| **autoSlippage** | [**AutoSlippage**](.md)| When `\"true\"`, slippage is auto-derived from market data and overrides `slippagePercent`. Either `slippagePercent` or `autoSlippage=true` must be provided — omitting both returns a parameter error. Defaults to `\"false\"`. | [optional] [enum: true, false] | +| **maxAutoSlippagePercent** | **String**| Cap on auto-derived slippage (only applies when `autoSlippage=true`). | [optional] | +| **computeUnitLimit** | **String**| Solana only — maximum compute units the transaction may consume (analogous to EVM gasLimit). Applies only when `binanceChainId=CT_501`. | [optional] | +| **computeUnitPrice** | **String**| Solana only — priority fee per compute unit (micro-lamports), analogous to EVM gasPrice. When omitted, the platform computes a value dynamically. Applies only when `binanceChainId=CT_501`. | [optional] | +| **tips** | **String**| Solana only — Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] (minimum 1 lamport). When specified, it is recommended to set `computeUnitPrice=0`. Applies only when `binanceChainId=CT_501`. | [optional] | + +### Return type + +[**QuoteAndBuildSwapTransactionResponse**](QuoteAndBuildSwapTransactionResponse.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** | Swap transaction data returned successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + + +# **submitRfqOrder** +> SubmitRfqOrderResponse submitRfqOrder(submitRfqOrderRequest).recvWindow(recvWindow).nonce(nonce).execute(); + +Submit RFQ Order + +Submit a signed RFQ order to the backend for on-chain settlement via the corresponding vendor relayer. Only used when `executionMode=RFQ` (equity / RWA tokens such as Ondo and BStock). **Flow**: `GET /quote` → pick an RFQ route → `GET /swap` → sign `rfq.typedDataToSign` with EIP-712 (`eth_signTypedData_v4`) → call this endpoint → poll `GET /order/{orderId}` until `FILLED` or `FAILED`. **Idempotency**: Submitting with the same `requestId` within 30 minutes returns the original result without re-calling the vendor. Use a new UUID for each distinct order; reuse the same UUID when retrying. + +### Example +```java +// Import classes: +import com.binance.connector.client.web3_wallet.ApiClient; +import com.binance.connector.client.web3_wallet.ApiException; +import com.binance.connector.client.web3_wallet.Configuration; +import com.binance.connector.client.web3_wallet.models.*; +import com.binance.connector.client.web3_wallet.rest.api.TradingApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://web3.binance.com/build"); + + TradingApi apiInstance = new TradingApi(defaultClient); + SubmitRfqOrderRequest submitRfqOrderRequest = new SubmitRfqOrderRequest(); // SubmitRfqOrderRequest | + Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). + String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + try { + SubmitRfqOrderResponse result = apiInstance.submitRfqOrder(submitRfqOrderRequest) + .recvWindow(recvWindow) + .nonce(nonce) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradingApi#submitRfqOrder"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **submitRfqOrderRequest** | [**SubmitRfqOrderRequest**](SubmitRfqOrderRequest.md)| | | +| **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | +| **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | + +### Return type + +[**SubmitRfqOrderResponse**](SubmitRfqOrderResponse.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** | RFQ order submitted successfully. | - | +| **401** | Unauthorized. The request is missing or contains an invalid API key. | - | +| **403** | Forbidden. The API key does not have permission to access this endpoint. | - | +| **404** | Not Found. The requested resource or endpoint does not exist. | - | + diff --git a/clients/web3-wallet/docs/TransactionApi.md b/clients/web3-wallet/docs/TransactionApi.md index af1bffd..8e9e4b3 100644 --- a/clients/web3-wallet/docs/TransactionApi.md +++ b/clients/web3-wallet/docs/TransactionApi.md @@ -18,7 +18,7 @@ All URIs are relative to *https://web3.binance.com/build* Broadcast Transactions -Broadcast a client-signed transaction to the chain via the Binance Web3 API relay. Returns the transaction hash and an internal `orderId` you can use to track on-chain status via the post-transaction service. Optional MEV protection (EVM chains only) routes the transaction through a private mempool to mitigate front-running and sandwich attacks. +Broadcast a client-signed transaction to the chain via the Binance Web3 API relay. Returns the transaction hash and an internal `orderId` you can use to track on-chain status via the post-transaction service. Optional MEV protection (EVM chains only) routes the transaction through a private mempool to mitigate front-running and sandwich attacks. Tron and Solana do not support MEV protection; the flag is ignored on these chains. ### Example ```java @@ -176,7 +176,7 @@ No authorization required Get Gas Limit -Estimate the gas limit (or compute-unit ceiling on Solana) for an unsigned transaction. Provide either `evmTx` for EVM chains or `solTx` for Solana, matching the value of `binanceChainId`. +Estimate the gas limit (or compute-unit ceiling on Solana) for an unsigned transaction. Provide either `evmTx` for EVM chains, `solTx` for Solana, or `tronTx` for Tron (\"CT_195\"), matching the value of `binanceChainId`. On Tron the response carries energy/bandwidth fields instead of a single gas limit; `gasLimit` is the fee limit (in sun) and the energy/bandwidth fields describe resource consumption and pricing. ### Example ```java @@ -248,7 +248,7 @@ No authorization required Get Gas Price -Query the current network gas price for the specified chain. The response shape varies by chain family: - EVM chains return both `evmLegacyGasPrice` (legacy gasPrice) and `eip1559GasPrice` (baseFee + priority/max fees) when EIP-1559 is supported. - Solana returns `solanaGasPrice` (compute-unit prices and Jito tips). Fields not applicable to the chain family are returned as `null`. +Query the current network gas price for the specified chain. The response shape varies by chain family: - EVM chains return both `evmLegacyGasPrice` (legacy gasPrice) and `eip1559GasPrice` (baseFee + priority/max fees) when EIP-1559 is supported. - Solana returns `solanaGasPrice` (compute-unit prices and Jito tips). - Tron (\"CT_195\") returns an empty `data` object because Tron has no on-chain gas-price concept; use the gas-limit endpoint instead. Fields not applicable to the chain family are returned as `null`. ### Example ```java @@ -265,7 +265,7 @@ public class Example { defaultClient.setBasePath("https://web3.binance.com/build"); TransactionApi apiInstance = new TransactionApi(defaultClient); - String binanceChainId = "1"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + String binanceChainId = "1"; // String | Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana, \"CT_195\"=Tron). Long recvWindow = 5000L; // Long | Allowed time deviation in milliseconds (default: 5000, max: 60000). String nonce = "unique-nonce-string"; // String | Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. try { @@ -289,7 +289,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). | | +| **binanceChainId** | **String**| Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana, \"CT_195\"=Tron). | | | **recvWindow** | **Long**| Allowed time deviation in milliseconds (default: 5000, max: 60000). | [optional] | | **nonce** | **String**| Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. | [optional] | @@ -390,7 +390,7 @@ No authorization required Simulate Transactions -Simulate transaction execution off-chain to predict its outcome before broadcasting. The response includes the predicted execution status, balance changes per affected account/token, and ERC-20 allowance changes (EVM chains). Provide either `evmTx` (EVM chains) or `solTx` (Solana) matching `binanceChainId`. +Simulate transaction execution off-chain to predict its outcome before broadcasting. The response includes the predicted execution status, balance changes per affected account/token, and ERC-20 allowance changes (EVM chains). Provide either `evmTx` (EVM chains), `solTx` (Solana), or `tronTx` (Tron \"CT_195\") matching `binanceChainId`. On Tron, `allowanceChanges` is returned as an empty array. Note: Metis (chainId 1088) is not supported by this endpoint. ### Example ```java diff --git a/clients/web3-wallet/docs/Vendor.md b/clients/web3-wallet/docs/Vendor.md new file mode 100644 index 0000000..54898d3 --- /dev/null +++ b/clients/web3-wallet/docs/Vendor.md @@ -0,0 +1,11 @@ + + +# Vendor + +## Enum + + +* `LiquidMesh` (value: `"LiquidMesh"`) + + + diff --git a/clients/web3-wallet/docs/WalletType.md b/clients/web3-wallet/docs/WalletType.md new file mode 100644 index 0000000..d703c1f --- /dev/null +++ b/clients/web3-wallet/docs/WalletType.md @@ -0,0 +1,15 @@ + + +# WalletType + +## Enum + + +* `WALLET_TYPE_1` (value: `"1"`) + +* `WALLET_TYPE_2` (value: `"2"`) + +* `WALLET_TYPE_3` (value: `"3"`) + + + diff --git a/clients/web3-wallet/example_rest.md b/clients/web3-wallet/example_rest.md index 31d1861..1766171 100644 --- a/clients/web3-wallet/example_rest.md +++ b/clients/web3-wallet/example_rest.md @@ -1,31 +1,65 @@ -## Market +## AddressPortfolio -[GET /api/v1/dex/market/candles](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-candles) - getCandles - [GetCandlesExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetCandlesExample.java#L37) +[GET /api/v1/dex/market/portfolio/token/latest-pnl](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/address-portfolio#get-address-pn-lfor-specific-token) - getAddressPnLForSpecificToken - [GetAddressPnLForSpecificTokenExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPnLForSpecificTokenExample.java#L37) -[GET /api/v1/dex/market/token/holder](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-holders-ranking) - getHoldersRanking - [GetHoldersRankingExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetHoldersRankingExample.java#L39) +[GET /api/v1/dex/market/portfolio/overview](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/address-portfolio#get-address-portfolio-overview) - getAddressPortfolioOverview - [GetAddressPortfolioOverviewExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPortfolioOverviewExample.java#L38) -[GET /api/v1/dex/market/token/hot-token](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-hot-token-list) - getHotTokenList - [GetHotTokenListExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetHotTokenListExample.java#L39) +[GET /api/v1/dex/market/portfolio/recent-pnl](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/address-portfolio#get-address-recent-pn-l) - getAddressRecentPnL - [GetAddressRecentPnLExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressRecentPnLExample.java#L36) -[GET /api/v1/dex/market/supported/chain](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-supported-chains) - getSupportedChains - [GetSupportedChainsExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetSupportedChainsExample.java#L36) +[GET /api/v1/dex/market/portfolio/dex-history](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/address-portfolio#get-dex-trade-history) - getDexTradeHistory - [GetDexTradeHistoryExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetDexTradeHistoryExample.java#L38) -[GET /api/v1/dex/market/token/advanced-info](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-token-advanced-info) - getTokenAdvancedInfo - [GetTokenAdvancedInfoExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenAdvancedInfoExample.java#L38) +[GET /api/v1/dex/market/leaderboard/list](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/address-portfolio#get-leaderboard) - getLeaderboard - [GetLeaderboardExample.java:40](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetLeaderboardExample.java#L40) -[POST /api/v1/dex/market/token/basic-info](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-token-basic-info) - getTokenBasicInfo - [GetTokenBasicInfoExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenBasicInfoExample.java#L37) +[GET /api/v1/dex/market/portfolio/supported/chain](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/address-portfolio#get-portfolio-supported-chains) - getPortfolioSupportedChains - [GetPortfolioSupportedChainsExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetPortfolioSupportedChainsExample.java#L36) -[POST /api/v1/dex/market/price](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-token-price) - getTokenPrice - [GetTokenPriceExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenPriceExample.java#L36) +[GET /api/v1/dex/market/address-tracker/trades](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/address-portfolio#get-tracked-trades) - getTrackedTrades - [GetTrackedTradesExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetTrackedTradesExample.java#L38) -[GET /api/v1/dex/market/trades](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-token-trades) - getTokenTrades - [GetTokenTradesExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenTradesExample.java#L38) +## GeneralData -[POST /api/v1/dex/market/price-info](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-token-trading-info) - getTokenTradingInfo - [GetTokenTradingInfoExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenTradingInfoExample.java#L37) +[GET /api/v1/dex/market/candles](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-candles) - getCandles - [GetCandlesExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetCandlesExample.java#L37) -[GET /api/v1/dex/market/token/top-liquidity](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-top-liquidity-pools) - getTopLiquidityPools - [GetTopLiquidityPoolsExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTopLiquidityPoolsExample.java#L37) +[GET /api/v1/dex/market/token/holder](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-holders-ranking) - getHoldersRanking - [GetHoldersRankingExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetHoldersRankingExample.java#L39) -[GET /api/v1/dex/market/token/top-trader](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#get-top-traders) - getTopTraders - [GetTopTradersExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTopTradersExample.java#L39) +[GET /api/v1/dex/market/token/hot-token](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-hot-token-list) - getHotTokenList - [GetHotTokenListExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetHotTokenListExample.java#L39) -[GET /api/v1/dex/market/token/search](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/market-api#search-token) - searchToken - [SearchTokenExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/SearchTokenExample.java#L36) +[GET /api/v1/dex/market/supported/chain](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-supported-chains) - getSupportedChains - [GetSupportedChainsExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetSupportedChainsExample.java#L36) + +[GET /api/v1/dex/market/token/advanced-info](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-advanced-info) - getTokenAdvancedInfo - [GetTokenAdvancedInfoExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenAdvancedInfoExample.java#L38) + +[POST /api/v1/dex/market/token/basic-info](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-basic-info) - getTokenBasicInfo - [GetTokenBasicInfoExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenBasicInfoExample.java#L37) + +[GET /api/v1/dex/market/memepump/tokenDevInfo](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-dev-info) - getTokenDevInfo - [GetTokenDevInfoExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenDevInfoExample.java#L37) + +[POST /api/v1/dex/market/price](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-price) - getTokenPrice - [GetTokenPriceExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenPriceExample.java#L36) + +[GET /api/v1/dex/market/trades](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-trades) - getTokenTrades - [GetTokenTradesExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenTradesExample.java#L38) + +[POST /api/v1/dex/market/price-info](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-trading-info) - getTokenTradingInfo - [GetTokenTradingInfoExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenTradingInfoExample.java#L37) + +[GET /api/v1/dex/market/token/top-liquidity](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-top-liquidity-pools) - getTopLiquidityPools - [GetTopLiquidityPoolsExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTopLiquidityPoolsExample.java#L37) + +[GET /api/v1/dex/market/token/top-trader](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-top-traders) - getTopTraders - [GetTopTradersExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTopTradersExample.java#L39) + +[GET /api/v1/dex/market/token/search](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#search-token) - searchToken - [SearchTokenExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/SearchTokenExample.java#L36) + +## RwaData + +[GET /api/v1/dex/market/rwa/platforms](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/rwa-data#get-rwa-token-issuance-platforms) - getRwaTokenIssuancePlatforms - [GetRwaTokenIssuancePlatformsExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenIssuancePlatformsExample.java#L37) + +[GET /api/v1/dex/market/rwa/tokens](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/rwa-data#get-rwa-token-list) - getRwaTokenList - [GetRwaTokenListExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenListExample.java#L38) + +[GET /api/v1/dex/market/rwa/price](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/rwa-data#get-rwa-token-price) - getRwaTokenPrice - [GetRwaTokenPriceExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenPriceExample.java#L36) + +[GET /api/v1/dex/market/rwa/underlying-profile](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/rwa-data#get-rwa-underlying-info) - getRwaUnderlyingInfo - [GetRwaUnderlyingInfoExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingInfoExample.java#L36) + +[GET /api/v1/dex/market/rwa/underlying-market](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/rwa-data#get-rwa-underlying-market-data) - getRwaUnderlyingMarketData - [GetRwaUnderlyingMarketDataExample.java:36](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingMarketDataExample.java#L36) + +[GET /api/v1/dex/market/rwa/search](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/rwa-data#search-rwa-token) - searchRwaToken - [SearchRwaTokenExample.java:37](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/SearchRwaTokenExample.java#L37) ## Trading +[GET /api/v1/dex/aggregator/swap-instruction](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/trading-api#build-solana-swap-instructions) - buildSolanaSwapInstructions - [BuildSolanaSwapInstructionsExample.java:50](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSolanaSwapInstructionsExample.java#L50) + [GET /api/v1/dex/aggregator/swap](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/trading-api#build-swap-transaction) - buildSwapTransaction - [BuildSwapTransactionExample.java:42](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSwapTransactionExample.java#L42) [GET /api/v1/dex/aggregator/quote](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/trading-api#get-aggregated-quote) - getAggregatedQuote - [GetAggregatedQuoteExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetAggregatedQuoteExample.java#L38) @@ -34,31 +68,37 @@ [GET /api/v1/dex/aggregator/approve-transaction](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/trading-api#get-erc20-approve-transaction) - getErc20ApproveTransaction - [GetErc20ApproveTransactionExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetErc20ApproveTransactionExample.java#L38) +[GET /api/v1/dex/aggregator/order/{orderId}](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/trading-api#get-rfq-order-status) - getRfqOrderStatus - [GetRfqOrderStatusExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetRfqOrderStatusExample.java#L39) + [GET /api/v1/dex/aggregator/history](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/trading-api#get-transaction-status) - getTransactionStatus - [GetTransactionStatusExample.java:42](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetTransactionStatusExample.java#L42) +[GET /api/v1/dex/aggregator/quote-and-swap](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/trading-api#quote-and-build-swap-transaction) - quoteAndBuildSwapTransaction - [QuoteAndBuildSwapTransactionExample.java:46](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/QuoteAndBuildSwapTransactionExample.java#L46) + +[POST /api/v1/dex/aggregator/order/submit](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/trading-api#submit-rfq-order) - submitRfqOrder - [SubmitRfqOrderExample.java:44](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/SubmitRfqOrderExample.java#L44) + ## Transaction -[POST /api/v1/dex/pre-transaction/broadcast-transaction](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#broadcast-transactions) - broadcastTransactions - [BroadcastTransactionsExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/BroadcastTransactionsExample.java#L39) +[POST /api/v1/dex/pre-transaction/broadcast-transaction](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#broadcast-transactions) - broadcastTransactions - [BroadcastTransactionsExample.java:40](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/BroadcastTransactionsExample.java#L40) [GET /api/v1/dex/post-transaction/orders](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#get-broadcast-orders) - getBroadcastOrders - [GetBroadcastOrdersExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetBroadcastOrdersExample.java#L38) -[POST /api/v1/dex/pre-transaction/gas-limit](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#get-gas-limit) - getGasLimit - [GetGasLimitExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasLimitExample.java#L38) +[POST /api/v1/dex/pre-transaction/gas-limit](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#get-gas-limit) - getGasLimit - [GetGasLimitExample.java:41](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasLimitExample.java#L41) -[GET /api/v1/dex/pre-transaction/gas-price](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#get-gas-price) - getGasPrice - [GetGasPriceExample.java:40](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasPriceExample.java#L40) +[GET /api/v1/dex/pre-transaction/gas-price](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#get-gas-price) - getGasPrice - [GetGasPriceExample.java:42](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasPriceExample.java#L42) [GET /api/v1/dex/pre-transaction/supported/chain](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#get-transaction-supported-chains) - getTransactionSupportedChains - [GetTransactionSupportedChainsExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetTransactionSupportedChainsExample.java#L38) -[POST /api/v1/dex/pre-transaction/simulate](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#simulate-transactions) - simulateTransactions - [SimulateTransactionsExample.java:39](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/SimulateTransactionsExample.java#L39) +[POST /api/v1/dex/pre-transaction/simulate](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/transaction-api#simulate-transactions) - simulateTransactions - [SimulateTransactionsExample.java:41](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/SimulateTransactionsExample.java#L41) ## Wallet -[GET /api/v1/dex/balance/all-token-balances-by-address](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-all-token-balances-by-address) - getAllTokenBalancesByAddress - [GetAllTokenBalancesByAddressExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetAllTokenBalancesByAddressExample.java#L38) +[GET /api/v1/dex/balance/all-token-balances-by-address](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-all-token-balances-by-address) - getAllTokenBalancesByAddress - []() -[POST /api/v1/dex/balance/token-balances-by-address](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-token-balances-by-address) - getTokenBalancesByAddress - [GetTokenBalancesByAddressExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTokenBalancesByAddressExample.java#L38) +[POST /api/v1/dex/balance/token-balances-by-address](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-token-balances-by-address) - getTokenBalancesByAddress - []() -[GET /api/v1/dex/post-transaction/transaction-detail-by-txhash](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-transaction-detail-by-hash) - getTransactionDetailByHash - [GetTransactionDetailByHashExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTransactionDetailByHashExample.java#L38) +[GET /api/v1/dex/post-transaction/transaction-detail-by-txhash](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-transaction-detail-by-hash) - getTransactionDetailByHash - []() -[GET /api/v1/dex/post-transaction/transactions-by-address](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-transactions-by-address) - getTransactionsByAddress - [GetTransactionsByAddressExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTransactionsByAddressExample.java#L38) +[GET /api/v1/dex/post-transaction/transactions-by-address](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-transactions-by-address) - getTransactionsByAddress - []() -[GET /api/v1/dex/balance/supported/chain](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-wallet-supported-chains) - getWalletSupportedChains - [GetWalletSupportedChainsExample.java:38](/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetWalletSupportedChainsExample.java#L38) +[GET /api/v1/dex/balance/supported/chain](https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/wallet-api#get-wallet-supported-chains) - getWalletSupportedChains - []() diff --git a/clients/web3-wallet/pom.xml b/clients/web3-wallet/pom.xml index e05a53b..898bdd1 100644 --- a/clients/web3-wallet/pom.xml +++ b/clients/web3-wallet/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-web3-wallet web3-wallet - 2.0.0 + 3.0.0 jar diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/JSON.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/JSON.java index 99ac24e..bac1c44 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/JSON.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/JSON.java @@ -117,12 +117,60 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .BroadcastTransactionsResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataInstructionListsInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataRouterResult + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataRouterResultFromToken + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataRouterResultToToken + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSolanaSwapInstructionsResponseDataTx.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.BuildSwapTransactionResponse .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .BuildSwapTransactionResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .BuildSwapTransactionResponseDataRfq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .BuildSwapTransactionResponseDataRouterResult.CustomTypeAdapterFactory()); @@ -153,6 +201,43 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .BuildSwapTransactionResponseDataTx.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressPnLForSpecificTokenResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressPnLForSpecificTokenResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressPortfolioOverviewResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressPortfolioOverviewResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressPortfolioOverviewResponseDataDailyPnlInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetAddressRecentPnLResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressRecentPnLResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressRecentPnLResponseDataPnlListInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.GetAggregatedQuoteResponse .CustomTypeAdapterFactory()); @@ -209,6 +294,16 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.GetCandlesResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetDexTradeHistoryResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetDexTradeHistoryResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetDexTradeHistoryResponseDataTransactionListInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .GetErc20ApproveTransactionResponse.CustomTypeAdapterFactory()); @@ -224,6 +319,16 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.GetGasLimitRequestSolTx .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetGasLimitRequestTronTx + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetGasLimitRequestTronTxTransferContractParams.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetGasLimitRequestTronTxTriggerSmartContractParams + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.GetGasLimitResponse .CustomTypeAdapterFactory()); @@ -264,6 +369,91 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .GetHotTokenListResponseDataItemsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetLeaderboardResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetLeaderboardResponseData + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetLeaderboardResponseDataItemsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetLeaderboardResponseDataItemsInnerDailyPnlInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetPortfolioSupportedChainsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetPortfolioSupportedChainsResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetRfqOrderStatusResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRfqOrderStatusResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaTokenIssuancePlatformsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaTokenIssuancePlatformsResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaTokenListResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaTokenListResponseDataInnerStatusInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenPriceResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaTokenPriceResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetRwaUnderlyingInfoResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaUnderlyingInfoResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaUnderlyingInfoResponseDataCompanyInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaUnderlyingInfoResponseDataProtectionsValue + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaUnderlyingMarketDataResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaUnderlyingMarketDataResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaUnderlyingMarketDataResponseDataMarketData + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetRwaUnderlyingMarketDataResponseDataStatusInfo + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.GetSupportedChainsResponse .CustomTypeAdapterFactory()); @@ -296,6 +486,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.GetTokenBasicInfoResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetTokenDevInfoResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetTokenDevInfoResponseData + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetTokenDevInfoResponseDataDevHoldingInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetTokenDevInfoResponseDataDevLaunchedInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.GetTokenPriceResponse .CustomTypeAdapterFactory()); @@ -337,6 +539,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .GetTopTradersResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetTrackedTradesResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.GetTrackedTradesResponseData + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .GetTrackedTradesResponseDataTradesInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .GetTransactionDetailByHashResponse.CustomTypeAdapterFactory()); @@ -403,6 +614,24 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .GetWalletSupportedChainsResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .QuoteAndBuildSwapTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .QuoteAndBuildSwapTransactionResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .QuoteAndBuildSwapTransactionResponseDataRfq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.SearchRwaTokenResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .SearchRwaTokenResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .SearchRwaTokenResponseDataInnerAssetsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.SearchTokenResponse .CustomTypeAdapterFactory()); @@ -418,6 +647,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model .SimulateTransactionsRequestSolTx.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model + .SimulateTransactionsRequestTronTx.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.SimulateTransactionsResponse .CustomTypeAdapterFactory()); @@ -432,6 +664,15 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.web3_wallet.rest.model .SimulateTransactionsResponseDataBalanceChangesInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderResponseData + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.web3_wallet.rest.model.TagInfo .CustomTypeAdapterFactory()); diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/AddressPortfolioApi.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/AddressPortfolioApi.java new file mode 100644 index 0000000..ce77a4a --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/AddressPortfolioApi.java @@ -0,0 +1,2303 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.api; + +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.web3.common.ApiClient; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressPnLForSpecificTokenResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressPortfolioOverviewResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressRecentPnLResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetDexTradeHistoryResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetLeaderboardResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetPortfolioSupportedChainsResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetTrackedTradesResponse; +import com.binance.connector.client.web3_wallet.rest.model.OrderType; +import com.binance.connector.client.web3_wallet.rest.model.SortBy; +import com.binance.connector.client.web3_wallet.rest.model.TimeFrame; +import com.binance.connector.client.web3_wallet.rest.model.TrackerType; +import com.binance.connector.client.web3_wallet.rest.model.WalletType; +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 AddressPortfolioApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + private static final String USER_AGENT = + String.format( + "binance-web3-wallet/3.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private static final boolean HAS_TIME_UNIT = false; + + public AddressPortfolioApi(ClientConfiguration clientConfiguration) { + this(new ApiClient(clientConfiguration)); + } + + public AddressPortfolioApi(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; + } + + private okhttp3.Call getAddressPnLForSpecificTokenCall( + String binanceChainId, + String walletAddress, + String tokenContractAddress, + Long recvWindow, + String nonce) + 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 = "/api/v1/dex/market/portfolio/token/latest-pnl"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (walletAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("walletAddress", walletAddress)); + } + + if (tokenContractAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "tokenContractAddress", tokenContractAddress)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getAddressPnLForSpecificTokenValidateBeforeCall( + String binanceChainId, + String walletAddress, + String tokenContractAddress, + Long recvWindow, + String nonce) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + binanceChainId, walletAddress, tokenContractAddress, recvWindow, nonce + }; + Method method = + this.getClass() + .getMethod( + "getAddressPnLForSpecificToken", + String.class, + String.class, + String.class, + Long.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getAddressPnLForSpecificTokenCall( + binanceChainId, walletAddress, tokenContractAddress, recvWindow, nonce); + } 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()); + } + } + + public ApiResponse getAddressPnLForSpecificToken( + @NotNull String binanceChainId, + @NotNull String walletAddress, + @NotNull String tokenContractAddress, + Long recvWindow, + String nonce) + throws ApiException { + okhttp3.Call localVarCall = + getAddressPnLForSpecificTokenValidateBeforeCall( + binanceChainId, walletAddress, tokenContractAddress, recvWindow, nonce); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getAddressPnLForSpecificToken( + GetAddressPnLForSpecificTokenRequest request) { + return getAddressPnLForSpecificToken( + request.getBinanceChainId(), + request.getWalletAddress(), + request.getTokenContractAddress(), + request.getRecvWindow(), + request.getNonce()); + } + + public static class GetAddressPnLForSpecificTokenRequest { + private final String binanceChainId; + private final String walletAddress; + private final String tokenContractAddress; + private Long recvWindow; + private String nonce; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getWalletAddress() { + return walletAddress; + } + + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public GetAddressPnLForSpecificTokenRequest( + String binanceChainId, String walletAddress, String tokenContractAddress) { + this.binanceChainId = binanceChainId; + this.walletAddress = walletAddress; + this.tokenContractAddress = tokenContractAddress; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetAddressPnLForSpecificTokenRequest + */ + public GetAddressPnLForSpecificTokenRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetAddressPnLForSpecificTokenRequest + */ + public GetAddressPnLForSpecificTokenRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + } + + private okhttp3.Call getAddressPortfolioOverviewCall( + String binanceChainId, + String walletAddress, + TimeFrame timeFrame, + Long recvWindow, + String nonce) + 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 = "/api/v1/dex/market/portfolio/overview"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (walletAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("walletAddress", walletAddress)); + } + + if (timeFrame != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeFrame", timeFrame)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getAddressPortfolioOverviewValidateBeforeCall( + String binanceChainId, + String walletAddress, + TimeFrame timeFrame, + Long recvWindow, + String nonce) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + binanceChainId, walletAddress, timeFrame, recvWindow, nonce + }; + Method method = + this.getClass() + .getMethod( + "getAddressPortfolioOverview", + String.class, + String.class, + TimeFrame.class, + Long.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getAddressPortfolioOverviewCall( + binanceChainId, walletAddress, timeFrame, recvWindow, nonce); + } 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()); + } + } + + public ApiResponse getAddressPortfolioOverview( + @NotNull String binanceChainId, + @NotNull String walletAddress, + @NotNull TimeFrame timeFrame, + Long recvWindow, + String nonce) + throws ApiException { + okhttp3.Call localVarCall = + getAddressPortfolioOverviewValidateBeforeCall( + binanceChainId, walletAddress, timeFrame, recvWindow, nonce); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getAddressPortfolioOverview( + GetAddressPortfolioOverviewRequest request) { + return getAddressPortfolioOverview( + request.getBinanceChainId(), + request.getWalletAddress(), + request.getTimeFrame(), + request.getRecvWindow(), + request.getNonce()); + } + + public static class GetAddressPortfolioOverviewRequest { + private final String binanceChainId; + private final String walletAddress; + private final TimeFrame timeFrame; + private Long recvWindow; + private String nonce; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getWalletAddress() { + return walletAddress; + } + + public TimeFrame getTimeFrame() { + return timeFrame; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public GetAddressPortfolioOverviewRequest( + String binanceChainId, String walletAddress, TimeFrame timeFrame) { + this.binanceChainId = binanceChainId; + this.walletAddress = walletAddress; + this.timeFrame = timeFrame; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetAddressPortfolioOverviewRequest + */ + public GetAddressPortfolioOverviewRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetAddressPortfolioOverviewRequest + */ + public GetAddressPortfolioOverviewRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + } + + private okhttp3.Call getAddressRecentPnLCall( + String binanceChainId, + String walletAddress, + Long recvWindow, + String nonce, + String cursor, + String limit) + 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 = "/api/v1/dex/market/portfolio/recent-pnl"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (walletAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("walletAddress", walletAddress)); + } + + if (cursor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getAddressRecentPnLValidateBeforeCall( + String binanceChainId, + String walletAddress, + Long recvWindow, + String nonce, + String cursor, + String limit) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + binanceChainId, walletAddress, recvWindow, nonce, cursor, limit + }; + Method method = + this.getClass() + .getMethod( + "getAddressRecentPnL", + String.class, + String.class, + Long.class, + String.class, + String.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getAddressRecentPnLCall( + binanceChainId, walletAddress, recvWindow, nonce, cursor, limit); + } 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()); + } + } + + public ApiResponse getAddressRecentPnL( + @NotNull String binanceChainId, + @NotNull String walletAddress, + Long recvWindow, + String nonce, + String cursor, + String limit) + throws ApiException { + okhttp3.Call localVarCall = + getAddressRecentPnLValidateBeforeCall( + binanceChainId, walletAddress, recvWindow, nonce, cursor, limit); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getAddressRecentPnL( + GetAddressRecentPnLRequest request) { + return getAddressRecentPnL( + request.getBinanceChainId(), + request.getWalletAddress(), + request.getRecvWindow(), + request.getNonce(), + request.getCursor(), + request.getLimit()); + } + + public static class GetAddressRecentPnLRequest { + private final String binanceChainId; + private final String walletAddress; + private Long recvWindow; + private String nonce; + private String cursor; + private String limit; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getWalletAddress() { + return walletAddress; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getCursor() { + return cursor; + } + + public String getLimit() { + return limit; + } + + public GetAddressRecentPnLRequest(String binanceChainId, String walletAddress) { + this.binanceChainId = binanceChainId; + this.walletAddress = walletAddress; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetAddressRecentPnLRequest + */ + public GetAddressRecentPnLRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetAddressRecentPnLRequest + */ + public GetAddressRecentPnLRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set cursor + * + * @param cursor Pagination cursor. Omit or pass empty string for the first page; pass the + * cursor from the previous response to get the next page. (optional) + * @return GetAddressRecentPnLRequest + */ + public GetAddressRecentPnLRequest cursor(String cursor) { + this.cursor = cursor; + return this; + } + + /** + * Set limit + * + * @param limit Number of records per page. Default 20, max 100. (optional) + * @return GetAddressRecentPnLRequest + */ + public GetAddressRecentPnLRequest limit(String limit) { + this.limit = limit; + return this; + } + } + + private okhttp3.Call getDexTradeHistoryCall( + String binanceChainId, + String walletAddress, + Long recvWindow, + String nonce, + String begin, + String end, + String tokenContractAddress, + OrderType type, + String cursor, + String limit) + 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 = "/api/v1/dex/market/portfolio/dex-history"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (walletAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("walletAddress", walletAddress)); + } + + if (begin != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("begin", begin)); + } + + if (end != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end", end)); + } + + if (tokenContractAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "tokenContractAddress", tokenContractAddress)); + } + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (cursor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getDexTradeHistoryValidateBeforeCall( + String binanceChainId, + String walletAddress, + Long recvWindow, + String nonce, + String begin, + String end, + String tokenContractAddress, + OrderType type, + String cursor, + String limit) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + binanceChainId, + walletAddress, + recvWindow, + nonce, + begin, + end, + tokenContractAddress, + type, + cursor, + limit + }; + Method method = + this.getClass() + .getMethod( + "getDexTradeHistory", + String.class, + String.class, + Long.class, + String.class, + String.class, + String.class, + String.class, + OrderType.class, + String.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getDexTradeHistoryCall( + binanceChainId, + walletAddress, + recvWindow, + nonce, + begin, + end, + tokenContractAddress, + type, + cursor, + limit); + } 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()); + } + } + + public ApiResponse getDexTradeHistory( + @NotNull String binanceChainId, + @NotNull String walletAddress, + Long recvWindow, + String nonce, + String begin, + String end, + String tokenContractAddress, + OrderType type, + String cursor, + String limit) + throws ApiException { + okhttp3.Call localVarCall = + getDexTradeHistoryValidateBeforeCall( + binanceChainId, + walletAddress, + recvWindow, + nonce, + begin, + end, + tokenContractAddress, + type, + cursor, + limit); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getDexTradeHistory( + GetDexTradeHistoryRequest request) { + return getDexTradeHistory( + request.getBinanceChainId(), + request.getWalletAddress(), + request.getRecvWindow(), + request.getNonce(), + request.getBegin(), + request.getEnd(), + request.getTokenContractAddress(), + request.getType(), + request.getCursor(), + request.getLimit()); + } + + public static class GetDexTradeHistoryRequest { + private final String binanceChainId; + private final String walletAddress; + private Long recvWindow; + private String nonce; + private String begin; + private String end; + private String tokenContractAddress; + private OrderType type; + private String cursor; + private String limit; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getWalletAddress() { + return walletAddress; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getBegin() { + return begin; + } + + public String getEnd() { + return end; + } + + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public OrderType getType() { + return type; + } + + public String getCursor() { + return cursor; + } + + public String getLimit() { + return limit; + } + + public GetDexTradeHistoryRequest(String binanceChainId, String walletAddress) { + this.binanceChainId = binanceChainId; + this.walletAddress = walletAddress; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetDexTradeHistoryRequest + */ + public GetDexTradeHistoryRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetDexTradeHistoryRequest + */ + public GetDexTradeHistoryRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set begin + * + * @param begin Start timestamp (Unix milliseconds, inclusive). If both begin and end are + * omitted, no time filter is applied. (optional) + * @return GetDexTradeHistoryRequest + */ + public GetDexTradeHistoryRequest begin(String begin) { + this.begin = begin; + return this; + } + + /** + * Set end + * + * @param end End timestamp (Unix milliseconds, inclusive). If both begin and end are + * omitted, no time filter is applied. (optional) + * @return GetDexTradeHistoryRequest + */ + public GetDexTradeHistoryRequest end(String end) { + this.end = end; + return this; + } + + /** + * Set tokenContractAddress + * + * @param tokenContractAddress Filter by token contract address. Returns all tokens when + * omitted. (optional) + * @return GetDexTradeHistoryRequest + */ + public GetDexTradeHistoryRequest tokenContractAddress(String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Set type + * + * @param type Trade type filter. 1=Buy, 2=Sell. Omit to return all types. + * (optional) + * @return GetDexTradeHistoryRequest + */ + public GetDexTradeHistoryRequest type(OrderType type) { + this.type = type; + return this; + } + + /** + * Set cursor + * + * @param cursor Pagination cursor. Omit or pass empty string for the first page. (optional) + * @return GetDexTradeHistoryRequest + */ + public GetDexTradeHistoryRequest cursor(String cursor) { + this.cursor = cursor; + return this; + } + + /** + * Set limit + * + * @param limit Number of records per page. Default 20, max 100. (optional) + * @return GetDexTradeHistoryRequest + */ + public GetDexTradeHistoryRequest limit(String limit) { + this.limit = limit; + return this; + } + } + + private okhttp3.Call getLeaderboardCall( + String binanceChainId, + TimeFrame timeFrame, + SortBy sortBy, + Long recvWindow, + String nonce, + WalletType walletType, + String minRealizedPnlUsd, + String maxRealizedPnlUsd, + String minWinRatePercent, + String maxWinRatePercent, + String minTxs, + String maxTxs, + String minTxVolume, + String maxTxVolume, + String cursor, + String limit) + 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 = "/api/v1/dex/market/leaderboard/list"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (timeFrame != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeFrame", timeFrame)); + } + + if (sortBy != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sortBy", sortBy)); + } + + if (walletType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("walletType", walletType)); + } + + if (minRealizedPnlUsd != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("minRealizedPnlUsd", minRealizedPnlUsd)); + } + + if (maxRealizedPnlUsd != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("maxRealizedPnlUsd", maxRealizedPnlUsd)); + } + + if (minWinRatePercent != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("minWinRatePercent", minWinRatePercent)); + } + + if (maxWinRatePercent != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("maxWinRatePercent", maxWinRatePercent)); + } + + if (minTxs != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("minTxs", minTxs)); + } + + if (maxTxs != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxTxs", maxTxs)); + } + + if (minTxVolume != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("minTxVolume", minTxVolume)); + } + + if (maxTxVolume != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("maxTxVolume", maxTxVolume)); + } + + if (cursor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getLeaderboardValidateBeforeCall( + String binanceChainId, + TimeFrame timeFrame, + SortBy sortBy, + Long recvWindow, + String nonce, + WalletType walletType, + String minRealizedPnlUsd, + String maxRealizedPnlUsd, + String minWinRatePercent, + String maxWinRatePercent, + String minTxs, + String maxTxs, + String minTxVolume, + String maxTxVolume, + String cursor, + String limit) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + binanceChainId, + timeFrame, + sortBy, + recvWindow, + nonce, + walletType, + minRealizedPnlUsd, + maxRealizedPnlUsd, + minWinRatePercent, + maxWinRatePercent, + minTxs, + maxTxs, + minTxVolume, + maxTxVolume, + cursor, + limit + }; + Method method = + this.getClass() + .getMethod( + "getLeaderboard", + String.class, + TimeFrame.class, + SortBy.class, + Long.class, + String.class, + WalletType.class, + String.class, + String.class, + String.class, + String.class, + String.class, + String.class, + String.class, + String.class, + String.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getLeaderboardCall( + binanceChainId, + timeFrame, + sortBy, + recvWindow, + nonce, + walletType, + minRealizedPnlUsd, + maxRealizedPnlUsd, + minWinRatePercent, + maxWinRatePercent, + minTxs, + maxTxs, + minTxVolume, + maxTxVolume, + cursor, + limit); + } 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()); + } + } + + public ApiResponse getLeaderboard( + @NotNull String binanceChainId, + @NotNull TimeFrame timeFrame, + @NotNull SortBy sortBy, + Long recvWindow, + String nonce, + WalletType walletType, + String minRealizedPnlUsd, + String maxRealizedPnlUsd, + String minWinRatePercent, + String maxWinRatePercent, + String minTxs, + String maxTxs, + String minTxVolume, + String maxTxVolume, + String cursor, + String limit) + throws ApiException { + okhttp3.Call localVarCall = + getLeaderboardValidateBeforeCall( + binanceChainId, + timeFrame, + sortBy, + recvWindow, + nonce, + walletType, + minRealizedPnlUsd, + maxRealizedPnlUsd, + minWinRatePercent, + maxWinRatePercent, + minTxs, + maxTxs, + minTxVolume, + maxTxVolume, + cursor, + limit); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getLeaderboard(GetLeaderboardRequest request) { + return getLeaderboard( + request.getBinanceChainId(), + request.getTimeFrame(), + request.getSortBy(), + request.getRecvWindow(), + request.getNonce(), + request.getWalletType(), + request.getMinRealizedPnlUsd(), + request.getMaxRealizedPnlUsd(), + request.getMinWinRatePercent(), + request.getMaxWinRatePercent(), + request.getMinTxs(), + request.getMaxTxs(), + request.getMinTxVolume(), + request.getMaxTxVolume(), + request.getCursor(), + request.getLimit()); + } + + public static class GetLeaderboardRequest { + private final String binanceChainId; + private final TimeFrame timeFrame; + private final SortBy sortBy; + private Long recvWindow; + private String nonce; + private WalletType walletType; + private String minRealizedPnlUsd; + private String maxRealizedPnlUsd; + private String minWinRatePercent; + private String maxWinRatePercent; + private String minTxs; + private String maxTxs; + private String minTxVolume; + private String maxTxVolume; + private String cursor; + private String limit; + + public String getBinanceChainId() { + return binanceChainId; + } + + public TimeFrame getTimeFrame() { + return timeFrame; + } + + public SortBy getSortBy() { + return sortBy; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public WalletType getWalletType() { + return walletType; + } + + public String getMinRealizedPnlUsd() { + return minRealizedPnlUsd; + } + + public String getMaxRealizedPnlUsd() { + return maxRealizedPnlUsd; + } + + public String getMinWinRatePercent() { + return minWinRatePercent; + } + + public String getMaxWinRatePercent() { + return maxWinRatePercent; + } + + public String getMinTxs() { + return minTxs; + } + + public String getMaxTxs() { + return maxTxs; + } + + public String getMinTxVolume() { + return minTxVolume; + } + + public String getMaxTxVolume() { + return maxTxVolume; + } + + public String getCursor() { + return cursor; + } + + public String getLimit() { + return limit; + } + + public GetLeaderboardRequest(String binanceChainId, TimeFrame timeFrame, SortBy sortBy) { + this.binanceChainId = binanceChainId; + this.timeFrame = timeFrame; + this.sortBy = sortBy; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set walletType + * + * @param walletType Wallet type filter, single selection only. 1=Smart Money, + * 2=KOL, 3=Hot List. Returns all types when omitted. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest walletType(WalletType walletType) { + this.walletType = walletType; + return this; + } + + /** + * Set minRealizedPnlUsd + * + * @param minRealizedPnlUsd Minimum realized PnL filter, denominated in USD. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest minRealizedPnlUsd(String minRealizedPnlUsd) { + this.minRealizedPnlUsd = minRealizedPnlUsd; + return this; + } + + /** + * Set maxRealizedPnlUsd + * + * @param maxRealizedPnlUsd Maximum realized PnL filter, denominated in USD. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest maxRealizedPnlUsd(String maxRealizedPnlUsd) { + this.maxRealizedPnlUsd = maxRealizedPnlUsd; + return this; + } + + /** + * Set minWinRatePercent + * + * @param minWinRatePercent Minimum win rate filter, without percent sign. \"50\" + * means ≥50%. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest minWinRatePercent(String minWinRatePercent) { + this.minWinRatePercent = minWinRatePercent; + return this; + } + + /** + * Set maxWinRatePercent + * + * @param maxWinRatePercent Maximum win rate filter, without percent sign. \"90\" + * means ≤90%. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest maxWinRatePercent(String maxWinRatePercent) { + this.maxWinRatePercent = maxWinRatePercent; + return this; + } + + /** + * Set minTxs + * + * @param minTxs Minimum transaction count filter. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest minTxs(String minTxs) { + this.minTxs = minTxs; + return this; + } + + /** + * Set maxTxs + * + * @param maxTxs Maximum transaction count filter. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest maxTxs(String maxTxs) { + this.maxTxs = maxTxs; + return this; + } + + /** + * Set minTxVolume + * + * @param minTxVolume Minimum total transaction volume filter, denominated in USD. + * (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest minTxVolume(String minTxVolume) { + this.minTxVolume = minTxVolume; + return this; + } + + /** + * Set maxTxVolume + * + * @param maxTxVolume Maximum total transaction volume filter, denominated in USD. + * (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest maxTxVolume(String maxTxVolume) { + this.maxTxVolume = maxTxVolume; + return this; + } + + /** + * Set cursor + * + * @param cursor Pagination cursor. Omit or pass empty string for the first page. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest cursor(String cursor) { + this.cursor = cursor; + return this; + } + + /** + * Set limit + * + * @param limit Number of records per page. Default 50, max 50. (optional) + * @return GetLeaderboardRequest + */ + public GetLeaderboardRequest limit(String limit) { + this.limit = limit; + return this; + } + } + + private okhttp3.Call getPortfolioSupportedChainsCall(Long recvWindow, String nonce) + 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 = "/api/v1/dex/market/portfolio/supported/chain"; + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getPortfolioSupportedChainsValidateBeforeCall( + Long recvWindow, String nonce) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow, nonce}; + Method method = + this.getClass() + .getMethod("getPortfolioSupportedChains", Long.class, String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getPortfolioSupportedChainsCall(recvWindow, nonce); + } 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()); + } + } + + public ApiResponse getPortfolioSupportedChains( + Long recvWindow, String nonce) throws ApiException { + okhttp3.Call localVarCall = + getPortfolioSupportedChainsValidateBeforeCall(recvWindow, nonce); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getPortfolioSupportedChains( + GetPortfolioSupportedChainsRequest request) { + return getPortfolioSupportedChains(request.getRecvWindow(), request.getNonce()); + } + + public static class GetPortfolioSupportedChainsRequest { + private Long recvWindow; + private String nonce; + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public GetPortfolioSupportedChainsRequest() {} + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetPortfolioSupportedChainsRequest + */ + public GetPortfolioSupportedChainsRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetPortfolioSupportedChainsRequest + */ + public GetPortfolioSupportedChainsRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + } + + private okhttp3.Call getTrackedTradesCall( + TrackerType trackerType, + Long recvWindow, + String nonce, + String walletAddress, + String tradeType, + String binanceChainId, + String minVolume, + String maxVolume, + String minMarketCap, + String maxMarketCap, + Boolean isHideRiskToken, + Integer limit) + 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 = "/api/v1/dex/market/address-tracker/trades"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (trackerType != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("trackerType", trackerType)); + } + + if (walletAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("walletAddress", walletAddress)); + } + + if (tradeType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tradeType", tradeType)); + } + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (minVolume != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("minVolume", minVolume)); + } + + if (maxVolume != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxVolume", maxVolume)); + } + + if (minMarketCap != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("minMarketCap", minMarketCap)); + } + + if (maxMarketCap != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("maxMarketCap", maxMarketCap)); + } + + if (isHideRiskToken != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("isHideRiskToken", isHideRiskToken)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getTrackedTradesValidateBeforeCall( + TrackerType trackerType, + Long recvWindow, + String nonce, + String walletAddress, + String tradeType, + String binanceChainId, + String minVolume, + String maxVolume, + String minMarketCap, + String maxMarketCap, + Boolean isHideRiskToken, + Integer limit) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + trackerType, + recvWindow, + nonce, + walletAddress, + tradeType, + binanceChainId, + minVolume, + maxVolume, + minMarketCap, + maxMarketCap, + isHideRiskToken, + limit + }; + Method method = + this.getClass() + .getMethod( + "getTrackedTrades", + TrackerType.class, + Long.class, + String.class, + String.class, + String.class, + String.class, + String.class, + String.class, + String.class, + String.class, + Boolean.class, + Integer.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getTrackedTradesCall( + trackerType, + recvWindow, + nonce, + walletAddress, + tradeType, + binanceChainId, + minVolume, + maxVolume, + minMarketCap, + maxMarketCap, + isHideRiskToken, + limit); + } 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()); + } + } + + public ApiResponse getTrackedTrades( + @NotNull TrackerType trackerType, + Long recvWindow, + String nonce, + String walletAddress, + String tradeType, + String binanceChainId, + String minVolume, + String maxVolume, + String minMarketCap, + String maxMarketCap, + Boolean isHideRiskToken, + Integer limit) + throws ApiException { + okhttp3.Call localVarCall = + getTrackedTradesValidateBeforeCall( + trackerType, + recvWindow, + nonce, + walletAddress, + tradeType, + binanceChainId, + minVolume, + maxVolume, + minMarketCap, + maxMarketCap, + isHideRiskToken, + limit); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getTrackedTrades(GetTrackedTradesRequest request) { + return getTrackedTrades( + request.getTrackerType(), + request.getRecvWindow(), + request.getNonce(), + request.getWalletAddress(), + request.getTradeType(), + request.getBinanceChainId(), + request.getMinVolume(), + request.getMaxVolume(), + request.getMinMarketCap(), + request.getMaxMarketCap(), + request.getIsHideRiskToken(), + request.getLimit()); + } + + public static class GetTrackedTradesRequest { + private final TrackerType trackerType; + private Long recvWindow; + private String nonce; + private String walletAddress; + private String tradeType; + private String binanceChainId; + private String minVolume; + private String maxVolume; + private String minMarketCap; + private String maxMarketCap; + private Boolean isHideRiskToken; + private Integer limit; + + public TrackerType getTrackerType() { + return trackerType; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getWalletAddress() { + return walletAddress; + } + + public String getTradeType() { + return tradeType; + } + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getMinVolume() { + return minVolume; + } + + public String getMaxVolume() { + return maxVolume; + } + + public String getMinMarketCap() { + return minMarketCap; + } + + public String getMaxMarketCap() { + return maxMarketCap; + } + + public Boolean getIsHideRiskToken() { + return isHideRiskToken; + } + + public Integer getLimit() { + return limit; + } + + public GetTrackedTradesRequest(TrackerType trackerType) { + this.trackerType = trackerType; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set walletAddress + * + * @param walletAddress Required when trackerType=3. One or more wallet addresses, + * comma-separated, up to 20. EVM chains accept lowercase 42-character hex addresses; + * Solana accepts base58 addresses (case-sensitive). (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest walletAddress(String walletAddress) { + this.walletAddress = walletAddress; + return this; + } + + /** + * Set tradeType + * + * @param tradeType Trade type filter. 0=All (default), 1=Buy, 2=Sell, + * 3=Add position, 4=Reduce position, 5=Open position, 6=Close + * position, 7=Transfer in, 8=Transfer out. Multiple values comma-separated. + * (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest tradeType(String tradeType) { + this.tradeType = tradeType; + return this; + } + + /** + * Set binanceChainId + * + * @param binanceChainId Filter by chain. Returns all chains when omitted. (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest binanceChainId(String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Set minVolume + * + * @param minVolume Minimum trade volume filter, denominated in USD. (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest minVolume(String minVolume) { + this.minVolume = minVolume; + return this; + } + + /** + * Set maxVolume + * + * @param maxVolume Maximum trade volume filter, denominated in USD. (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest maxVolume(String maxVolume) { + this.maxVolume = maxVolume; + return this; + } + + /** + * Set minMarketCap + * + * @param minMarketCap Minimum market cap filter, denominated in USD. (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest minMarketCap(String minMarketCap) { + this.minMarketCap = minMarketCap; + return this; + } + + /** + * Set maxMarketCap + * + * @param maxMarketCap Maximum market cap filter, denominated in USD. (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest maxMarketCap(String maxMarketCap) { + this.maxMarketCap = maxMarketCap; + return this; + } + + /** + * Set isHideRiskToken + * + * @param isHideRiskToken Whether to hide risk tokens. true=hide risk tokens (default), + * false=show all tokens including risk tokens. (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest isHideRiskToken(Boolean isHideRiskToken) { + this.isHideRiskToken = isHideRiskToken; + return this; + } + + /** + * Set limit + * + * @param limit Maximum number of trades to return. Effective only for trackerType=3 + * (custom address list); trackerType=1/2 ignore this and use the downstream public + * query fixed cap. Omit to use the downstream default. (optional) + * @return GetTrackedTradesRequest + */ + public GetTrackedTradesRequest limit(Integer limit) { + this.limit = limit; + return this; + } + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/MarketApi.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/GeneralDataApi.java similarity index 94% rename from clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/MarketApi.java rename to clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/GeneralDataApi.java index c9509ab..2376b3c 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/MarketApi.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/GeneralDataApi.java @@ -26,6 +26,7 @@ import com.binance.connector.client.web3_wallet.rest.model.GetSupportedChainsResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenAdvancedInfoResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenBasicInfoResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetTokenDevInfoResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenPriceResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenTradesResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenTradingInfoResponse; @@ -50,22 +51,22 @@ import java.util.Set; import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; -public class MarketApi { +public class GeneralDataApi { private ApiClient localVarApiClient; private int localHostIndex; private String localCustomBaseUrl; private static final String USER_AGENT = String.format( - "binance-web3-wallet/2.0.0 (Java/%s; %s; %s)", + "binance-web3-wallet/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; - public MarketApi(ClientConfiguration clientConfiguration) { + public GeneralDataApi(ClientConfiguration clientConfiguration) { this(new ApiClient(clientConfiguration)); } - public MarketApi(ApiClient apiClient) { + public GeneralDataApi(ApiClient apiClient) { apiClient.setUserAgent(USER_AGENT); this.localVarApiClient = apiClient; } @@ -229,7 +230,7 @@ private okhttp3.Call getCandlesValidateBeforeCall( Long.class, Long.class, Integer.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -527,7 +528,7 @@ private okhttp3.Call getHoldersRankingValidateBeforeCall( Long.class, String.class, TagFilter.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -642,9 +643,9 @@ public GetHoldersRankingRequest tagFilter(TagFilter tagFilter) { } private okhttp3.Call getHotTokenListCall( + String binanceChainId, Long recvWindow, String nonce, - String binanceChainId, RankBy rankBy, RankingTimeFrame rankingTimeFrame, String priceChangePercentMin, @@ -1040,9 +1041,9 @@ private okhttp3.Call getHotTokenListCall( @SuppressWarnings("rawtypes") private okhttp3.Call getHotTokenListValidateBeforeCall( + String binanceChainId, Long recvWindow, String nonce, - String binanceChainId, RankBy rankBy, RankingTimeFrame rankingTimeFrame, String priceChangePercentMin, @@ -1105,9 +1106,9 @@ private okhttp3.Call getHotTokenListValidateBeforeCall( ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = { + binanceChainId, recvWindow, nonce, - binanceChainId, rankBy, rankingTimeFrame, priceChangePercentMin, @@ -1164,8 +1165,8 @@ private okhttp3.Call getHotTokenListValidateBeforeCall( this.getClass() .getMethod( "getHotTokenList", - Long.class, String.class, + Long.class, String.class, RankBy.class, RankingTimeFrame.class, @@ -1218,14 +1219,14 @@ private okhttp3.Call getHotTokenListValidateBeforeCall( Boolean.class, Integer.class, Integer.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { return getHotTokenListCall( + binanceChainId, recvWindow, nonce, - binanceChainId, rankBy, rankingTimeFrame, priceChangePercentMin, @@ -1290,9 +1291,9 @@ private okhttp3.Call getHotTokenListValidateBeforeCall( } public ApiResponse getHotTokenList( + @NotNull String binanceChainId, Long recvWindow, String nonce, - String binanceChainId, RankBy rankBy, RankingTimeFrame rankingTimeFrame, String priceChangePercentMin, @@ -1347,9 +1348,9 @@ public ApiResponse getHotTokenList( throws ApiException { okhttp3.Call localVarCall = getHotTokenListValidateBeforeCall( + binanceChainId, recvWindow, nonce, - binanceChainId, rankBy, rankingTimeFrame, priceChangePercentMin, @@ -1408,9 +1409,9 @@ public ApiResponse getHotTokenList( public ApiResponse getHotTokenList(GetHotTokenListRequest request) { return getHotTokenList( + request.getBinanceChainId(), request.getRecvWindow(), request.getNonce(), - request.getBinanceChainId(), request.getRankBy(), request.getRankingTimeFrame(), request.getPriceChangePercentMin(), @@ -1465,9 +1466,9 @@ public ApiResponse getHotTokenList(GetHotTokenListReque } public static class GetHotTokenListRequest { + private final String binanceChainId; private Long recvWindow; private String nonce; - private String binanceChainId; private RankBy rankBy; private RankingTimeFrame rankingTimeFrame; private String priceChangePercentMin; @@ -1520,6 +1521,10 @@ public static class GetHotTokenListRequest { private Integer pageId; private Integer size; + public String getBinanceChainId() { + return binanceChainId; + } + public Long getRecvWindow() { return recvWindow; } @@ -1528,10 +1533,6 @@ public String getNonce() { return nonce; } - public String getBinanceChainId() { - return binanceChainId; - } - public RankBy getRankBy() { return rankBy; } @@ -1736,7 +1737,9 @@ public Integer getSize() { return size; } - public GetHotTokenListRequest() {} + public GetHotTokenListRequest(String binanceChainId) { + this.binanceChainId = binanceChainId; + } /** * Set recvWindow @@ -1762,18 +1765,6 @@ public GetHotTokenListRequest nonce(String nonce) { return this; } - /** - * Set binanceChainId - * - * @param binanceChainId Chain identifier. Single value only. Omit to return mixed results - * across all chains. (optional) - * @return GetHotTokenListRequest - */ - public GetHotTokenListRequest binanceChainId(String binanceChainId) { - this.binanceChainId = binanceChainId; - return this; - } - /** * Set rankBy * @@ -2456,7 +2447,7 @@ private okhttp3.Call getSupportedChainsValidateBeforeCall(Long recvWindow, Strin Object[] parameterValues = {recvWindow, nonce}; Method method = this.getClass().getMethod("getSupportedChains", Long.class, String.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -2624,7 +2615,7 @@ private okhttp3.Call getTokenAdvancedInfoValidateBeforeCall( String.class, Long.class, String.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -2816,7 +2807,7 @@ private okhttp3.Call getTokenBasicInfoValidateBeforeCall( String.class, Long.class, String.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -2909,6 +2900,196 @@ public GetTokenBasicInfoRequest nonce(String nonce) { } } + private okhttp3.Call getTokenDevInfoCall( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + 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 = "/api/v1/dex/market/memepump/tokenDevInfo"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (tokenContractAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "tokenContractAddress", tokenContractAddress)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getTokenDevInfoValidateBeforeCall( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {binanceChainId, tokenContractAddress, recvWindow, nonce}; + Method method = + this.getClass() + .getMethod( + "getTokenDevInfo", + String.class, + String.class, + Long.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getTokenDevInfoCall(binanceChainId, tokenContractAddress, recvWindow, nonce); + } 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()); + } + } + + public ApiResponse getTokenDevInfo( + @NotNull String binanceChainId, + @NotNull String tokenContractAddress, + Long recvWindow, + String nonce) + throws ApiException { + okhttp3.Call localVarCall = + getTokenDevInfoValidateBeforeCall( + binanceChainId, tokenContractAddress, recvWindow, nonce); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getTokenDevInfo(GetTokenDevInfoRequest request) { + return getTokenDevInfo( + request.getBinanceChainId(), + request.getTokenContractAddress(), + request.getRecvWindow(), + request.getNonce()); + } + + public static class GetTokenDevInfoRequest { + private final String binanceChainId; + private final String tokenContractAddress; + private Long recvWindow; + private String nonce; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public GetTokenDevInfoRequest(String binanceChainId, String tokenContractAddress) { + this.binanceChainId = binanceChainId; + this.tokenContractAddress = tokenContractAddress; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetTokenDevInfoRequest + */ + public GetTokenDevInfoRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetTokenDevInfoRequest + */ + public GetTokenDevInfoRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + } + private okhttp3.Call getTokenPriceCall(Long recvWindow, String nonce) throws ApiException { String basePath = null; // Operation Servers @@ -2987,7 +3168,7 @@ private okhttp3.Call getTokenPriceValidateBeforeCall(Long recvWindow, String non Object[] parameterValues = {recvWindow, nonce}; Method method = this.getClass().getMethod("getTokenPrice", Long.class, String.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -3198,7 +3379,7 @@ private okhttp3.Call getTokenTradesValidateBeforeCall( Integer.class, TagFilter.class, String.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -3462,7 +3643,7 @@ private okhttp3.Call getTokenTradingInfoValidateBeforeCall(Long recvWindow, Stri Object[] parameterValues = {recvWindow, nonce}; Method method = this.getClass().getMethod("getTokenTradingInfo", Long.class, String.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -3630,7 +3811,7 @@ private okhttp3.Call getTopLiquidityPoolsValidateBeforeCall( String.class, Long.class, String.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -3837,7 +4018,7 @@ private okhttp3.Call getTopTradersValidateBeforeCall( Long.class, String.class, TagFilter.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { @@ -4044,7 +4225,7 @@ private okhttp3.Call searchTokenValidateBeforeCall( String.class, Long.class, String.class); - Set> violations = + Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/RwaDataApi.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/RwaDataApi.java new file mode 100644 index 0000000..dd9271e --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/RwaDataApi.java @@ -0,0 +1,1282 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.api; + +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.web3.common.ApiClient; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenIssuancePlatformsResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenListResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenPriceResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaUnderlyingInfoResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaUnderlyingMarketDataResponse; +import com.binance.connector.client.web3_wallet.rest.model.PlatformId; +import com.binance.connector.client.web3_wallet.rest.model.SearchRwaTokenResponse; +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 RwaDataApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + private static final String USER_AGENT = + String.format( + "binance-web3-wallet/3.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private static final boolean HAS_TIME_UNIT = false; + + public RwaDataApi(ClientConfiguration clientConfiguration) { + this(new ApiClient(clientConfiguration)); + } + + public RwaDataApi(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; + } + + private okhttp3.Call getRwaTokenIssuancePlatformsCall( + Long recvWindow, String nonce, PlatformId platformId) 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 = "/api/v1/dex/market/rwa/platforms"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (platformId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("platformId", platformId)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getRwaTokenIssuancePlatformsValidateBeforeCall( + Long recvWindow, String nonce, PlatformId platformId) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow, nonce, platformId}; + Method method = + this.getClass() + .getMethod( + "getRwaTokenIssuancePlatforms", + Long.class, + String.class, + PlatformId.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getRwaTokenIssuancePlatformsCall(recvWindow, nonce, platformId); + } 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()); + } + } + + public ApiResponse getRwaTokenIssuancePlatforms( + Long recvWindow, String nonce, PlatformId platformId) throws ApiException { + okhttp3.Call localVarCall = + getRwaTokenIssuancePlatformsValidateBeforeCall(recvWindow, nonce, platformId); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getRwaTokenIssuancePlatforms( + GetRwaTokenIssuancePlatformsRequest request) { + return getRwaTokenIssuancePlatforms( + request.getRecvWindow(), request.getNonce(), request.getPlatformId()); + } + + public static class GetRwaTokenIssuancePlatformsRequest { + private Long recvWindow; + private String nonce; + private PlatformId platformId; + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public PlatformId getPlatformId() { + return platformId; + } + + public GetRwaTokenIssuancePlatformsRequest() {} + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. + * (optional) + * @return GetRwaTokenIssuancePlatformsRequest + */ + public GetRwaTokenIssuancePlatformsRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return GetRwaTokenIssuancePlatformsRequest + */ + public GetRwaTokenIssuancePlatformsRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set platformId + * + * @param platformId Platform identifier (ondo=Ondo Finance, bstock=bStocks). + * Optional. If not specified, returns all platforms; when specified, returns only that + * platform. (optional) + * @return GetRwaTokenIssuancePlatformsRequest + */ + public GetRwaTokenIssuancePlatformsRequest platformId(PlatformId platformId) { + this.platformId = platformId; + return this; + } + } + + private okhttp3.Call getRwaTokenListCall( + Long recvWindow, + String nonce, + String binanceChainId, + PlatformId platformId, + Integer tabId) + 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 = "/api/v1/dex/market/rwa/tokens"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (platformId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("platformId", platformId)); + } + + if (tabId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tabId", tabId)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getRwaTokenListValidateBeforeCall( + Long recvWindow, + String nonce, + String binanceChainId, + PlatformId platformId, + Integer tabId) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow, nonce, binanceChainId, platformId, tabId}; + Method method = + this.getClass() + .getMethod( + "getRwaTokenList", + Long.class, + String.class, + String.class, + PlatformId.class, + Integer.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getRwaTokenListCall(recvWindow, nonce, binanceChainId, platformId, tabId); + } 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()); + } + } + + public ApiResponse getRwaTokenList( + Long recvWindow, + String nonce, + String binanceChainId, + PlatformId platformId, + Integer tabId) + throws ApiException { + okhttp3.Call localVarCall = + getRwaTokenListValidateBeforeCall( + recvWindow, nonce, binanceChainId, platformId, tabId); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getRwaTokenList(GetRwaTokenListRequest request) { + return getRwaTokenList( + request.getRecvWindow(), + request.getNonce(), + request.getBinanceChainId(), + request.getPlatformId(), + request.getTabId()); + } + + public static class GetRwaTokenListRequest { + private Long recvWindow; + private String nonce; + private String binanceChainId; + private PlatformId platformId; + private Integer tabId; + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getBinanceChainId() { + return binanceChainId; + } + + public PlatformId getPlatformId() { + return platformId; + } + + public Integer getTabId() { + return tabId; + } + + public GetRwaTokenListRequest() {} + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. + * (optional) + * @return GetRwaTokenListRequest + */ + public GetRwaTokenListRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return GetRwaTokenListRequest + */ + public GetRwaTokenListRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set binanceChainId + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). Optional. If not + * specified, returns data from all chains. (optional) + * @return GetRwaTokenListRequest + */ + public GetRwaTokenListRequest binanceChainId(String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Set platformId + * + * @param platformId Platform filter (ondo=Ondo Finance, bstock=bStocks). + * Optional. If not specified, returns all platforms. (optional) + * @return GetRwaTokenListRequest + */ + public GetRwaTokenListRequest platformId(PlatformId platformId) { + this.platformId = platformId; + return this; + } + + /** + * Set tabId + * + * @param tabId Sector tab filter. Optional. If not specified, returns all sectors. Enum: + * 1=Serenity Call, 2=SpaceX (SpaceX-related and commercial spaceflight + * concept stocks), 3=Upcoming Earnings, 4=AI Chips, 5=Storage, + * 6=Energy, 7=Precious Metals, 8=China ADR (Chinese companies listed in + * the US), 9=Magnificent 7 (the seven largest US tech giants: Apple, Microsoft, + * Alphabet, Amazon, Nvidia, Meta, Tesla), 10=Crypto, 11=ETF, 12=Tech + * Leaders, 13=Buffett Portfolio. (optional) + * @return GetRwaTokenListRequest + */ + public GetRwaTokenListRequest tabId(Integer tabId) { + this.tabId = tabId; + return this; + } + } + + private okhttp3.Call getRwaTokenPriceCall( + String binanceChainId, String tokenContractAddresses, Long recvWindow, String nonce) + 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 = "/api/v1/dex/market/rwa/price"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (tokenContractAddresses != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "tokenContractAddresses", tokenContractAddresses)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getRwaTokenPriceValidateBeforeCall( + String binanceChainId, String tokenContractAddresses, Long recvWindow, String nonce) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {binanceChainId, tokenContractAddresses, recvWindow, nonce}; + Method method = + this.getClass() + .getMethod( + "getRwaTokenPrice", + String.class, + String.class, + Long.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getRwaTokenPriceCall( + binanceChainId, tokenContractAddresses, recvWindow, nonce); + } 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()); + } + } + + public ApiResponse getRwaTokenPrice( + @NotNull String binanceChainId, + @NotNull String tokenContractAddresses, + Long recvWindow, + String nonce) + throws ApiException { + okhttp3.Call localVarCall = + getRwaTokenPriceValidateBeforeCall( + binanceChainId, tokenContractAddresses, recvWindow, nonce); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getRwaTokenPrice(GetRwaTokenPriceRequest request) { + return getRwaTokenPrice( + request.getBinanceChainId(), + request.getTokenContractAddresses(), + request.getRecvWindow(), + request.getNonce()); + } + + public static class GetRwaTokenPriceRequest { + private final String binanceChainId; + private final String tokenContractAddresses; + private Long recvWindow; + private String nonce; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getTokenContractAddresses() { + return tokenContractAddresses; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public GetRwaTokenPriceRequest(String binanceChainId, String tokenContractAddresses) { + this.binanceChainId = binanceChainId; + this.tokenContractAddresses = tokenContractAddresses; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. + * (optional) + * @return GetRwaTokenPriceRequest + */ + public GetRwaTokenPriceRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return GetRwaTokenPriceRequest + */ + public GetRwaTokenPriceRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + } + + private okhttp3.Call getRwaUnderlyingInfoCall( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + 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 = "/api/v1/dex/market/rwa/underlying-profile"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (tokenContractAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "tokenContractAddress", tokenContractAddress)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getRwaUnderlyingInfoValidateBeforeCall( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {binanceChainId, tokenContractAddress, recvWindow, nonce}; + Method method = + this.getClass() + .getMethod( + "getRwaUnderlyingInfo", + String.class, + String.class, + Long.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getRwaUnderlyingInfoCall( + binanceChainId, tokenContractAddress, recvWindow, nonce); + } 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()); + } + } + + public ApiResponse getRwaUnderlyingInfo( + @NotNull String binanceChainId, + @NotNull String tokenContractAddress, + Long recvWindow, + String nonce) + throws ApiException { + okhttp3.Call localVarCall = + getRwaUnderlyingInfoValidateBeforeCall( + binanceChainId, tokenContractAddress, recvWindow, nonce); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getRwaUnderlyingInfo( + GetRwaUnderlyingInfoRequest request) { + return getRwaUnderlyingInfo( + request.getBinanceChainId(), + request.getTokenContractAddress(), + request.getRecvWindow(), + request.getNonce()); + } + + public static class GetRwaUnderlyingInfoRequest { + private final String binanceChainId; + private final String tokenContractAddress; + private Long recvWindow; + private String nonce; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public GetRwaUnderlyingInfoRequest(String binanceChainId, String tokenContractAddress) { + this.binanceChainId = binanceChainId; + this.tokenContractAddress = tokenContractAddress; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. + * (optional) + * @return GetRwaUnderlyingInfoRequest + */ + public GetRwaUnderlyingInfoRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return GetRwaUnderlyingInfoRequest + */ + public GetRwaUnderlyingInfoRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + } + + private okhttp3.Call getRwaUnderlyingMarketDataCall( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + 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 = "/api/v1/dex/market/rwa/underlying-market"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (tokenContractAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "tokenContractAddress", tokenContractAddress)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getRwaUnderlyingMarketDataValidateBeforeCall( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {binanceChainId, tokenContractAddress, recvWindow, nonce}; + Method method = + this.getClass() + .getMethod( + "getRwaUnderlyingMarketData", + String.class, + String.class, + Long.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getRwaUnderlyingMarketDataCall( + binanceChainId, tokenContractAddress, recvWindow, nonce); + } 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()); + } + } + + public ApiResponse getRwaUnderlyingMarketData( + @NotNull String binanceChainId, + @NotNull String tokenContractAddress, + Long recvWindow, + String nonce) + throws ApiException { + okhttp3.Call localVarCall = + getRwaUnderlyingMarketDataValidateBeforeCall( + binanceChainId, tokenContractAddress, recvWindow, nonce); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getRwaUnderlyingMarketData( + GetRwaUnderlyingMarketDataRequest request) { + return getRwaUnderlyingMarketData( + request.getBinanceChainId(), + request.getTokenContractAddress(), + request.getRecvWindow(), + request.getNonce()); + } + + public static class GetRwaUnderlyingMarketDataRequest { + private final String binanceChainId; + private final String tokenContractAddress; + private Long recvWindow; + private String nonce; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public GetRwaUnderlyingMarketDataRequest( + String binanceChainId, String tokenContractAddress) { + this.binanceChainId = binanceChainId; + this.tokenContractAddress = tokenContractAddress; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. + * (optional) + * @return GetRwaUnderlyingMarketDataRequest + */ + public GetRwaUnderlyingMarketDataRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return GetRwaUnderlyingMarketDataRequest + */ + public GetRwaUnderlyingMarketDataRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + } + + private okhttp3.Call searchRwaTokenCall( + String keyword, Long recvWindow, String nonce, PlatformId platformId) + 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 = "/api/v1/dex/market/rwa/search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (keyword != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("keyword", keyword)); + } + + if (platformId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("platformId", platformId)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 searchRwaTokenValidateBeforeCall( + String keyword, Long recvWindow, String nonce, PlatformId platformId) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {keyword, recvWindow, nonce, platformId}; + Method method = + this.getClass() + .getMethod( + "searchRwaToken", + String.class, + Long.class, + String.class, + PlatformId.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return searchRwaTokenCall(keyword, recvWindow, nonce, platformId); + } 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()); + } + } + + public ApiResponse searchRwaToken( + @NotNull String keyword, Long recvWindow, String nonce, PlatformId platformId) + throws ApiException { + okhttp3.Call localVarCall = + searchRwaTokenValidateBeforeCall(keyword, recvWindow, nonce, platformId); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse searchRwaToken(SearchRwaTokenRequest request) { + return searchRwaToken( + request.getKeyword(), + request.getRecvWindow(), + request.getNonce(), + request.getPlatformId()); + } + + public static class SearchRwaTokenRequest { + private final String keyword; + private Long recvWindow; + private String nonce; + private PlatformId platformId; + + public String getKeyword() { + return keyword; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public PlatformId getPlatformId() { + return platformId; + } + + public SearchRwaTokenRequest(String keyword) { + this.keyword = keyword; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. + * (optional) + * @return SearchRwaTokenRequest + */ + public SearchRwaTokenRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return SearchRwaTokenRequest + */ + public SearchRwaTokenRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set platformId + * + * @param platformId Platform filter (ondo=Ondo Finance, bstock=bStocks). + * Optional. If not specified, returns results from all platforms. (optional) + * @return SearchRwaTokenRequest + */ + public SearchRwaTokenRequest platformId(PlatformId platformId) { + this.platformId = platformId; + return this; + } + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/TradingApi.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/TradingApi.java index 51d83c3..92ca0e6 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/TradingApi.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/TradingApi.java @@ -21,14 +21,22 @@ import com.binance.connector.client.web3.common.ApiClient; import com.binance.connector.client.web3_wallet.rest.model.ApproveTransaction; import com.binance.connector.client.web3_wallet.rest.model.AutoSlippage; +import com.binance.connector.client.web3_wallet.rest.model.BinanceChainId; +import com.binance.connector.client.web3_wallet.rest.model.BuildSolanaSwapInstructionsResponse; import com.binance.connector.client.web3_wallet.rest.model.BuildSwapTransactionResponse; import com.binance.connector.client.web3_wallet.rest.model.GasLevel; import com.binance.connector.client.web3_wallet.rest.model.GetAggregatedQuoteResponse; import com.binance.connector.client.web3_wallet.rest.model.GetAggregatorSupportedChainsResponse; import com.binance.connector.client.web3_wallet.rest.model.GetErc20ApproveTransactionResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRfqOrderStatusResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTransactionStatusResponse; +import com.binance.connector.client.web3_wallet.rest.model.QuoteAndBuildSwapTransactionResponse; +import com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderRequest; +import com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderResponse; +import com.binance.connector.client.web3_wallet.rest.model.Vendor; 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.*; @@ -49,7 +57,7 @@ public class TradingApi { private static final String USER_AGENT = String.format( - "binance-web3-wallet/2.0.0 (Java/%s; %s; %s)", + "binance-web3-wallet/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -86,8 +94,8 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } - private okhttp3.Call buildSwapTransactionCall( - String binanceChainId, + private okhttp3.Call buildSolanaSwapInstructionsCall( + BinanceChainId binanceChainId, String amount, String fromTokenAddress, String toTokenAddress, @@ -96,15 +104,12 @@ private okhttp3.Call buildSwapTransactionCall( String quoteId, Long recvWindow, String nonce, - ApproveTransaction approveTransaction, - String approveAmount, - String gasLimit, - GasLevel gasLevel, String priceImpactProtectionPercent, AutoSlippage autoSlippage, String maxAutoSlippagePercent, String computeUnitLimit, String computeUnitPrice, + GasLevel gasLevel, String tips) throws ApiException { String basePath = null; @@ -123,7 +128,7 @@ private okhttp3.Call buildSwapTransactionCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v1/dex/aggregator/swap"; + String localVarPath = "/api/v1/dex/aggregator/swap-instruction"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -164,24 +169,6 @@ private okhttp3.Call buildSwapTransactionCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("quoteId", quoteId)); } - if (approveTransaction != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("approveTransaction", approveTransaction)); - } - - if (approveAmount != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("approveAmount", approveAmount)); - } - - if (gasLimit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("gasLimit", gasLimit)); - } - - if (gasLevel != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("gasLevel", gasLevel)); - } - if (priceImpactProtectionPercent != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair( @@ -209,6 +196,10 @@ private okhttp3.Call buildSwapTransactionCall( localVarApiClient.parameterToPair("computeUnitPrice", computeUnitPrice)); } + if (gasLevel != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gasLevel", gasLevel)); + } + if (tips != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("tips", tips)); } @@ -253,8 +244,8 @@ private okhttp3.Call buildSwapTransactionCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call buildSwapTransactionValidateBeforeCall( - String binanceChainId, + private okhttp3.Call buildSolanaSwapInstructionsValidateBeforeCall( + BinanceChainId binanceChainId, String amount, String fromTokenAddress, String toTokenAddress, @@ -263,15 +254,12 @@ private okhttp3.Call buildSwapTransactionValidateBeforeCall( String quoteId, Long recvWindow, String nonce, - ApproveTransaction approveTransaction, - String approveAmount, - String gasLimit, - GasLevel gasLevel, String priceImpactProtectionPercent, AutoSlippage autoSlippage, String maxAutoSlippagePercent, String computeUnitLimit, String computeUnitPrice, + GasLevel gasLevel, String tips) throws ApiException { try { @@ -293,22 +281,19 @@ private okhttp3.Call buildSwapTransactionValidateBeforeCall( quoteId, recvWindow, nonce, - approveTransaction, - approveAmount, - gasLimit, - gasLevel, priceImpactProtectionPercent, autoSlippage, maxAutoSlippagePercent, computeUnitLimit, computeUnitPrice, + gasLevel, tips }; Method method = this.getClass() .getMethod( - "buildSwapTransaction", - String.class, + "buildSolanaSwapInstructions", + BinanceChainId.class, String.class, String.class, String.class, @@ -317,21 +302,18 @@ private okhttp3.Call buildSwapTransactionValidateBeforeCall( String.class, Long.class, String.class, - ApproveTransaction.class, - String.class, - String.class, - GasLevel.class, String.class, AutoSlippage.class, String.class, String.class, String.class, + GasLevel.class, String.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return buildSwapTransactionCall( + return buildSolanaSwapInstructionsCall( binanceChainId, amount, fromTokenAddress, @@ -341,15 +323,12 @@ private okhttp3.Call buildSwapTransactionValidateBeforeCall( quoteId, recvWindow, nonce, - approveTransaction, - approveAmount, - gasLimit, - gasLevel, priceImpactProtectionPercent, autoSlippage, maxAutoSlippagePercent, computeUnitLimit, computeUnitPrice, + gasLevel, tips); } else { throw new ConstraintViolationException((Set) violations); @@ -363,8 +342,8 @@ private okhttp3.Call buildSwapTransactionValidateBeforeCall( } } - public ApiResponse buildSwapTransaction( - @NotNull String binanceChainId, + public ApiResponse buildSolanaSwapInstructions( + @NotNull BinanceChainId binanceChainId, @NotNull String amount, @NotNull String fromTokenAddress, @NotNull String toTokenAddress, @@ -373,19 +352,16 @@ public ApiResponse buildSwapTransaction( @NotNull String quoteId, Long recvWindow, String nonce, - ApproveTransaction approveTransaction, - String approveAmount, - String gasLimit, - GasLevel gasLevel, String priceImpactProtectionPercent, AutoSlippage autoSlippage, String maxAutoSlippagePercent, String computeUnitLimit, String computeUnitPrice, + GasLevel gasLevel, String tips) throws ApiException { okhttp3.Call localVarCall = - buildSwapTransactionValidateBeforeCall( + buildSolanaSwapInstructionsValidateBeforeCall( binanceChainId, amount, fromTokenAddress, @@ -395,24 +371,21 @@ public ApiResponse buildSwapTransaction( quoteId, recvWindow, nonce, - approveTransaction, - approveAmount, - gasLimit, - gasLevel, priceImpactProtectionPercent, autoSlippage, maxAutoSlippagePercent, computeUnitLimit, computeUnitPrice, + gasLevel, tips); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - public ApiResponse buildSwapTransaction( - BuildSwapTransactionRequest request) { - return buildSwapTransaction( + public ApiResponse buildSolanaSwapInstructions( + BuildSolanaSwapInstructionsRequest request) { + return buildSolanaSwapInstructions( request.getBinanceChainId(), request.getAmount(), request.getFromTokenAddress(), @@ -422,20 +395,17 @@ public ApiResponse buildSwapTransaction( request.getQuoteId(), request.getRecvWindow(), request.getNonce(), - request.getApproveTransaction(), - request.getApproveAmount(), - request.getGasLimit(), - request.getGasLevel(), request.getPriceImpactProtectionPercent(), request.getAutoSlippage(), request.getMaxAutoSlippagePercent(), request.getComputeUnitLimit(), request.getComputeUnitPrice(), + request.getGasLevel(), request.getTips()); } - public static class BuildSwapTransactionRequest { - private final String binanceChainId; + public static class BuildSolanaSwapInstructionsRequest { + private final BinanceChainId binanceChainId; private final String amount; private final String fromTokenAddress; private final String toTokenAddress; @@ -444,18 +414,15 @@ public static class BuildSwapTransactionRequest { private final String quoteId; private Long recvWindow; private String nonce; - private ApproveTransaction approveTransaction; - private String approveAmount; - private String gasLimit; - private GasLevel gasLevel; private String priceImpactProtectionPercent; private AutoSlippage autoSlippage; private String maxAutoSlippagePercent; private String computeUnitLimit; private String computeUnitPrice; + private GasLevel gasLevel; private String tips; - public String getBinanceChainId() { + public BinanceChainId getBinanceChainId() { return binanceChainId; } @@ -491,22 +458,6 @@ public String getNonce() { return nonce; } - public ApproveTransaction getApproveTransaction() { - return approveTransaction; - } - - public String getApproveAmount() { - return approveAmount; - } - - public String getGasLimit() { - return gasLimit; - } - - public GasLevel getGasLevel() { - return gasLevel; - } - public String getPriceImpactProtectionPercent() { return priceImpactProtectionPercent; } @@ -527,12 +478,16 @@ public String getComputeUnitPrice() { return computeUnitPrice; } + public GasLevel getGasLevel() { + return gasLevel; + } + public String getTips() { return tips; } - public BuildSwapTransactionRequest( - String binanceChainId, + public BuildSolanaSwapInstructionsRequest( + BinanceChainId binanceChainId, String amount, String fromTokenAddress, String toTokenAddress, @@ -553,9 +508,9 @@ public BuildSwapTransactionRequest( * * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). * (optional) - * @return BuildSwapTransactionRequest + * @return BuildSolanaSwapInstructionsRequest */ - public BuildSwapTransactionRequest recvWindow(Long recvWindow) { + public BuildSolanaSwapInstructionsRequest recvWindow(Long recvWindow) { this.recvWindow = recvWindow; return this; } @@ -565,69 +520,21 @@ public BuildSwapTransactionRequest recvWindow(Long recvWindow) { * * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if * omitted. (optional) - * @return BuildSwapTransactionRequest + * @return BuildSolanaSwapInstructionsRequest */ - public BuildSwapTransactionRequest nonce(String nonce) { + public BuildSolanaSwapInstructionsRequest nonce(String nonce) { this.nonce = nonce; return this; } - /** - * Set approveTransaction - * - * @param approveTransaction When \"true\", `signatureData` includes the - * spender address and approve calldata so the client can submit it before the swap. - * Defaults to false. (optional) - * @return BuildSwapTransactionRequest - */ - public BuildSwapTransactionRequest approveTransaction( - ApproveTransaction approveTransaction) { - this.approveTransaction = approveTransaction; - return this; - } - - /** - * Set approveAmount - * - * @param approveAmount Override approve amount (smallest unit, positive integer string). - * Defaults to the swap amount. (optional) - * @return BuildSwapTransactionRequest - */ - public BuildSwapTransactionRequest approveAmount(String approveAmount) { - this.approveAmount = approveAmount; - return this; - } - - /** - * Set gasLimit - * - * @param gasLimit Gas limit override (positive integer string). EVM only. (optional) - * @return BuildSwapTransactionRequest - */ - public BuildSwapTransactionRequest gasLimit(String gasLimit) { - this.gasLimit = gasLimit; - return this; - } - - /** - * Set gasLevel - * - * @param gasLevel Gas price tier. Defaults to \"average\". (optional) - * @return BuildSwapTransactionRequest - */ - public BuildSwapTransactionRequest gasLevel(GasLevel gasLevel) { - this.gasLevel = gasLevel; - return this; - } - /** * Set priceImpactProtectionPercent * * @param priceImpactProtectionPercent Maximum allowed price impact percentage (0–100). * Defaults to 90; set to 100 to disable. (optional) - * @return BuildSwapTransactionRequest + * @return BuildSolanaSwapInstructionsRequest */ - public BuildSwapTransactionRequest priceImpactProtectionPercent( + public BuildSolanaSwapInstructionsRequest priceImpactProtectionPercent( String priceImpactProtectionPercent) { this.priceImpactProtectionPercent = priceImpactProtectionPercent; return this; @@ -638,9 +545,9 @@ public BuildSwapTransactionRequest priceImpactProtectionPercent( * * @param autoSlippage When \"true\", slippage is auto-derived from market data * and overrides `slippagePercent`. Defaults to false. (optional) - * @return BuildSwapTransactionRequest + * @return BuildSolanaSwapInstructionsRequest */ - public BuildSwapTransactionRequest autoSlippage(AutoSlippage autoSlippage) { + public BuildSolanaSwapInstructionsRequest autoSlippage(AutoSlippage autoSlippage) { this.autoSlippage = autoSlippage; return this; } @@ -650,9 +557,10 @@ public BuildSwapTransactionRequest autoSlippage(AutoSlippage autoSlippage) { * * @param maxAutoSlippagePercent Cap on auto-derived slippage (only applies when * `autoSlippage=true`). (optional) - * @return BuildSwapTransactionRequest + * @return BuildSolanaSwapInstructionsRequest */ - public BuildSwapTransactionRequest maxAutoSlippagePercent(String maxAutoSlippagePercent) { + public BuildSolanaSwapInstructionsRequest maxAutoSlippagePercent( + String maxAutoSlippagePercent) { this.maxAutoSlippagePercent = maxAutoSlippagePercent; return this; } @@ -660,12 +568,11 @@ public BuildSwapTransactionRequest maxAutoSlippagePercent(String maxAutoSlippage /** * Set computeUnitLimit * - * @param computeUnitLimit Solana only — maximum compute units the transaction may consume - * (analogous to EVM gasLimit). Applies only when - * `binanceChainId=CT_501`. (optional) - * @return BuildSwapTransactionRequest + * @param computeUnitLimit Maximum compute units the transaction may consume (analogous to + * EVM gasLimit). Defaults to the platform value when omitted. (optional) + * @return BuildSolanaSwapInstructionsRequest */ - public BuildSwapTransactionRequest computeUnitLimit(String computeUnitLimit) { + public BuildSolanaSwapInstructionsRequest computeUnitLimit(String computeUnitLimit) { this.computeUnitLimit = computeUnitLimit; return this; } @@ -673,38 +580,63 @@ public BuildSwapTransactionRequest computeUnitLimit(String computeUnitLimit) { /** * Set computeUnitPrice * - * @param computeUnitPrice Solana only — priority fee per compute unit (micro-lamports), - * analogous to EVM gasPrice. When omitted, the platform computes a value dynamically. - * Applies only when `binanceChainId=CT_501`. (optional) - * @return BuildSwapTransactionRequest + * @param computeUnitPrice Priority fee per compute unit (micro-lamports). When omitted, the + * platform computes a value either from the `gasLevel` tier or from + * chain-side defaults. (optional) + * @return BuildSolanaSwapInstructionsRequest */ - public BuildSwapTransactionRequest computeUnitPrice(String computeUnitPrice) { + public BuildSolanaSwapInstructionsRequest computeUnitPrice(String computeUnitPrice) { this.computeUnitPrice = computeUnitPrice; return this; } + /** + * Set gasLevel + * + * @param gasLevel Priority-fee tier; consulted only when `computeUnitPrice` is + * omitted. Defaults to \"average\". (optional) + * @return BuildSolanaSwapInstructionsRequest + */ + public BuildSolanaSwapInstructionsRequest gasLevel(GasLevel gasLevel) { + this.gasLevel = gasLevel; + return this; + } + /** * Set tips * - * @param tips Solana only — Jito tips in SOL for MEV protection. Valid range [0.000000001, - * 2] (minimum 1 lamport). When specified, it is recommended to set - * `computeUnitPrice=0`. Applies only when - * `binanceChainId=CT_501`. (optional) - * @return BuildSwapTransactionRequest + * @param tips Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] (minimum 1 + * lamport). When specified, it is recommended to set + * `computeUnitPrice=0`. The platform picks one of Jito's tip + * accounts at random per request. (optional) + * @return BuildSolanaSwapInstructionsRequest */ - public BuildSwapTransactionRequest tips(String tips) { + public BuildSolanaSwapInstructionsRequest tips(String tips) { this.tips = tips; return this; } } - private okhttp3.Call getAggregatedQuoteCall( + private okhttp3.Call buildSwapTransactionCall( String binanceChainId, String amount, String fromTokenAddress, String toTokenAddress, + String userWalletAddress, + String quoteId, Long recvWindow, - String nonce) + String nonce, + String slippagePercent, + ApproveTransaction approveTransaction, + String approveAmount, + String gasLimit, + GasLevel gasLevel, + String priceImpactProtectionPercent, + AutoSlippage autoSlippage, + String maxAutoSlippagePercent, + String computeUnitLimit, + String computeUnitPrice, + String tips) throws ApiException { String basePath = null; // Operation Servers @@ -722,7 +654,7 @@ private okhttp3.Call getAggregatedQuoteCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v1/dex/aggregator/quote"; + String localVarPath = "/api/v1/dex/aggregator/swap"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -749,54 +681,1370 @@ private okhttp3.Call getAggregatedQuoteCall( localVarApiClient.parameterToPair("toTokenAddress", toTokenAddress)); } - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); + if (slippagePercent != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("slippagePercent", slippagePercent)); } - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); + if (userWalletAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("userWalletAddress", userWalletAddress)); } - if (recvWindow != null) { - localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + if (quoteId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("quoteId", quoteId)); } - if (nonce != null) { - localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + if (approveTransaction != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("approveTransaction", approveTransaction)); } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceWeb3Signature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); + if (approveAmount != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("approveAmount", approveAmount)); } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - @SuppressWarnings("rawtypes") - private okhttp3.Call getAggregatedQuoteValidateBeforeCall( - String binanceChainId, - String amount, - String fromTokenAddress, + if (gasLimit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gasLimit", gasLimit)); + } + + if (gasLevel != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gasLevel", gasLevel)); + } + + if (priceImpactProtectionPercent != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "priceImpactProtectionPercent", priceImpactProtectionPercent)); + } + + if (autoSlippage != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("autoSlippage", autoSlippage)); + } + + if (maxAutoSlippagePercent != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "maxAutoSlippagePercent", maxAutoSlippagePercent)); + } + + if (computeUnitLimit != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("computeUnitLimit", computeUnitLimit)); + } + + if (computeUnitPrice != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("computeUnitPrice", computeUnitPrice)); + } + + if (tips != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tips", tips)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 buildSwapTransactionValidateBeforeCall( + String binanceChainId, + String amount, + String fromTokenAddress, String toTokenAddress, + String userWalletAddress, + String quoteId, Long recvWindow, - String nonce) + String nonce, + String slippagePercent, + ApproveTransaction approveTransaction, + String approveAmount, + String gasLimit, + GasLevel gasLevel, + String priceImpactProtectionPercent, + AutoSlippage autoSlippage, + String maxAutoSlippagePercent, + String computeUnitLimit, + String computeUnitPrice, + String tips) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + userWalletAddress, + quoteId, + recvWindow, + nonce, + slippagePercent, + approveTransaction, + approveAmount, + gasLimit, + gasLevel, + priceImpactProtectionPercent, + autoSlippage, + maxAutoSlippagePercent, + computeUnitLimit, + computeUnitPrice, + tips + }; + Method method = + this.getClass() + .getMethod( + "buildSwapTransaction", + String.class, + String.class, + String.class, + String.class, + String.class, + String.class, + Long.class, + String.class, + String.class, + ApproveTransaction.class, + String.class, + String.class, + GasLevel.class, + String.class, + AutoSlippage.class, + String.class, + String.class, + String.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return buildSwapTransactionCall( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + userWalletAddress, + quoteId, + recvWindow, + nonce, + slippagePercent, + approveTransaction, + approveAmount, + gasLimit, + gasLevel, + priceImpactProtectionPercent, + autoSlippage, + maxAutoSlippagePercent, + computeUnitLimit, + computeUnitPrice, + tips); + } 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()); + } + } + + public ApiResponse buildSwapTransaction( + @NotNull String binanceChainId, + @NotNull String amount, + @NotNull String fromTokenAddress, + @NotNull String toTokenAddress, + @NotNull String userWalletAddress, + @NotNull String quoteId, + Long recvWindow, + String nonce, + String slippagePercent, + ApproveTransaction approveTransaction, + String approveAmount, + String gasLimit, + GasLevel gasLevel, + String priceImpactProtectionPercent, + AutoSlippage autoSlippage, + String maxAutoSlippagePercent, + String computeUnitLimit, + String computeUnitPrice, + String tips) + throws ApiException { + okhttp3.Call localVarCall = + buildSwapTransactionValidateBeforeCall( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + userWalletAddress, + quoteId, + recvWindow, + nonce, + slippagePercent, + approveTransaction, + approveAmount, + gasLimit, + gasLevel, + priceImpactProtectionPercent, + autoSlippage, + maxAutoSlippagePercent, + computeUnitLimit, + computeUnitPrice, + tips); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse buildSwapTransaction( + BuildSwapTransactionRequest request) { + return buildSwapTransaction( + request.getBinanceChainId(), + request.getAmount(), + request.getFromTokenAddress(), + request.getToTokenAddress(), + request.getUserWalletAddress(), + request.getQuoteId(), + request.getRecvWindow(), + request.getNonce(), + request.getSlippagePercent(), + request.getApproveTransaction(), + request.getApproveAmount(), + request.getGasLimit(), + request.getGasLevel(), + request.getPriceImpactProtectionPercent(), + request.getAutoSlippage(), + request.getMaxAutoSlippagePercent(), + request.getComputeUnitLimit(), + request.getComputeUnitPrice(), + request.getTips()); + } + + public static class BuildSwapTransactionRequest { + private final String binanceChainId; + private final String amount; + private final String fromTokenAddress; + private final String toTokenAddress; + private final String userWalletAddress; + private final String quoteId; + private Long recvWindow; + private String nonce; + private String slippagePercent; + private ApproveTransaction approveTransaction; + private String approveAmount; + private String gasLimit; + private GasLevel gasLevel; + private String priceImpactProtectionPercent; + private AutoSlippage autoSlippage; + private String maxAutoSlippagePercent; + private String computeUnitLimit; + private String computeUnitPrice; + private String tips; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getAmount() { + return amount; + } + + public String getFromTokenAddress() { + return fromTokenAddress; + } + + public String getToTokenAddress() { + return toTokenAddress; + } + + public String getUserWalletAddress() { + return userWalletAddress; + } + + public String getQuoteId() { + return quoteId; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getSlippagePercent() { + return slippagePercent; + } + + public ApproveTransaction getApproveTransaction() { + return approveTransaction; + } + + public String getApproveAmount() { + return approveAmount; + } + + public String getGasLimit() { + return gasLimit; + } + + public GasLevel getGasLevel() { + return gasLevel; + } + + public String getPriceImpactProtectionPercent() { + return priceImpactProtectionPercent; + } + + public AutoSlippage getAutoSlippage() { + return autoSlippage; + } + + public String getMaxAutoSlippagePercent() { + return maxAutoSlippagePercent; + } + + public String getComputeUnitLimit() { + return computeUnitLimit; + } + + public String getComputeUnitPrice() { + return computeUnitPrice; + } + + public String getTips() { + return tips; + } + + public BuildSwapTransactionRequest( + String binanceChainId, + String amount, + String fromTokenAddress, + String toTokenAddress, + String userWalletAddress, + String quoteId) { + this.binanceChainId = binanceChainId; + this.amount = amount; + this.fromTokenAddress = fromTokenAddress; + this.toTokenAddress = toTokenAddress; + this.userWalletAddress = userWalletAddress; + this.quoteId = quoteId; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set slippagePercent + * + * @param slippagePercent Maximum slippage tolerance as a percentage string. Required unless + * `autoSlippage=true`. **Range by chain:** - EVM chains (BSC, Ethereum, + * Base, etc.): `0` to `100` (inclusive) - Solana + * (`CT_501`): `0` to less than `100` (i.e. `< + * 100`) **Range by vendor:** - 1inch, PancakeSwap: `0` to `50` + * (values above 50 are rejected) - LiFi, LiquidMesh: `0` to `100` + * (EVM) or `0` to `< 100` (Solana) - Jupiter (Solana): + * `0` to less than `100`; the value is converted to basis points + * (`slippageBps = ceil(slippagePercent × 100)`) and applied to the + * on-chain swap `\"0.5\"` means 0.5% maximum slippage. When + * `autoSlippage=true` this field is overridden by the auto-computed + * value. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest slippagePercent(String slippagePercent) { + this.slippagePercent = slippagePercent; + return this; + } + + /** + * Set approveTransaction + * + * @param approveTransaction When \"true\", `signatureData` includes the + * spender address and approve calldata so the client can submit it before the swap. + * Defaults to false. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest approveTransaction( + ApproveTransaction approveTransaction) { + this.approveTransaction = approveTransaction; + return this; + } + + /** + * Set approveAmount + * + * @param approveAmount Override approve amount (smallest unit, positive integer string). + * Defaults to the swap amount. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest approveAmount(String approveAmount) { + this.approveAmount = approveAmount; + return this; + } + + /** + * Set gasLimit + * + * @param gasLimit Gas limit override (positive integer string). EVM only. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest gasLimit(String gasLimit) { + this.gasLimit = gasLimit; + return this; + } + + /** + * Set gasLevel + * + * @param gasLevel Gas price tier. Defaults to \"average\". (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest gasLevel(GasLevel gasLevel) { + this.gasLevel = gasLevel; + return this; + } + + /** + * Set priceImpactProtectionPercent + * + * @param priceImpactProtectionPercent Maximum allowed price impact percentage (0–100). + * Defaults to 90; set to 100 to disable. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest priceImpactProtectionPercent( + String priceImpactProtectionPercent) { + this.priceImpactProtectionPercent = priceImpactProtectionPercent; + return this; + } + + /** + * Set autoSlippage + * + * @param autoSlippage When `\"true\"`, slippage is auto-derived from + * market data and overrides `slippagePercent`. Either + * `slippagePercent` or `autoSlippage=true` must be provided — + * omitting both returns a parameter error. Defaults to `\"false\"`. + * (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest autoSlippage(AutoSlippage autoSlippage) { + this.autoSlippage = autoSlippage; + return this; + } + + /** + * Set maxAutoSlippagePercent + * + * @param maxAutoSlippagePercent Cap on auto-derived slippage (only applies when + * `autoSlippage=true`). (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest maxAutoSlippagePercent(String maxAutoSlippagePercent) { + this.maxAutoSlippagePercent = maxAutoSlippagePercent; + return this; + } + + /** + * Set computeUnitLimit + * + * @param computeUnitLimit Solana only — maximum compute units the transaction may consume + * (analogous to EVM gasLimit). Applies only when + * `binanceChainId=CT_501`. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest computeUnitLimit(String computeUnitLimit) { + this.computeUnitLimit = computeUnitLimit; + return this; + } + + /** + * Set computeUnitPrice + * + * @param computeUnitPrice Solana only — priority fee per compute unit (micro-lamports), + * analogous to EVM gasPrice. When omitted, the platform computes a value dynamically. + * Applies only when `binanceChainId=CT_501`. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest computeUnitPrice(String computeUnitPrice) { + this.computeUnitPrice = computeUnitPrice; + return this; + } + + /** + * Set tips + * + * @param tips Solana only — Jito tips in SOL for MEV protection. Valid range [0.000000001, + * 2] (minimum 1 lamport). When specified, it is recommended to set + * `computeUnitPrice=0`. Applies only when + * `binanceChainId=CT_501`. (optional) + * @return BuildSwapTransactionRequest + */ + public BuildSwapTransactionRequest tips(String tips) { + this.tips = tips; + return this; + } + } + + private okhttp3.Call getAggregatedQuoteCall( + String binanceChainId, + String amount, + String fromTokenAddress, + String toTokenAddress, + Long recvWindow, + String nonce, + String userWalletAddress) + 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 = "/api/v1/dex/aggregator/quote"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (fromTokenAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("fromTokenAddress", fromTokenAddress)); + } + + if (toTokenAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("toTokenAddress", toTokenAddress)); + } + + if (userWalletAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("userWalletAddress", userWalletAddress)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getAggregatedQuoteValidateBeforeCall( + String binanceChainId, + String amount, + String fromTokenAddress, + String toTokenAddress, + Long recvWindow, + String nonce, + String userWalletAddress) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + recvWindow, + nonce, + userWalletAddress + }; + Method method = + this.getClass() + .getMethod( + "getAggregatedQuote", + String.class, + String.class, + String.class, + String.class, + Long.class, + String.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getAggregatedQuoteCall( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + recvWindow, + nonce, + userWalletAddress); + } 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()); + } + } + + public ApiResponse getAggregatedQuote( + @NotNull String binanceChainId, + @NotNull String amount, + @NotNull String fromTokenAddress, + @NotNull String toTokenAddress, + Long recvWindow, + String nonce, + String userWalletAddress) + throws ApiException { + okhttp3.Call localVarCall = + getAggregatedQuoteValidateBeforeCall( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + recvWindow, + nonce, + userWalletAddress); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getAggregatedQuote( + GetAggregatedQuoteRequest request) { + return getAggregatedQuote( + request.getBinanceChainId(), + request.getAmount(), + request.getFromTokenAddress(), + request.getToTokenAddress(), + request.getRecvWindow(), + request.getNonce(), + request.getUserWalletAddress()); + } + + public static class GetAggregatedQuoteRequest { + private final String binanceChainId; + private final String amount; + private final String fromTokenAddress; + private final String toTokenAddress; + private Long recvWindow; + private String nonce; + private String userWalletAddress; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getAmount() { + return amount; + } + + public String getFromTokenAddress() { + return fromTokenAddress; + } + + public String getToTokenAddress() { + return toTokenAddress; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getUserWalletAddress() { + return userWalletAddress; + } + + public GetAggregatedQuoteRequest( + String binanceChainId, + String amount, + String fromTokenAddress, + String toTokenAddress) { + this.binanceChainId = binanceChainId; + this.amount = amount; + this.fromTokenAddress = fromTokenAddress; + this.toTokenAddress = toTokenAddress; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetAggregatedQuoteRequest + */ + public GetAggregatedQuoteRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetAggregatedQuoteRequest + */ + public GetAggregatedQuoteRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set userWalletAddress + * + * @param userWalletAddress User wallet address. Required when quoting RFQ routes (equity / + * RWA tokens such as Ondo and BStock). This address is used as the receiver in the RFQ + * order and must match the wallet that signs `rfq.typedDataToSign` in the + * subsequent `/swap` call. (optional) + * @return GetAggregatedQuoteRequest + */ + public GetAggregatedQuoteRequest userWalletAddress(String userWalletAddress) { + this.userWalletAddress = userWalletAddress; + return this; + } + } + + private okhttp3.Call getAggregatorSupportedChainsCall( + Long recvWindow, String nonce, String binanceChainId) 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 = "/api/v1/dex/aggregator/supported/chain"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getAggregatorSupportedChainsValidateBeforeCall( + Long recvWindow, String nonce, String binanceChainId) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow, nonce, binanceChainId}; + Method method = + this.getClass() + .getMethod( + "getAggregatorSupportedChains", + Long.class, + String.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getAggregatorSupportedChainsCall(recvWindow, nonce, binanceChainId); + } 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()); + } + } + + public ApiResponse getAggregatorSupportedChains( + Long recvWindow, String nonce, String binanceChainId) throws ApiException { + okhttp3.Call localVarCall = + getAggregatorSupportedChainsValidateBeforeCall(recvWindow, nonce, binanceChainId); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getAggregatorSupportedChains( + GetAggregatorSupportedChainsRequest request) { + return getAggregatorSupportedChains( + request.getRecvWindow(), request.getNonce(), request.getBinanceChainId()); + } + + public static class GetAggregatorSupportedChainsRequest { + private Long recvWindow; + private String nonce; + private String binanceChainId; + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getBinanceChainId() { + return binanceChainId; + } + + public GetAggregatorSupportedChainsRequest() {} + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetAggregatorSupportedChainsRequest + */ + public GetAggregatorSupportedChainsRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetAggregatorSupportedChainsRequest + */ + public GetAggregatorSupportedChainsRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set binanceChainId + * + * @param binanceChainId Optional chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). When set, only that + * chain is returned. (optional) + * @return GetAggregatorSupportedChainsRequest + */ + public GetAggregatorSupportedChainsRequest binanceChainId(String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + } + + private okhttp3.Call getErc20ApproveTransactionCall( + String binanceChainId, + String tokenContractAddress, + String approveAmount, + Long recvWindow, + String nonce, + String vendor) + 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 = "/api/v1/dex/aggregator/approve-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (binanceChainId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + } + + if (tokenContractAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "tokenContractAddress", tokenContractAddress)); + } + + if (approveAmount != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("approveAmount", approveAmount)); + } + + if (vendor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vendor", vendor)); + } + + 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); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getErc20ApproveTransactionValidateBeforeCall( + String binanceChainId, + String tokenContractAddress, + String approveAmount, + Long recvWindow, + String nonce, + String vendor) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + binanceChainId, tokenContractAddress, approveAmount, recvWindow, nonce, vendor + }; + Method method = + this.getClass() + .getMethod( + "getErc20ApproveTransaction", + String.class, + String.class, + String.class, + Long.class, + String.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getErc20ApproveTransactionCall( + binanceChainId, + tokenContractAddress, + approveAmount, + recvWindow, + nonce, + vendor); + } 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()); + } + } + + public ApiResponse getErc20ApproveTransaction( + @NotNull String binanceChainId, + @NotNull String tokenContractAddress, + @NotNull String approveAmount, + Long recvWindow, + String nonce, + String vendor) + throws ApiException { + okhttp3.Call localVarCall = + getErc20ApproveTransactionValidateBeforeCall( + binanceChainId, + tokenContractAddress, + approveAmount, + recvWindow, + nonce, + vendor); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + public ApiResponse getErc20ApproveTransaction( + GetErc20ApproveTransactionRequest request) { + return getErc20ApproveTransaction( + request.getBinanceChainId(), + request.getTokenContractAddress(), + request.getApproveAmount(), + request.getRecvWindow(), + request.getNonce(), + request.getVendor()); + } + + public static class GetErc20ApproveTransactionRequest { + private final String binanceChainId; + private final String tokenContractAddress; + private final String approveAmount; + private Long recvWindow; + private String nonce; + private String vendor; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public String getApproveAmount() { + return approveAmount; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getVendor() { + return vendor; + } + + public GetErc20ApproveTransactionRequest( + String binanceChainId, String tokenContractAddress, String approveAmount) { + this.binanceChainId = binanceChainId; + this.tokenContractAddress = tokenContractAddress; + this.approveAmount = approveAmount; + } + + /** + * Set recvWindow + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @return GetErc20ApproveTransactionRequest + */ + public GetErc20ApproveTransactionRequest recvWindow(Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Set nonce + * + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if + * omitted. (optional) + * @return GetErc20ApproveTransactionRequest + */ + public GetErc20ApproveTransactionRequest nonce(String nonce) { + this.nonce = nonce; + return this; + } + + /** + * Set vendor + * + * @param vendor RFQ vendor name. **Required for equity / RWA tokens (Ondo, BStock)**; pass + * the `vendorName` from the `/quote` response (e.g. + * `InchFusion`, `CowSwap`, `PcsXRfq`). When provided, the + * backend returns approve calldata targeting the vendor-specific spender contract (e.g. + * 1inch Router, PcsX Permit2, CowSwap VaultRelayer) instead of the default DEX router. + * For regular (non-RWA) tokens, this parameter is optional. If omitted, the backend + * uses the standard DEX router. If a valid RFQ vendor is passed, the backend resolves + * that vendor's spender — used when buying Ondo/BStock with a stablecoin, where the + * from-token (e.g. USDT) itself is not an RFQ token but must be approved to the RFQ + * vendor's router. (optional) + * @return GetErc20ApproveTransactionRequest + */ + public GetErc20ApproveTransactionRequest vendor(String vendor) { + this.vendor = vendor; + return this; + } + } + + private okhttp3.Call getRfqOrderStatusCall(String orderId, Long recvWindow, String nonce) 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 = + "/api/v1/dex/aggregator/order/{orderId}" + .replace( + "{" + "orderId" + "}", + localVarApiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + if (recvWindow != null) { + localVarHeaderParams.put("recvWindow", localVarApiClient.parameterToString(recvWindow)); + } + + if (nonce != null) { + localVarHeaderParams.put("nonce", localVarApiClient.parameterToString(nonce)); + } + + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceWeb3Signature"); + 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 getRfqOrderStatusValidateBeforeCall( + String orderId, Long recvWindow, String nonce) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -806,30 +2054,15 @@ private okhttp3.Call getAggregatedQuoteValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = { - binanceChainId, amount, fromTokenAddress, toTokenAddress, recvWindow, nonce - }; + Object[] parameterValues = {orderId, recvWindow, nonce}; Method method = this.getClass() - .getMethod( - "getAggregatedQuote", - String.class, - String.class, - String.class, - String.class, - Long.class, - String.class); + .getMethod("getRfqOrderStatus", String.class, Long.class, String.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getAggregatedQuoteCall( - binanceChainId, - amount, - fromTokenAddress, - toTokenAddress, - recvWindow, - nonce); + return getRfqOrderStatusCall(orderId, recvWindow, nonce); } else { throw new ConstraintViolationException((Set) violations); } @@ -842,60 +2075,26 @@ private okhttp3.Call getAggregatedQuoteValidateBeforeCall( } } - public ApiResponse getAggregatedQuote( - @NotNull String binanceChainId, - @NotNull String amount, - @NotNull String fromTokenAddress, - @NotNull String toTokenAddress, - Long recvWindow, - String nonce) - throws ApiException { - okhttp3.Call localVarCall = - getAggregatedQuoteValidateBeforeCall( - binanceChainId, - amount, - fromTokenAddress, - toTokenAddress, - recvWindow, - nonce); + public ApiResponse getRfqOrderStatus( + @NotNull String orderId, Long recvWindow, String nonce) throws ApiException { + okhttp3.Call localVarCall = getRfqOrderStatusValidateBeforeCall(orderId, recvWindow, nonce); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - public ApiResponse getAggregatedQuote( - GetAggregatedQuoteRequest request) { - return getAggregatedQuote( - request.getBinanceChainId(), - request.getAmount(), - request.getFromTokenAddress(), - request.getToTokenAddress(), - request.getRecvWindow(), - request.getNonce()); + public ApiResponse getRfqOrderStatus( + GetRfqOrderStatusRequest request) { + return getRfqOrderStatus(request.getOrderId(), request.getRecvWindow(), request.getNonce()); } - public static class GetAggregatedQuoteRequest { - private final String binanceChainId; - private final String amount; - private final String fromTokenAddress; - private final String toTokenAddress; + public static class GetRfqOrderStatusRequest { + private final String orderId; private Long recvWindow; private String nonce; - public String getBinanceChainId() { - return binanceChainId; - } - - public String getAmount() { - return amount; - } - - public String getFromTokenAddress() { - return fromTokenAddress; - } - - public String getToTokenAddress() { - return toTokenAddress; + public String getOrderId() { + return orderId; } public Long getRecvWindow() { @@ -906,15 +2105,8 @@ public String getNonce() { return nonce; } - public GetAggregatedQuoteRequest( - String binanceChainId, - String amount, - String fromTokenAddress, - String toTokenAddress) { - this.binanceChainId = binanceChainId; - this.amount = amount; - this.fromTokenAddress = fromTokenAddress; - this.toTokenAddress = toTokenAddress; + public GetRfqOrderStatusRequest(String orderId) { + this.orderId = orderId; } /** @@ -922,9 +2114,9 @@ public GetAggregatedQuoteRequest( * * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). * (optional) - * @return GetAggregatedQuoteRequest + * @return GetRfqOrderStatusRequest */ - public GetAggregatedQuoteRequest recvWindow(Long recvWindow) { + public GetRfqOrderStatusRequest recvWindow(Long recvWindow) { this.recvWindow = recvWindow; return this; } @@ -934,16 +2126,17 @@ public GetAggregatedQuoteRequest recvWindow(Long recvWindow) { * * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if * omitted. (optional) - * @return GetAggregatedQuoteRequest + * @return GetRfqOrderStatusRequest */ - public GetAggregatedQuoteRequest nonce(String nonce) { + public GetRfqOrderStatusRequest nonce(String nonce) { this.nonce = nonce; return this; } } - private okhttp3.Call getAggregatorSupportedChainsCall( - Long recvWindow, String nonce, String binanceChainId) throws ApiException { + private okhttp3.Call getTransactionStatusCall( + String binanceChainId, String txHash, Long recvWindow, String nonce) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -960,7 +2153,7 @@ private okhttp3.Call getAggregatorSupportedChainsCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v1/dex/aggregator/supported/chain"; + String localVarPath = "/api/v1/dex/aggregator/history"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -973,6 +2166,10 @@ private okhttp3.Call getAggregatorSupportedChainsCall( localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); } + if (txHash != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("txHash", txHash)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1013,8 +2210,9 @@ private okhttp3.Call getAggregatorSupportedChainsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getAggregatorSupportedChainsValidateBeforeCall( - Long recvWindow, String nonce, String binanceChainId) throws ApiException { + private okhttp3.Call getTransactionStatusValidateBeforeCall( + String binanceChainId, String txHash, Long recvWindow, String nonce) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1024,19 +2222,20 @@ private okhttp3.Call getAggregatorSupportedChainsValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {recvWindow, nonce, binanceChainId}; + Object[] parameterValues = {binanceChainId, txHash, recvWindow, nonce}; Method method = this.getClass() .getMethod( - "getAggregatorSupportedChains", - Long.class, + "getTransactionStatus", + String.class, String.class, + Long.class, String.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getAggregatorSupportedChainsCall(recvWindow, nonce, binanceChainId); + return getTransactionStatusCall(binanceChainId, txHash, recvWindow, nonce); } else { throw new ConstraintViolationException((Set) violations); } @@ -1049,25 +2248,38 @@ private okhttp3.Call getAggregatorSupportedChainsValidateBeforeCall( } } - public ApiResponse getAggregatorSupportedChains( - Long recvWindow, String nonce, String binanceChainId) throws ApiException { + public ApiResponse getTransactionStatus( + @NotNull String binanceChainId, @NotNull String txHash, Long recvWindow, String nonce) + throws ApiException { okhttp3.Call localVarCall = - getAggregatorSupportedChainsValidateBeforeCall(recvWindow, nonce, binanceChainId); + getTransactionStatusValidateBeforeCall(binanceChainId, txHash, recvWindow, nonce); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - public ApiResponse getAggregatorSupportedChains( - GetAggregatorSupportedChainsRequest request) { - return getAggregatorSupportedChains( - request.getRecvWindow(), request.getNonce(), request.getBinanceChainId()); + public ApiResponse getTransactionStatus( + GetTransactionStatusRequest request) { + return getTransactionStatus( + request.getBinanceChainId(), + request.getTxHash(), + request.getRecvWindow(), + request.getNonce()); } - public static class GetAggregatorSupportedChainsRequest { + public static class GetTransactionStatusRequest { + private final String binanceChainId; + private final String txHash; private Long recvWindow; private String nonce; - private String binanceChainId; + + public String getBinanceChainId() { + return binanceChainId; + } + + public String getTxHash() { + return txHash; + } public Long getRecvWindow() { return recvWindow; @@ -1077,20 +2289,19 @@ public String getNonce() { return nonce; } - public String getBinanceChainId() { - return binanceChainId; + public GetTransactionStatusRequest(String binanceChainId, String txHash) { + this.binanceChainId = binanceChainId; + this.txHash = txHash; } - public GetAggregatorSupportedChainsRequest() {} - /** * Set recvWindow * * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). * (optional) - * @return GetAggregatorSupportedChainsRequest + * @return GetTransactionStatusRequest */ - public GetAggregatorSupportedChainsRequest recvWindow(Long recvWindow) { + public GetTransactionStatusRequest recvWindow(Long recvWindow) { this.recvWindow = recvWindow; return this; } @@ -1100,33 +2311,34 @@ public GetAggregatorSupportedChainsRequest recvWindow(Long recvWindow) { * * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if * omitted. (optional) - * @return GetAggregatorSupportedChainsRequest + * @return GetTransactionStatusRequest */ - public GetAggregatorSupportedChainsRequest nonce(String nonce) { + public GetTransactionStatusRequest nonce(String nonce) { this.nonce = nonce; return this; } - - /** - * Set binanceChainId - * - * @param binanceChainId Optional chain identifier (e.g. \"1\"=Ethereum, - * \"56\"=BSC, \"CT_501\"=Solana). When set, only that - * chain is returned. (optional) - * @return GetAggregatorSupportedChainsRequest - */ - public GetAggregatorSupportedChainsRequest binanceChainId(String binanceChainId) { - this.binanceChainId = binanceChainId; - return this; - } } - private okhttp3.Call getErc20ApproveTransactionCall( + private okhttp3.Call quoteAndBuildSwapTransactionCall( String binanceChainId, - String tokenContractAddress, - String approveAmount, + String amount, + String fromTokenAddress, + String toTokenAddress, + String userWalletAddress, + Vendor vendor, Long recvWindow, - String nonce) + String nonce, + String slippagePercent, + ApproveTransaction approveTransaction, + String approveAmount, + String gasLimit, + GasLevel gasLevel, + String priceImpactProtectionPercent, + AutoSlippage autoSlippage, + String maxAutoSlippagePercent, + String computeUnitLimit, + String computeUnitPrice, + String tips) throws ApiException { String basePath = null; // Operation Servers @@ -1144,7 +2356,7 @@ private okhttp3.Call getErc20ApproveTransactionCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v1/dex/aggregator/approve-transaction"; + String localVarPath = "/api/v1/dex/aggregator/quote-and-swap"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1157,10 +2369,37 @@ private okhttp3.Call getErc20ApproveTransactionCall( localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); } - if (tokenContractAddress != null) { + if (amount != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("amount", amount)); + } + + if (fromTokenAddress != null) { localVarQueryParams.addAll( - localVarApiClient.parameterToPair( - "tokenContractAddress", tokenContractAddress)); + localVarApiClient.parameterToPair("fromTokenAddress", fromTokenAddress)); + } + + if (toTokenAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("toTokenAddress", toTokenAddress)); + } + + if (slippagePercent != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("slippagePercent", slippagePercent)); + } + + if (userWalletAddress != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("userWalletAddress", userWalletAddress)); + } + + if (vendor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vendor", vendor)); + } + + if (approveTransaction != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("approveTransaction", approveTransaction)); } if (approveAmount != null) { @@ -1168,6 +2407,45 @@ private okhttp3.Call getErc20ApproveTransactionCall( localVarApiClient.parameterToPair("approveAmount", approveAmount)); } + if (gasLimit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gasLimit", gasLimit)); + } + + if (gasLevel != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("gasLevel", gasLevel)); + } + + if (priceImpactProtectionPercent != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "priceImpactProtectionPercent", priceImpactProtectionPercent)); + } + + if (autoSlippage != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("autoSlippage", autoSlippage)); + } + + if (maxAutoSlippagePercent != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "maxAutoSlippagePercent", maxAutoSlippagePercent)); + } + + if (computeUnitLimit != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("computeUnitLimit", computeUnitLimit)); + } + + if (computeUnitPrice != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("computeUnitPrice", computeUnitPrice)); + } + + if (tips != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tips", tips)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1208,12 +2486,26 @@ private okhttp3.Call getErc20ApproveTransactionCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getErc20ApproveTransactionValidateBeforeCall( + private okhttp3.Call quoteAndBuildSwapTransactionValidateBeforeCall( String binanceChainId, - String tokenContractAddress, - String approveAmount, + String amount, + String fromTokenAddress, + String toTokenAddress, + String userWalletAddress, + Vendor vendor, Long recvWindow, - String nonce) + String nonce, + String slippagePercent, + ApproveTransaction approveTransaction, + String approveAmount, + String gasLimit, + GasLevel gasLevel, + String priceImpactProtectionPercent, + AutoSlippage autoSlippage, + String maxAutoSlippagePercent, + String computeUnitLimit, + String computeUnitPrice, + String tips) throws ApiException { try { Validator validator = @@ -1225,23 +2517,73 @@ private okhttp3.Call getErc20ApproveTransactionValidateBeforeCall( ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = { - binanceChainId, tokenContractAddress, approveAmount, recvWindow, nonce + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + userWalletAddress, + vendor, + recvWindow, + nonce, + slippagePercent, + approveTransaction, + approveAmount, + gasLimit, + gasLevel, + priceImpactProtectionPercent, + autoSlippage, + maxAutoSlippagePercent, + computeUnitLimit, + computeUnitPrice, + tips }; Method method = this.getClass() .getMethod( - "getErc20ApproveTransaction", + "quoteAndBuildSwapTransaction", + String.class, + String.class, String.class, String.class, String.class, + Vendor.class, Long.class, + String.class, + String.class, + ApproveTransaction.class, + String.class, + String.class, + GasLevel.class, + String.class, + AutoSlippage.class, + String.class, + String.class, + String.class, String.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getErc20ApproveTransactionCall( - binanceChainId, tokenContractAddress, approveAmount, recvWindow, nonce); + return quoteAndBuildSwapTransactionCall( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + userWalletAddress, + vendor, + recvWindow, + nonce, + slippagePercent, + approveTransaction, + approveAmount, + gasLimit, + gasLevel, + priceImpactProtectionPercent, + autoSlippage, + maxAutoSlippagePercent, + computeUnitLimit, + computeUnitPrice, + tips); } else { throw new ConstraintViolationException((Set) violations); } @@ -1254,63 +2596,187 @@ private okhttp3.Call getErc20ApproveTransactionValidateBeforeCall( } } - public ApiResponse getErc20ApproveTransaction( + public ApiResponse quoteAndBuildSwapTransaction( @NotNull String binanceChainId, - @NotNull String tokenContractAddress, - @NotNull String approveAmount, + @NotNull String amount, + @NotNull String fromTokenAddress, + @NotNull String toTokenAddress, + @NotNull String userWalletAddress, + @NotNull Vendor vendor, Long recvWindow, - String nonce) + String nonce, + String slippagePercent, + ApproveTransaction approveTransaction, + String approveAmount, + String gasLimit, + GasLevel gasLevel, + String priceImpactProtectionPercent, + AutoSlippage autoSlippage, + String maxAutoSlippagePercent, + String computeUnitLimit, + String computeUnitPrice, + String tips) throws ApiException { okhttp3.Call localVarCall = - getErc20ApproveTransactionValidateBeforeCall( - binanceChainId, tokenContractAddress, approveAmount, recvWindow, nonce); + quoteAndBuildSwapTransactionValidateBeforeCall( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + userWalletAddress, + vendor, + recvWindow, + nonce, + slippagePercent, + approveTransaction, + approveAmount, + gasLimit, + gasLevel, + priceImpactProtectionPercent, + autoSlippage, + maxAutoSlippagePercent, + computeUnitLimit, + computeUnitPrice, + tips); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - public ApiResponse getErc20ApproveTransaction( - GetErc20ApproveTransactionRequest request) { - return getErc20ApproveTransaction( + public ApiResponse quoteAndBuildSwapTransaction( + QuoteAndBuildSwapTransactionRequest request) { + return quoteAndBuildSwapTransaction( request.getBinanceChainId(), - request.getTokenContractAddress(), - request.getApproveAmount(), + request.getAmount(), + request.getFromTokenAddress(), + request.getToTokenAddress(), + request.getUserWalletAddress(), + request.getVendor(), request.getRecvWindow(), - request.getNonce()); + request.getNonce(), + request.getSlippagePercent(), + request.getApproveTransaction(), + request.getApproveAmount(), + request.getGasLimit(), + request.getGasLevel(), + request.getPriceImpactProtectionPercent(), + request.getAutoSlippage(), + request.getMaxAutoSlippagePercent(), + request.getComputeUnitLimit(), + request.getComputeUnitPrice(), + request.getTips()); } - public static class GetErc20ApproveTransactionRequest { + public static class QuoteAndBuildSwapTransactionRequest { private final String binanceChainId; - private final String tokenContractAddress; - private final String approveAmount; + private final String amount; + private final String fromTokenAddress; + private final String toTokenAddress; + private final String userWalletAddress; + private final Vendor vendor; private Long recvWindow; private String nonce; + private String slippagePercent; + private ApproveTransaction approveTransaction; + private String approveAmount; + private String gasLimit; + private GasLevel gasLevel; + private String priceImpactProtectionPercent; + private AutoSlippage autoSlippage; + private String maxAutoSlippagePercent; + private String computeUnitLimit; + private String computeUnitPrice; + private String tips; public String getBinanceChainId() { return binanceChainId; } - public String getTokenContractAddress() { - return tokenContractAddress; + public String getAmount() { + return amount; + } + + public String getFromTokenAddress() { + return fromTokenAddress; + } + + public String getToTokenAddress() { + return toTokenAddress; + } + + public String getUserWalletAddress() { + return userWalletAddress; + } + + public Vendor getVendor() { + return vendor; + } + + public Long getRecvWindow() { + return recvWindow; + } + + public String getNonce() { + return nonce; + } + + public String getSlippagePercent() { + return slippagePercent; + } + + public ApproveTransaction getApproveTransaction() { + return approveTransaction; } public String getApproveAmount() { return approveAmount; } - public Long getRecvWindow() { - return recvWindow; + public String getGasLimit() { + return gasLimit; } - public String getNonce() { - return nonce; + public GasLevel getGasLevel() { + return gasLevel; } - public GetErc20ApproveTransactionRequest( - String binanceChainId, String tokenContractAddress, String approveAmount) { + public String getPriceImpactProtectionPercent() { + return priceImpactProtectionPercent; + } + + public AutoSlippage getAutoSlippage() { + return autoSlippage; + } + + public String getMaxAutoSlippagePercent() { + return maxAutoSlippagePercent; + } + + public String getComputeUnitLimit() { + return computeUnitLimit; + } + + public String getComputeUnitPrice() { + return computeUnitPrice; + } + + public String getTips() { + return tips; + } + + public QuoteAndBuildSwapTransactionRequest( + String binanceChainId, + String amount, + String fromTokenAddress, + String toTokenAddress, + String userWalletAddress, + Vendor vendor) { this.binanceChainId = binanceChainId; - this.tokenContractAddress = tokenContractAddress; - this.approveAmount = approveAmount; + this.amount = amount; + this.fromTokenAddress = fromTokenAddress; + this.toTokenAddress = toTokenAddress; + this.userWalletAddress = userWalletAddress; + this.vendor = vendor; } /** @@ -1318,9 +2784,9 @@ public GetErc20ApproveTransactionRequest( * * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). * (optional) - * @return GetErc20ApproveTransactionRequest + * @return QuoteAndBuildSwapTransactionRequest */ - public GetErc20ApproveTransactionRequest recvWindow(Long recvWindow) { + public QuoteAndBuildSwapTransactionRequest recvWindow(Long recvWindow) { this.recvWindow = recvWindow; return this; } @@ -1330,16 +2796,162 @@ public GetErc20ApproveTransactionRequest recvWindow(Long recvWindow) { * * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if * omitted. (optional) - * @return GetErc20ApproveTransactionRequest + * @return QuoteAndBuildSwapTransactionRequest */ - public GetErc20ApproveTransactionRequest nonce(String nonce) { + public QuoteAndBuildSwapTransactionRequest nonce(String nonce) { this.nonce = nonce; return this; } + + /** + * Set slippagePercent + * + * @param slippagePercent Maximum slippage tolerance as a percentage string. Required unless + * `autoSlippage=true`. **Range by chain:** - EVM chains (BSC, Ethereum, + * Base, etc.): `0` to `100` (inclusive) - Solana + * (`CT_501`): `0` to less than `100` (i.e. `< + * 100`) `\"0.5\"` means 0.5% maximum slippage. When + * `autoSlippage=true` this field is overridden by the auto-computed + * value. (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest slippagePercent(String slippagePercent) { + this.slippagePercent = slippagePercent; + return this; + } + + /** + * Set approveTransaction + * + * @param approveTransaction When \"true\", `signatureData` includes the + * spender address and approve calldata so the client can submit it before the swap. + * Defaults to false. (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest approveTransaction( + ApproveTransaction approveTransaction) { + this.approveTransaction = approveTransaction; + return this; + } + + /** + * Set approveAmount + * + * @param approveAmount Override approve amount (smallest unit, positive integer string). + * Defaults to the swap amount. (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest approveAmount(String approveAmount) { + this.approveAmount = approveAmount; + return this; + } + + /** + * Set gasLimit + * + * @param gasLimit Gas limit override (positive integer string). EVM only. (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest gasLimit(String gasLimit) { + this.gasLimit = gasLimit; + return this; + } + + /** + * Set gasLevel + * + * @param gasLevel Gas price tier. Defaults to \"average\". (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest gasLevel(GasLevel gasLevel) { + this.gasLevel = gasLevel; + return this; + } + + /** + * Set priceImpactProtectionPercent + * + * @param priceImpactProtectionPercent Maximum allowed price impact percentage (0–100). + * Defaults to 90; set to 100 to disable. (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest priceImpactProtectionPercent( + String priceImpactProtectionPercent) { + this.priceImpactProtectionPercent = priceImpactProtectionPercent; + return this; + } + + /** + * Set autoSlippage + * + * @param autoSlippage When `\"true\"`, slippage is auto-derived from + * market data and overrides `slippagePercent`. Either + * `slippagePercent` or `autoSlippage=true` must be provided — + * omitting both returns a parameter error. Defaults to `\"false\"`. + * (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest autoSlippage(AutoSlippage autoSlippage) { + this.autoSlippage = autoSlippage; + return this; + } + + /** + * Set maxAutoSlippagePercent + * + * @param maxAutoSlippagePercent Cap on auto-derived slippage (only applies when + * `autoSlippage=true`). (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest maxAutoSlippagePercent( + String maxAutoSlippagePercent) { + this.maxAutoSlippagePercent = maxAutoSlippagePercent; + return this; + } + + /** + * Set computeUnitLimit + * + * @param computeUnitLimit Solana only — maximum compute units the transaction may consume + * (analogous to EVM gasLimit). Applies only when + * `binanceChainId=CT_501`. (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest computeUnitLimit(String computeUnitLimit) { + this.computeUnitLimit = computeUnitLimit; + return this; + } + + /** + * Set computeUnitPrice + * + * @param computeUnitPrice Solana only — priority fee per compute unit (micro-lamports), + * analogous to EVM gasPrice. When omitted, the platform computes a value dynamically. + * Applies only when `binanceChainId=CT_501`. (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest computeUnitPrice(String computeUnitPrice) { + this.computeUnitPrice = computeUnitPrice; + return this; + } + + /** + * Set tips + * + * @param tips Solana only — Jito tips in SOL for MEV protection. Valid range [0.000000001, + * 2] (minimum 1 lamport). When specified, it is recommended to set + * `computeUnitPrice=0`. Applies only when + * `binanceChainId=CT_501`. (optional) + * @return QuoteAndBuildSwapTransactionRequest + */ + public QuoteAndBuildSwapTransactionRequest tips(String tips) { + this.tips = tips; + return this; + } } - private okhttp3.Call getTransactionStatusCall( - String binanceChainId, String txHash, Long recvWindow, String nonce) + private okhttp3.Call submitRfqOrderCall( + SubmitRfqOrderRequest submitRfqOrderRequest, Long recvWindow, String nonce) throws ApiException { String basePath = null; // Operation Servers @@ -1357,7 +2969,7 @@ private okhttp3.Call getTransactionStatusCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v1/dex/aggregator/history"; + String localVarPath = "/api/v1/dex/aggregator/order/submit"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1365,13 +2977,24 @@ private okhttp3.Call getTransactionStatusCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (binanceChainId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("binanceChainId", binanceChainId)); + if (submitRfqOrderRequest.getRequestId() != null) { + localVarFormParams.put("requestId", submitRfqOrderRequest.getRequestId()); } - if (txHash != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("txHash", txHash)); + if (submitRfqOrderRequest.getUserSignature() != null) { + localVarFormParams.put("userSignature", submitRfqOrderRequest.getUserSignature()); + } + + if (submitRfqOrderRequest.getVendor() != null) { + localVarFormParams.put("vendor", submitRfqOrderRequest.getVendor()); + } + + if (submitRfqOrderRequest.getQuoteId() != null) { + localVarFormParams.put("quoteId", submitRfqOrderRequest.getQuoteId()); + } + + if (submitRfqOrderRequest.getSigningScheme() != null) { + localVarFormParams.put("signingScheme", submitRfqOrderRequest.getSigningScheme()); } final String[] localVarAccepts = {"application/json"}; @@ -1403,7 +3026,7 @@ private okhttp3.Call getTransactionStatusCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1414,8 +3037,8 @@ private okhttp3.Call getTransactionStatusCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getTransactionStatusValidateBeforeCall( - String binanceChainId, String txHash, Long recvWindow, String nonce) + private okhttp3.Call submitRfqOrderValidateBeforeCall( + SubmitRfqOrderRequest submitRfqOrderRequest, Long recvWindow, String nonce) throws ApiException { try { Validator validator = @@ -1426,20 +3049,19 @@ private okhttp3.Call getTransactionStatusValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {binanceChainId, txHash, recvWindow, nonce}; + Object[] parameterValues = {submitRfqOrderRequest, recvWindow, nonce}; Method method = this.getClass() .getMethod( - "getTransactionStatus", - String.class, - String.class, + "submitRfqOrder", + SubmitRfqOrderRequest.class, Long.class, String.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getTransactionStatusCall(binanceChainId, txHash, recvWindow, nonce); + return submitRfqOrderCall(submitRfqOrderRequest, recvWindow, nonce); } else { throw new ConstraintViolationException((Set) violations); } @@ -1452,74 +3074,15 @@ private okhttp3.Call getTransactionStatusValidateBeforeCall( } } - public ApiResponse getTransactionStatus( - @NotNull String binanceChainId, @NotNull String txHash, Long recvWindow, String nonce) + public ApiResponse submitRfqOrder( + @Valid @NotNull SubmitRfqOrderRequest submitRfqOrderRequest, + Long recvWindow, + String nonce) throws ApiException { okhttp3.Call localVarCall = - getTransactionStatusValidateBeforeCall(binanceChainId, txHash, recvWindow, nonce); + submitRfqOrderValidateBeforeCall(submitRfqOrderRequest, recvWindow, nonce); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - - public ApiResponse getTransactionStatus( - GetTransactionStatusRequest request) { - return getTransactionStatus( - request.getBinanceChainId(), - request.getTxHash(), - request.getRecvWindow(), - request.getNonce()); - } - - public static class GetTransactionStatusRequest { - private final String binanceChainId; - private final String txHash; - private Long recvWindow; - private String nonce; - - public String getBinanceChainId() { - return binanceChainId; - } - - public String getTxHash() { - return txHash; - } - - public Long getRecvWindow() { - return recvWindow; - } - - public String getNonce() { - return nonce; - } - - public GetTransactionStatusRequest(String binanceChainId, String txHash) { - this.binanceChainId = binanceChainId; - this.txHash = txHash; - } - - /** - * Set recvWindow - * - * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). - * (optional) - * @return GetTransactionStatusRequest - */ - public GetTransactionStatusRequest recvWindow(Long recvWindow) { - this.recvWindow = recvWindow; - return this; - } - - /** - * Set nonce - * - * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if - * omitted. (optional) - * @return GetTransactionStatusRequest - */ - public GetTransactionStatusRequest nonce(String nonce) { - this.nonce = nonce; - return this; - } - } } diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/TransactionApi.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/TransactionApi.java index f9edbfd..2e53cc3 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/TransactionApi.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/TransactionApi.java @@ -52,7 +52,7 @@ public class TransactionApi { private static final String USER_AGENT = String.format( - "binance-web3-wallet/2.0.0 (Java/%s; %s; %s)", + "binance-web3-wallet/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -585,6 +585,11 @@ private okhttp3.Call getGasLimitCall( localVarFormParams.put("solTx", json); } + if (getGasLimitRequest.getTronTx() != null) { + String json = JSON.getGson().toJson(getGasLimitRequest.getTronTx()); + localVarFormParams.put("tronTx", json); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1028,6 +1033,11 @@ private okhttp3.Call simulateTransactionsCall( localVarFormParams.put("solTx", json); } + if (simulateTransactionsRequest.getTronTx() != null) { + String json = JSON.getGson().toJson(simulateTransactionsRequest.getTronTx()); + localVarFormParams.put("tronTx", json); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/WalletApi.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/WalletApi.java index 0ed0b3e..fe650d6 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/WalletApi.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/WalletApi.java @@ -49,7 +49,7 @@ public class WalletApi { private static final String USER_AGENT = String.format( - "binance-web3-wallet/2.0.0 (Java/%s; %s; %s)", + "binance-web3-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/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/Web3WalletRestApi.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/Web3WalletRestApi.java index 30cbd42..e9dfdb1 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/Web3WalletRestApi.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/api/Web3WalletRestApi.java @@ -8,46 +8,75 @@ import com.binance.connector.client.web3_wallet.rest.model.ApproveTransaction; import com.binance.connector.client.web3_wallet.rest.model.AutoSlippage; import com.binance.connector.client.web3_wallet.rest.model.Bar; +import com.binance.connector.client.web3_wallet.rest.model.BinanceChainId; import com.binance.connector.client.web3_wallet.rest.model.BroadcastTransactionsRequest; import com.binance.connector.client.web3_wallet.rest.model.BroadcastTransactionsResponse; +import com.binance.connector.client.web3_wallet.rest.model.BuildSolanaSwapInstructionsResponse; import com.binance.connector.client.web3_wallet.rest.model.BuildSwapTransactionResponse; import com.binance.connector.client.web3_wallet.rest.model.GasLevel; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressPnLForSpecificTokenResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressPortfolioOverviewResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressRecentPnLResponse; import com.binance.connector.client.web3_wallet.rest.model.GetAggregatedQuoteResponse; import com.binance.connector.client.web3_wallet.rest.model.GetAggregatorSupportedChainsResponse; import com.binance.connector.client.web3_wallet.rest.model.GetAllTokenBalancesByAddressResponse; import com.binance.connector.client.web3_wallet.rest.model.GetBroadcastOrdersResponse; import com.binance.connector.client.web3_wallet.rest.model.GetCandlesResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetDexTradeHistoryResponse; import com.binance.connector.client.web3_wallet.rest.model.GetErc20ApproveTransactionResponse; import com.binance.connector.client.web3_wallet.rest.model.GetGasLimitRequest; import com.binance.connector.client.web3_wallet.rest.model.GetGasLimitResponse; import com.binance.connector.client.web3_wallet.rest.model.GetGasPriceResponse; import com.binance.connector.client.web3_wallet.rest.model.GetHoldersRankingResponse; import com.binance.connector.client.web3_wallet.rest.model.GetHotTokenListResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetLeaderboardResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetPortfolioSupportedChainsResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRfqOrderStatusResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenIssuancePlatformsResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenListResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenPriceResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaUnderlyingInfoResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaUnderlyingMarketDataResponse; import com.binance.connector.client.web3_wallet.rest.model.GetSupportedChainsResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenAdvancedInfoResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenBalancesByAddressRequest; import com.binance.connector.client.web3_wallet.rest.model.GetTokenBalancesByAddressResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenBasicInfoResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetTokenDevInfoResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenPriceResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenTradesResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTokenTradingInfoResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTopLiquidityPoolsResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTopTradersResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetTrackedTradesResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTransactionDetailByHashResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTransactionStatusResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTransactionSupportedChainsResponse; import com.binance.connector.client.web3_wallet.rest.model.GetTransactionsByAddressResponse; import com.binance.connector.client.web3_wallet.rest.model.GetWalletSupportedChainsResponse; +import com.binance.connector.client.web3_wallet.rest.model.OrderType; +import com.binance.connector.client.web3_wallet.rest.model.PlatformId; +import com.binance.connector.client.web3_wallet.rest.model.QuoteAndBuildSwapTransactionResponse; import com.binance.connector.client.web3_wallet.rest.model.RankBy; import com.binance.connector.client.web3_wallet.rest.model.RankingTimeFrame; +import com.binance.connector.client.web3_wallet.rest.model.SearchRwaTokenResponse; import com.binance.connector.client.web3_wallet.rest.model.SearchTokenResponse; import com.binance.connector.client.web3_wallet.rest.model.SimulateTransactionsRequest; import com.binance.connector.client.web3_wallet.rest.model.SimulateTransactionsResponse; +import com.binance.connector.client.web3_wallet.rest.model.SortBy; +import com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderRequest; +import com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderResponse; import com.binance.connector.client.web3_wallet.rest.model.TagFilter; +import com.binance.connector.client.web3_wallet.rest.model.TimeFrame; +import com.binance.connector.client.web3_wallet.rest.model.TrackerType; +import com.binance.connector.client.web3_wallet.rest.model.Vendor; +import com.binance.connector.client.web3_wallet.rest.model.WalletType; public class Web3WalletRestApi { - private final MarketApi marketApi; + private final AddressPortfolioApi addressPortfolioApi; + private final GeneralDataApi generalDataApi; + private final RwaDataApi rwaDataApi; private final TradingApi tradingApi; private final TransactionApi transactionApi; private final WalletApi walletApi; @@ -57,14 +86,429 @@ public Web3WalletRestApi(ClientConfiguration configuration) { } public Web3WalletRestApi(ApiClient apiClient) { - this.marketApi = new MarketApi(apiClient); + this.addressPortfolioApi = new AddressPortfolioApi(apiClient); + this.generalDataApi = new GeneralDataApi(apiClient); + this.rwaDataApi = new RwaDataApi(apiClient); this.tradingApi = new TradingApi(apiClient); this.transactionApi = new TransactionApi(apiClient); this.walletApi = new WalletApi(apiClient); } - public ApiResponse getCandles(MarketApi.GetCandlesRequest request) { - return marketApi.getCandles(request); + public ApiResponse getAddressPnLForSpecificToken( + AddressPortfolioApi.GetAddressPnLForSpecificTokenRequest request) { + return addressPortfolioApi.getAddressPnLForSpecificToken(request); + } + + /** + * Get Address PnL for Specific Token Return the latest realized PnL detail for a specific token + * held by an address, including buy/sell stats, current balance, and holding duration. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). (required) + * @param walletAddress Wallet address to query. EVM chains accept lowercase 42-character hex + * addresses; Solana accepts base58 addresses (case-sensitive). (required) + * @param tokenContractAddress Token contract address. EVM chains accept lowercase 42-character + * hex addresses; Solana accepts base58 addresses (case-sensitive). (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @return ApiResponse<GetAddressPnLForSpecificTokenResponse> + * @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 Token latest PnL returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * Address PnL for Specific Token Documentation + */ + public ApiResponse getAddressPnLForSpecificToken( + String binanceChainId, + String walletAddress, + String tokenContractAddress, + Long recvWindow, + String nonce) + throws ApiException { + return addressPortfolioApi.getAddressPnLForSpecificToken( + binanceChainId, walletAddress, tokenContractAddress, recvWindow, nonce); + } + + public ApiResponse getAddressPortfolioOverview( + AddressPortfolioApi.GetAddressPortfolioOverviewRequest request) { + return addressPortfolioApi.getAddressPortfolioOverview(request); + } + + /** + * Get Address Portfolio Overview Return trading performance overview for an address within the + * selected time frame, including realized PnL, daily PnL breakdown, win rate, and top 3 + * profitable tokens. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). (required) + * @param walletAddress Wallet address to query. EVM chains accept lowercase 42-character hex + * addresses; Solana accepts base58 addresses (case-sensitive). (required) + * @param timeFrame Statistics time range. 1=1D, 2=7D, 3=1M, 4=3M. Note: + * these values differ from the leaderboard/list endpoint (where 1=7D, 2=1M, + * 3=3M); do not reuse enum knowledge across endpoints. (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @return ApiResponse<GetAddressPortfolioOverviewResponse> + * @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 Portfolio overview returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * Address Portfolio Overview Documentation + */ + public ApiResponse getAddressPortfolioOverview( + String binanceChainId, + String walletAddress, + TimeFrame timeFrame, + Long recvWindow, + String nonce) + throws ApiException { + return addressPortfolioApi.getAddressPortfolioOverview( + binanceChainId, walletAddress, timeFrame, recvWindow, nonce); + } + + public ApiResponse getAddressRecentPnL( + AddressPortfolioApi.GetAddressRecentPnLRequest request) { + return addressPortfolioApi.getAddressRecentPnL(request); + } + + /** + * Get Address Recent PnL Return recent realized PnL list for an address. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). (required) + * @param walletAddress Wallet address to query. EVM chains accept lowercase 42-character hex + * addresses; Solana accepts base58 addresses (case-sensitive). (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @param cursor Pagination cursor. Omit or pass empty string for the first page; pass the + * cursor from the previous response to get the next page. (optional) + * @param limit Number of records per page. Default 20, max 100. (optional) + * @return ApiResponse<GetAddressRecentPnLResponse> + * @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 Recent PnL list returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * Address Recent PnL Documentation + */ + public ApiResponse getAddressRecentPnL( + String binanceChainId, + String walletAddress, + Long recvWindow, + String nonce, + String cursor, + String limit) + throws ApiException { + return addressPortfolioApi.getAddressRecentPnL( + binanceChainId, walletAddress, recvWindow, nonce, cursor, limit); + } + + public ApiResponse getDexTradeHistory( + AddressPortfolioApi.GetDexTradeHistoryRequest request) { + return addressPortfolioApi.getDexTradeHistory(request); + } + + /** + * Get DEX Trade History Return swap trade history for a specific address. Supports filtering by + * time range, token, and trade type. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). (required) + * @param walletAddress Wallet address to query. EVM chains accept lowercase 42-character hex + * addresses; Solana accepts base58 addresses (case-sensitive). (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @param begin Start timestamp (Unix milliseconds, inclusive). If both begin and end are + * omitted, no time filter is applied. (optional) + * @param end End timestamp (Unix milliseconds, inclusive). If both begin and end are omitted, + * no time filter is applied. (optional) + * @param tokenContractAddress Filter by token contract address. Returns all tokens when + * omitted. (optional) + * @param type Trade type filter. 1=Buy, 2=Sell. Omit to return all types. (optional) + * @param cursor Pagination cursor. Omit or pass empty string for the first page. (optional) + * @param limit Number of records per page. Default 20, max 100. (optional) + * @return ApiResponse<GetDexTradeHistoryResponse> + * @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 DEX history returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * DEX Trade History Documentation + */ + public ApiResponse getDexTradeHistory( + String binanceChainId, + String walletAddress, + Long recvWindow, + String nonce, + String begin, + String end, + String tokenContractAddress, + OrderType type, + String cursor, + String limit) + throws ApiException { + return addressPortfolioApi.getDexTradeHistory( + binanceChainId, + walletAddress, + recvWindow, + nonce, + begin, + end, + tokenContractAddress, + type, + cursor, + limit); + } + + public ApiResponse getLeaderboard( + AddressPortfolioApi.GetLeaderboardRequest request) { + return addressPortfolioApi.getLeaderboard(request); + } + + /** + * Get Leaderboard Return a leaderboard of top-performing wallets, with sorting and filtering by + * PnL, win rate, transaction count, and volume. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). Single chain only. + * (required) + * @param timeFrame Statistics time range. 1=7D, 2=1M, 3=3M. Note: these values + * differ from the portfolio/overview endpoint (where 1=1D, 2=7D, 3=1M, + * 4=3M); do not reuse enum knowledge across endpoints. (required) + * @param sortBy Sort field. 1=Realized PnL (USD), 2=Win Rate, 3=Transaction + * count, 4=Volume (USD), 5=Realized PnL %. (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @param walletType Wallet type filter, single selection only. 1=Smart Money, 2=KOL, + * 3=Hot List. Returns all types when omitted. (optional) + * @param minRealizedPnlUsd Minimum realized PnL filter, denominated in USD. (optional) + * @param maxRealizedPnlUsd Maximum realized PnL filter, denominated in USD. (optional) + * @param minWinRatePercent Minimum win rate filter, without percent sign. \"50\" + * means ≥50%. (optional) + * @param maxWinRatePercent Maximum win rate filter, without percent sign. \"90\" + * means ≤90%. (optional) + * @param minTxs Minimum transaction count filter. (optional) + * @param maxTxs Maximum transaction count filter. (optional) + * @param minTxVolume Minimum total transaction volume filter, denominated in USD. (optional) + * @param maxTxVolume Maximum total transaction volume filter, denominated in USD. (optional) + * @param cursor Pagination cursor. Omit or pass empty string for the first page. (optional) + * @param limit Number of records per page. Default 50, max 50. (optional) + * @return ApiResponse<GetLeaderboardResponse> + * @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 Leaderboard list returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * Leaderboard Documentation + */ + public ApiResponse getLeaderboard( + String binanceChainId, + TimeFrame timeFrame, + SortBy sortBy, + Long recvWindow, + String nonce, + WalletType walletType, + String minRealizedPnlUsd, + String maxRealizedPnlUsd, + String minWinRatePercent, + String maxWinRatePercent, + String minTxs, + String maxTxs, + String minTxVolume, + String maxTxVolume, + String cursor, + String limit) + throws ApiException { + return addressPortfolioApi.getLeaderboard( + binanceChainId, + timeFrame, + sortBy, + recvWindow, + nonce, + walletType, + minRealizedPnlUsd, + maxRealizedPnlUsd, + minWinRatePercent, + maxWinRatePercent, + minTxs, + maxTxs, + minTxVolume, + maxTxVolume, + cursor, + limit); + } + + public ApiResponse getPortfolioSupportedChains( + AddressPortfolioApi.GetPortfolioSupportedChainsRequest request) { + return addressPortfolioApi.getPortfolioSupportedChains(request); + } + + /** + * Get Portfolio Supported Chains Return the list of blockchains supported by address portfolio + * analysis. + * + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @return ApiResponse<GetPortfolioSupportedChainsResponse> + * @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 Supported chains returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * Portfolio Supported Chains Documentation + */ + public ApiResponse getPortfolioSupportedChains( + Long recvWindow, String nonce) throws ApiException { + return addressPortfolioApi.getPortfolioSupportedChains(recvWindow, nonce); + } + + public ApiResponse getTrackedTrades( + AddressPortfolioApi.GetTrackedTradesRequest request) { + return addressPortfolioApi.getTrackedTrades(request); + } + + /** + * Get Tracked Trades Return the latest swap trades from tracked addresses (smart money, KOL, or + * custom address list). + * + * @param trackerType Tracker type. 1=Smart Money, 2=KOL, 3=Custom address list + * (walletAddress required). (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @param walletAddress Required when trackerType=3. One or more wallet addresses, + * comma-separated, up to 20. EVM chains accept lowercase 42-character hex addresses; Solana + * accepts base58 addresses (case-sensitive). (optional) + * @param tradeType Trade type filter. 0=All (default), 1=Buy, 2=Sell, 3=Add + * position, 4=Reduce position, 5=Open position, 6=Close position, + * 7=Transfer in, 8=Transfer out. Multiple values comma-separated. (optional) + * @param binanceChainId Filter by chain. Returns all chains when omitted. (optional) + * @param minVolume Minimum trade volume filter, denominated in USD. (optional) + * @param maxVolume Maximum trade volume filter, denominated in USD. (optional) + * @param minMarketCap Minimum market cap filter, denominated in USD. (optional) + * @param maxMarketCap Maximum market cap filter, denominated in USD. (optional) + * @param isHideRiskToken Whether to hide risk tokens. true=hide risk tokens (default), + * false=show all tokens including risk tokens. (optional) + * @param limit Maximum number of trades to return. Effective only for trackerType=3 + * (custom address list); trackerType=1/2 ignore this and use the downstream public + * query fixed cap. Omit to use the downstream default. (optional) + * @return ApiResponse<GetTrackedTradesResponse> + * @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 Address tracker trades returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * Tracked Trades Documentation + */ + public ApiResponse getTrackedTrades( + TrackerType trackerType, + Long recvWindow, + String nonce, + String walletAddress, + String tradeType, + String binanceChainId, + String minVolume, + String maxVolume, + String minMarketCap, + String maxMarketCap, + Boolean isHideRiskToken, + Integer limit) + throws ApiException { + return addressPortfolioApi.getTrackedTrades( + trackerType, + recvWindow, + nonce, + walletAddress, + tradeType, + binanceChainId, + minVolume, + maxVolume, + minMarketCap, + maxMarketCap, + isHideRiskToken, + limit); + } + + public ApiResponse getCandles(GeneralDataApi.GetCandlesRequest request) { + return generalDataApi.getCandles(request); } /** @@ -101,7 +545,7 @@ public ApiResponse getCandles(MarketApi.GetCandlesRequest re * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-candles">Get * Candles Documentation */ public ApiResponse getCandles( @@ -114,13 +558,13 @@ public ApiResponse getCandles( Long before, Integer limit) throws ApiException { - return marketApi.getCandles( + return generalDataApi.getCandles( binanceChainId, tokenContractAddress, recvWindow, nonce, bar, after, before, limit); } public ApiResponse getHoldersRanking( - MarketApi.GetHoldersRankingRequest request) { - return marketApi.getHoldersRanking(request); + GeneralDataApi.GetHoldersRankingRequest request) { + return generalDataApi.getHoldersRanking(request); } /** @@ -152,7 +596,7 @@ public ApiResponse getHoldersRanking( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-holders-ranking">Get * Holders Ranking Documentation */ public ApiResponse getHoldersRanking( @@ -162,13 +606,13 @@ public ApiResponse getHoldersRanking( String nonce, TagFilter tagFilter) throws ApiException { - return marketApi.getHoldersRanking( + return generalDataApi.getHoldersRanking( binanceChainId, tokenContractAddress, recvWindow, nonce, tagFilter); } public ApiResponse getHotTokenList( - MarketApi.GetHotTokenListRequest request) { - return marketApi.getHotTokenList(request); + GeneralDataApi.GetHotTokenListRequest request) { + return generalDataApi.getHotTokenList(request); } /** @@ -176,12 +620,11 @@ public ApiResponse getHotTokenList( * market cap, etc., with filters for holding distribution, developer behavior, liquidity, and * more. * + * @param binanceChainId Chain identifier. Single value only. (required) * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). * (optional) * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. * (optional) - * @param binanceChainId Chain identifier. Single value only. Omit to return mixed results - * across all chains. (optional) * @param rankBy Ranking field. 1=price, 2=price change, 3=transactions, * 4=volume, 5=market cap, 6=liquidity, 7=creation time, 8=holders, * 9=Binance MPC wallet holders, 10=net inflow. (optional) @@ -280,13 +723,13 @@ public ApiResponse getHotTokenList( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-hot-token-list">Get * Hot Token List Documentation */ public ApiResponse getHotTokenList( + String binanceChainId, Long recvWindow, String nonce, - String binanceChainId, RankBy rankBy, RankingTimeFrame rankingTimeFrame, String priceChangePercentMin, @@ -339,10 +782,10 @@ public ApiResponse getHotTokenList( Integer pageId, Integer size) throws ApiException { - return marketApi.getHotTokenList( + return generalDataApi.getHotTokenList( + binanceChainId, recvWindow, nonce, - binanceChainId, rankBy, rankingTimeFrame, priceChangePercentMin, @@ -397,8 +840,8 @@ public ApiResponse getHotTokenList( } public ApiResponse getSupportedChains( - MarketApi.GetSupportedChainsRequest request) { - return marketApi.getSupportedChains(request); + GeneralDataApi.GetSupportedChainsRequest request) { + return generalDataApi.getSupportedChains(request); } /** @@ -422,17 +865,17 @@ public ApiResponse getSupportedChains( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-supported-chains">Get * Supported Chains Documentation */ public ApiResponse getSupportedChains(Long recvWindow, String nonce) throws ApiException { - return marketApi.getSupportedChains(recvWindow, nonce); + return generalDataApi.getSupportedChains(recvWindow, nonce); } public ApiResponse getTokenAdvancedInfo( - MarketApi.GetTokenAdvancedInfoRequest request) { - return marketApi.getTokenAdvancedInfo(request); + GeneralDataApi.GetTokenAdvancedInfoRequest request) { + return generalDataApi.getTokenAdvancedInfo(request); } /** @@ -460,19 +903,19 @@ public ApiResponse getTokenAdvancedInfo( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-advanced-info">Get * Token Advanced Info Documentation */ public ApiResponse getTokenAdvancedInfo( String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) throws ApiException { - return marketApi.getTokenAdvancedInfo( + return generalDataApi.getTokenAdvancedInfo( binanceChainId, tokenContractAddress, recvWindow, nonce); } public ApiResponse getTokenBasicInfo( - MarketApi.GetTokenBasicInfoRequest request) { - return marketApi.getTokenBasicInfo(request); + GeneralDataApi.GetTokenBasicInfoRequest request) { + return generalDataApi.getTokenBasicInfo(request); } /** @@ -500,18 +943,60 @@ public ApiResponse getTokenBasicInfo( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-basic-info">Get * Token Basic Info Documentation */ public ApiResponse getTokenBasicInfo( String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) throws ApiException { - return marketApi.getTokenBasicInfo(binanceChainId, tokenContractAddress, recvWindow, nonce); + return generalDataApi.getTokenBasicInfo( + binanceChainId, tokenContractAddress, recvWindow, nonce); + } + + public ApiResponse getTokenDevInfo( + GeneralDataApi.GetTokenDevInfoRequest request) { + return generalDataApi.getTokenDevInfo(request); + } + + /** + * Get Token Dev Info Return developer profile for a token, including historical token launch + * stats, current holding percentage, and initial funding source. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). (required) + * @param tokenContractAddress Token contract address. EVM chains accept lowercase 42-character + * hex addresses; Solana accepts base58 addresses (case-sensitive). (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @return ApiResponse<GetTokenDevInfoResponse> + * @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 Token dev info returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * Token Dev Info Documentation + */ + public ApiResponse getTokenDevInfo( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + throws ApiException { + return generalDataApi.getTokenDevInfo( + binanceChainId, tokenContractAddress, recvWindow, nonce); } public ApiResponse getTokenPrice( - MarketApi.GetTokenPriceRequest request) { - return marketApi.getTokenPrice(request); + GeneralDataApi.GetTokenPriceRequest request) { + return generalDataApi.getTokenPrice(request); } /** @@ -537,17 +1022,17 @@ public ApiResponse getTokenPrice( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-price">Get * Token Price Documentation */ public ApiResponse getTokenPrice(Long recvWindow, String nonce) throws ApiException { - return marketApi.getTokenPrice(recvWindow, nonce); + return generalDataApi.getTokenPrice(recvWindow, nonce); } public ApiResponse getTokenTrades( - MarketApi.GetTokenTradesRequest request) { - return marketApi.getTokenTrades(request); + GeneralDataApi.GetTokenTradesRequest request) { + return generalDataApi.getTokenTrades(request); } /** @@ -584,7 +1069,7 @@ public ApiResponse getTokenTrades( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-trades">Get * Token Trades Documentation */ public ApiResponse getTokenTrades( @@ -597,7 +1082,7 @@ public ApiResponse getTokenTrades( TagFilter tagFilter, String walletAddressFilter) throws ApiException { - return marketApi.getTokenTrades( + return generalDataApi.getTokenTrades( binanceChainId, tokenContractAddress, recvWindow, @@ -609,8 +1094,8 @@ public ApiResponse getTokenTrades( } public ApiResponse getTokenTradingInfo( - MarketApi.GetTokenTradingInfoRequest request) { - return marketApi.getTokenTradingInfo(request); + GeneralDataApi.GetTokenTradingInfoRequest request) { + return generalDataApi.getTokenTradingInfo(request); } /** @@ -636,17 +1121,17 @@ public ApiResponse getTokenTradingInfo( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-token-trading-info">Get * Token Trading Info Documentation */ public ApiResponse getTokenTradingInfo( Long recvWindow, String nonce) throws ApiException { - return marketApi.getTokenTradingInfo(recvWindow, nonce); + return generalDataApi.getTokenTradingInfo(recvWindow, nonce); } public ApiResponse getTopLiquidityPools( - MarketApi.GetTopLiquidityPoolsRequest request) { - return marketApi.getTopLiquidityPools(request); + GeneralDataApi.GetTopLiquidityPoolsRequest request) { + return generalDataApi.getTopLiquidityPools(request); } /** @@ -673,19 +1158,19 @@ public ApiResponse getTopLiquidityPools( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-top-liquidity-pools">Get * Top Liquidity Pools Documentation */ public ApiResponse getTopLiquidityPools( String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) throws ApiException { - return marketApi.getTopLiquidityPools( + return generalDataApi.getTopLiquidityPools( binanceChainId, tokenContractAddress, recvWindow, nonce); } public ApiResponse getTopTraders( - MarketApi.GetTopTradersRequest request) { - return marketApi.getTopTraders(request); + GeneralDataApi.GetTopTradersRequest request) { + return generalDataApi.getTopTraders(request); } /** @@ -717,7 +1202,7 @@ public ApiResponse getTopTraders( * * * @see Get + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#get-top-traders">Get * Top Traders Documentation */ public ApiResponse getTopTraders( @@ -727,12 +1212,12 @@ public ApiResponse getTopTraders( String nonce, TagFilter tagFilter) throws ApiException { - return marketApi.getTopTraders( + return generalDataApi.getTopTraders( binanceChainId, tokenContractAddress, recvWindow, nonce, tagFilter); } - public ApiResponse searchToken(MarketApi.SearchTokenRequest request) { - return marketApi.searchToken(request); + public ApiResponse searchToken(GeneralDataApi.SearchTokenRequest request) { + return generalDataApi.searchToken(request); } /** @@ -758,17 +1243,365 @@ public ApiResponse searchToken(MarketApi.SearchTokenRequest * * * @see Search + * href="https://web3.binance.com/en/dev-docs/catalog/web3-wallet/api/rest-api/general-data#search-token">Search * Token Documentation */ public ApiResponse searchToken( String chains, String search, Long recvWindow, String nonce) throws ApiException { - return marketApi.searchToken(chains, search, recvWindow, nonce); + return generalDataApi.searchToken(chains, search, recvWindow, nonce); } - public ApiResponse buildSwapTransaction( - TradingApi.BuildSwapTransactionRequest request) { - return tradingApi.buildSwapTransaction(request); + public ApiResponse getRwaTokenIssuancePlatforms( + RwaDataApi.GetRwaTokenIssuancePlatformsRequest request) { + return rwaDataApi.getRwaTokenIssuancePlatforms(request); + } + + /** + * Get RWA Token Issuance Platforms Return the list of supported RWA token issuance platforms + * and their basic info. + * + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. (optional) + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @param platformId Platform identifier (ondo=Ondo Finance, bstock=bStocks). + * Optional. If not specified, returns all platforms; when specified, returns only that + * platform. (optional) + * @return ApiResponse<GetRwaTokenIssuancePlatformsResponse> + * @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 RWA token issuance platform list returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * RWA Token Issuance Platforms Documentation + */ + public ApiResponse getRwaTokenIssuancePlatforms( + Long recvWindow, String nonce, PlatformId platformId) throws ApiException { + return rwaDataApi.getRwaTokenIssuancePlatforms(recvWindow, nonce, platformId); + } + + public ApiResponse getRwaTokenList( + RwaDataApi.GetRwaTokenListRequest request) { + return rwaDataApi.getRwaTokenList(request); + } + + /** + * Get RWA Token List Get the list of RWA tokens with underlying asset info. Supports filtering + * by platform and sector tab. + * + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. (optional) + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). Optional. If not specified, + * returns data from all chains. (optional) + * @param platformId Platform filter (ondo=Ondo Finance, bstock=bStocks). Optional. If + * not specified, returns all platforms. (optional) + * @param tabId Sector tab filter. Optional. If not specified, returns all sectors. Enum: + * 1=Serenity Call, 2=SpaceX (SpaceX-related and commercial spaceflight concept + * stocks), 3=Upcoming Earnings, 4=AI Chips, 5=Storage, 6=Energy, + * 7=Precious Metals, 8=China ADR (Chinese companies listed in the US), + * 9=Magnificent 7 (the seven largest US tech giants: Apple, Microsoft, Alphabet, + * Amazon, Nvidia, Meta, Tesla), 10=Crypto, 11=ETF, 12=Tech Leaders, + * 13=Buffett Portfolio. (optional) + * @return ApiResponse<GetRwaTokenListResponse> + * @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 RWA token list returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * RWA Token List Documentation + */ + public ApiResponse getRwaTokenList( + Long recvWindow, + String nonce, + String binanceChainId, + PlatformId platformId, + Integer tabId) + throws ApiException { + return rwaDataApi.getRwaTokenList(recvWindow, nonce, binanceChainId, platformId, tabId); + } + + public ApiResponse getRwaTokenPrice( + RwaDataApi.GetRwaTokenPriceRequest request) { + return rwaDataApi.getRwaTokenPrice(request); + } + + /** + * Get RWA Token Price Batch query RWA token prices, including on-chain price and underlying + * reference price. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). (required) + * @param tokenContractAddresses Comma-separated token contract addresses. Maximum 100 per + * request. (required) + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. (optional) + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return ApiResponse<GetRwaTokenPriceResponse> + * @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 Quote data returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * RWA Token Price Documentation + */ + public ApiResponse getRwaTokenPrice( + String binanceChainId, String tokenContractAddresses, Long recvWindow, String nonce) + throws ApiException { + return rwaDataApi.getRwaTokenPrice( + binanceChainId, tokenContractAddresses, recvWindow, nonce); + } + + public ApiResponse getRwaUnderlyingInfo( + RwaDataApi.GetRwaUnderlyingInfoRequest request) { + return rwaDataApi.getRwaUnderlyingInfo(request); + } + + /** + * Get RWA Underlying Info Get the underlying company information for an RWA token. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). (required) + * @param tokenContractAddress Token contract address. (required) + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. (optional) + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return ApiResponse<GetRwaUnderlyingInfoResponse> + * @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 Token detail returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * RWA Underlying Info Documentation + */ + public ApiResponse getRwaUnderlyingInfo( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + throws ApiException { + return rwaDataApi.getRwaUnderlyingInfo( + binanceChainId, tokenContractAddress, recvWindow, nonce); + } + + public ApiResponse getRwaUnderlyingMarketData( + RwaDataApi.GetRwaUnderlyingMarketDataRequest request) { + return rwaDataApi.getRwaUnderlyingMarketData(request); + } + + /** + * Get RWA Underlying Market Data Get market data for the underlying asset of an RWA token. + * + * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, + * \"56\"=BSC, \"CT_501\"=Solana). (required) + * @param tokenContractAddress Token contract address. (required) + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. (optional) + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @return ApiResponse<GetRwaUnderlyingMarketDataResponse> + * @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 Underlying market data returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * RWA Underlying Market Data Documentation + */ + public ApiResponse getRwaUnderlyingMarketData( + String binanceChainId, String tokenContractAddress, Long recvWindow, String nonce) + throws ApiException { + return rwaDataApi.getRwaUnderlyingMarketData( + binanceChainId, tokenContractAddress, recvWindow, nonce); + } + + public ApiResponse searchRwaToken( + RwaDataApi.SearchRwaTokenRequest request) { + return rwaDataApi.searchRwaToken(request); + } + + /** + * Search RWA Token Search RWA tokens by keyword or contract address. + * + * @param keyword Search keyword (ticker, company name, or contract address). Case-insensitive. + * (required) + * @param recvWindow Allowed time deviation in milliseconds. Default 5000, max 60000. (optional) + * @param nonce Unique request identifier to prevent replay attacks. Falls back to X-OC-SIGN + * when omitted. (optional) + * @param platformId Platform filter (ondo=Ondo Finance, bstock=bStocks). Optional. If + * not specified, returns results from all platforms. (optional) + * @return ApiResponse<SearchRwaTokenResponse> + * @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 Ticker lookup results returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Search + * RWA Token Documentation + */ + public ApiResponse searchRwaToken( + String keyword, Long recvWindow, String nonce, PlatformId platformId) + throws ApiException { + return rwaDataApi.searchRwaToken(keyword, recvWindow, nonce, platformId); + } + + public ApiResponse buildSolanaSwapInstructions( + TradingApi.BuildSolanaSwapInstructionsRequest request) { + return tradingApi.buildSolanaSwapInstructions(request); + } + + /** + * Build Solana Swap Instructions Solana-only counterpart to `/swap`. Shares the full + * quote → route → vendor `buildSwapTx` → priceImpact → minReceive → + * instruction-assembly pipeline; the only difference is the response: instead of returning a + * signed-and-serialized base64 transaction, this endpoint returns the **uncompiled** + * instruction list plus the address-lookup-table (ALT) address list, leaving v0-transaction + * compilation, signing, and submission to the caller. Use this when the caller needs to: - + * prepend / append their own instructions (e.g. fee splitting, custom logging) before signing; + * - reuse the platform-curated route, slippage, PS-variant rewriting, ALT injection, + * ComputeBudget overwrite, and ATA batching while still controlling the final wire format. Only + * supports `binanceChainId=CT_501` (Solana). Other chains return + * `CHAIN_NOT_SUPPORTED` (40411). Parameters mirror the Solana subset of + * `/swap` (no EVM-only `approveTransaction` / `approveAmount` / + * `gasLimit`). + * + * @param binanceChainId Chain identifier. Only `CT_501` (Solana) is accepted; other + * values return `CHAIN_NOT_SUPPORTED` (40411). (required) + * @param amount Sell-token amount in the token's smallest unit (positive integer string, no + * decimals). (required) + * @param fromTokenAddress Sell-token mint address (Solana Base58, case-sensitive). (required) + * @param toTokenAddress Buy-token mint address (Solana Base58, case-sensitive). (required) + * @param slippagePercent Maximum slippage as a percentage. Solana range 0 to less than 100. + * \"0.5\" means 0.5%. (required) + * @param userWalletAddress User wallet address (Solana Base58); becomes the v0 + * transaction's `feePayer`. (required) + * @param quoteId quoteId returned from `/quote` for the route to execute. TTL ~30s; + * expired entries return `QUOTE_EXPIRED` (40401). (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @param priceImpactProtectionPercent Maximum allowed price impact percentage (0–100). Defaults + * to 90; set to 100 to disable. (optional) + * @param autoSlippage When \"true\", slippage is auto-derived from market data and + * overrides `slippagePercent`. Defaults to false. (optional) + * @param maxAutoSlippagePercent Cap on auto-derived slippage (only applies when + * `autoSlippage=true`). (optional) + * @param computeUnitLimit Maximum compute units the transaction may consume (analogous to EVM + * gasLimit). Defaults to the platform value when omitted. (optional) + * @param computeUnitPrice Priority fee per compute unit (micro-lamports). When omitted, the + * platform computes a value either from the `gasLevel` tier or from chain-side + * defaults. (optional) + * @param gasLevel Priority-fee tier; consulted only when `computeUnitPrice` is + * omitted. Defaults to \"average\". (optional) + * @param tips Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] (minimum 1 + * lamport). When specified, it is recommended to set `computeUnitPrice=0`. + * The platform picks one of Jito's tip accounts at random per request. (optional) + * @return ApiResponse<BuildSolanaSwapInstructionsResponse> + * @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 Uncompiled Solana instruction list and ALT addresses returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Build + * Solana Swap Instructions Documentation + */ + public ApiResponse buildSolanaSwapInstructions( + BinanceChainId binanceChainId, + String amount, + String fromTokenAddress, + String toTokenAddress, + String slippagePercent, + String userWalletAddress, + String quoteId, + Long recvWindow, + String nonce, + String priceImpactProtectionPercent, + AutoSlippage autoSlippage, + String maxAutoSlippagePercent, + String computeUnitLimit, + String computeUnitPrice, + GasLevel gasLevel, + String tips) + throws ApiException { + return tradingApi.buildSolanaSwapInstructions( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + slippagePercent, + userWalletAddress, + quoteId, + recvWindow, + nonce, + priceImpactProtectionPercent, + autoSlippage, + maxAutoSlippagePercent, + computeUnitLimit, + computeUnitPrice, + gasLevel, + tips); + } + + public ApiResponse buildSwapTransaction( + TradingApi.BuildSwapTransactionRequest request) { + return tradingApi.buildSwapTransaction(request); } /** @@ -783,8 +1616,6 @@ public ApiResponse buildSwapTransaction( * decimals). (required) * @param fromTokenAddress Sell-token contract address. (required) * @param toTokenAddress Buy-token contract address. (required) - * @param slippagePercent Maximum slippage as a percentage. EVM range 0–100; Solana range 0 to - * less than 100. \"0.5\" means 0.5%. (required) * @param userWalletAddress User wallet address (transaction sender). (required) * @param quoteId quoteId returned from `/quote` for the route to execute. TTL ~30s; * expired entries return `QUOTE_EXPIRED` (40401). (required) @@ -792,6 +1623,18 @@ public ApiResponse buildSwapTransaction( * (optional) * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. * (optional) + * @param slippagePercent Maximum slippage tolerance as a percentage string. Required unless + * `autoSlippage=true`. **Range by chain:** - EVM chains (BSC, Ethereum, + * Base, etc.): `0` to `100` (inclusive) - Solana (`CT_501`): + * `0` to less than `100` (i.e. `< 100`) **Range by + * vendor:** - 1inch, PancakeSwap: `0` to `50` (values above 50 are + * rejected) - LiFi, LiquidMesh: `0` to `100` (EVM) or `0` to + * `< 100` (Solana) - Jupiter (Solana): `0` to less than + * `100`; the value is converted to basis points (`slippageBps = + * ceil(slippagePercent × 100)`) and applied to the on-chain swap + * `\"0.5\"` means 0.5% maximum slippage. When + * `autoSlippage=true` this field is overridden by the auto-computed value. + * (optional) * @param approveTransaction When \"true\", `signatureData` includes the * spender address and approve calldata so the client can submit it before the swap. * Defaults to false. (optional) @@ -801,8 +1644,10 @@ public ApiResponse buildSwapTransaction( * @param gasLevel Gas price tier. Defaults to \"average\". (optional) * @param priceImpactProtectionPercent Maximum allowed price impact percentage (0–100). Defaults * to 90; set to 100 to disable. (optional) - * @param autoSlippage When \"true\", slippage is auto-derived from market data and - * overrides `slippagePercent`. Defaults to false. (optional) + * @param autoSlippage When `\"true\"`, slippage is auto-derived from market + * data and overrides `slippagePercent`. Either `slippagePercent` or + * `autoSlippage=true` must be provided — omitting both returns a parameter + * error. Defaults to `\"false\"`. (optional) * @param maxAutoSlippagePercent Cap on auto-derived slippage (only applies when * `autoSlippage=true`). (optional) * @param computeUnitLimit Solana only — maximum compute units the transaction may consume @@ -837,11 +1682,11 @@ public ApiResponse buildSwapTransaction( String amount, String fromTokenAddress, String toTokenAddress, - String slippagePercent, String userWalletAddress, String quoteId, Long recvWindow, String nonce, + String slippagePercent, ApproveTransaction approveTransaction, String approveAmount, String gasLimit, @@ -858,11 +1703,11 @@ public ApiResponse buildSwapTransaction( amount, fromTokenAddress, toTokenAddress, - slippagePercent, userWalletAddress, quoteId, recvWindow, nonce, + slippagePercent, approveTransaction, approveAmount, gasLimit, @@ -898,6 +1743,10 @@ public ApiResponse getAggregatedQuote( * (optional) * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. * (optional) + * @param userWalletAddress User wallet address. Required when quoting RFQ routes (equity / RWA + * tokens such as Ondo and BStock). This address is used as the receiver in the RFQ order + * and must match the wallet that signs `rfq.typedDataToSign` in the subsequent + * `/swap` call. (optional) * @return ApiResponse<GetAggregatedQuoteResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -921,10 +1770,17 @@ public ApiResponse getAggregatedQuote( String fromTokenAddress, String toTokenAddress, Long recvWindow, - String nonce) + String nonce, + String userWalletAddress) throws ApiException { return tradingApi.getAggregatedQuote( - binanceChainId, amount, fromTokenAddress, toTokenAddress, recvWindow, nonce); + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + recvWindow, + nonce, + userWalletAddress); } public ApiResponse getAggregatorSupportedChains( @@ -986,6 +1842,15 @@ public ApiResponse getErc20ApproveTransactio * (optional) * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. * (optional) + * @param vendor RFQ vendor name. **Required for equity / RWA tokens (Ondo, BStock)**; pass the + * `vendorName` from the `/quote` response (e.g. `InchFusion`, + * `CowSwap`, `PcsXRfq`). When provided, the backend returns approve + * calldata targeting the vendor-specific spender contract (e.g. 1inch Router, PcsX Permit2, + * CowSwap VaultRelayer) instead of the default DEX router. For regular (non-RWA) tokens, + * this parameter is optional. If omitted, the backend uses the standard DEX router. If a + * valid RFQ vendor is passed, the backend resolves that vendor's spender — used when + * buying Ondo/BStock with a stablecoin, where the from-token (e.g. USDT) itself is not an + * RFQ token but must be approved to the RFQ vendor's router. (optional) * @return ApiResponse<GetErc20ApproveTransactionResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1008,10 +1873,49 @@ public ApiResponse getErc20ApproveTransactio String tokenContractAddress, String approveAmount, Long recvWindow, - String nonce) + String nonce, + String vendor) throws ApiException { return tradingApi.getErc20ApproveTransaction( - binanceChainId, tokenContractAddress, approveAmount, recvWindow, nonce); + binanceChainId, tokenContractAddress, approveAmount, recvWindow, nonce, vendor); + } + + public ApiResponse getRfqOrderStatus( + TradingApi.GetRfqOrderStatusRequest request) { + return tradingApi.getRfqOrderStatus(request); + } + + /** + * Get RFQ Order Status Query the settlement status of an RFQ order by its platform + * `orderId` (returned by `POST /order/submit`). Poll this endpoint until + * `status` reaches a terminal state: `FILLED` (settled on-chain) or + * `FAILED` (settlement failed). + * + * @param orderId Platform order ID returned by `POST /order/submit`. (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @return ApiResponse<GetRfqOrderStatusResponse> + * @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 Order status returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Get + * RFQ Order Status Documentation + */ + public ApiResponse getRfqOrderStatus( + String orderId, Long recvWindow, String nonce) throws ApiException { + return tradingApi.getRfqOrderStatus(orderId, recvWindow, nonce); } public ApiResponse getTransactionStatus( @@ -1058,12 +1962,174 @@ public ApiResponse getTransactionStatus( return tradingApi.getTransactionStatus(binanceChainId, txHash, recvWindow, nonce); } + public ApiResponse quoteAndBuildSwapTransaction( + TradingApi.QuoteAndBuildSwapTransactionRequest request) { + return tradingApi.quoteAndBuildSwapTransaction(request); + } + + /** + * Quote and Build Swap Transaction (Flash API) Combines quoting and swap-transaction + * construction into a single call. Unlike the two-step `/quote` + `/swap` + * flow, this endpoint does not require a prior `/quote` call or a `quoteId` + * — it returns the executable calldata / swapTransaction directly, eliminating one HTTP + * round-trip. Use this endpoint for latency-sensitive trading when the vendor is known upfront. + * The response shape is identical to `/swap`, so clients can reuse the same response + * parsing logic for both endpoints. + * + * @param binanceChainId Unique chain identifier (e.g. \"56\"=BSC, + * \"1\"=Ethereum, \"CT_501\"=Solana). (required) + * @param amount Sell-token amount in the token's smallest unit (positive integer string, no + * decimals). (required) + * @param fromTokenAddress Sell-token contract address. (required) + * @param toTokenAddress Buy-token contract address. (required) + * @param userWalletAddress User wallet address (transaction sender). For Solana, a Base58 + * system-account address with sufficient SOL for gas. (required) + * @param vendor Swap vendor to use for this request. **Required** — case-sensitive; must match + * one of the enum values. Any other value returns `PARAM_ERROR` (40001). For + * multi-vendor aggregation, use `/swap` with a `quoteId` instead. + * (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @param slippagePercent Maximum slippage tolerance as a percentage string. Required unless + * `autoSlippage=true`. **Range by chain:** - EVM chains (BSC, Ethereum, + * Base, etc.): `0` to `100` (inclusive) - Solana (`CT_501`): + * `0` to less than `100` (i.e. `< 100`) + * `\"0.5\"` means 0.5% maximum slippage. When + * `autoSlippage=true` this field is overridden by the auto-computed value. + * (optional) + * @param approveTransaction When \"true\", `signatureData` includes the + * spender address and approve calldata so the client can submit it before the swap. + * Defaults to false. (optional) + * @param approveAmount Override approve amount (smallest unit, positive integer string). + * Defaults to the swap amount. (optional) + * @param gasLimit Gas limit override (positive integer string). EVM only. (optional) + * @param gasLevel Gas price tier. Defaults to \"average\". (optional) + * @param priceImpactProtectionPercent Maximum allowed price impact percentage (0–100). Defaults + * to 90; set to 100 to disable. (optional) + * @param autoSlippage When `\"true\"`, slippage is auto-derived from market + * data and overrides `slippagePercent`. Either `slippagePercent` or + * `autoSlippage=true` must be provided — omitting both returns a parameter + * error. Defaults to `\"false\"`. (optional) + * @param maxAutoSlippagePercent Cap on auto-derived slippage (only applies when + * `autoSlippage=true`). (optional) + * @param computeUnitLimit Solana only — maximum compute units the transaction may consume + * (analogous to EVM gasLimit). Applies only when `binanceChainId=CT_501`. + * (optional) + * @param computeUnitPrice Solana only — priority fee per compute unit (micro-lamports), + * analogous to EVM gasPrice. When omitted, the platform computes a value dynamically. + * Applies only when `binanceChainId=CT_501`. (optional) + * @param tips Solana only — Jito tips in SOL for MEV protection. Valid range [0.000000001, 2] + * (minimum 1 lamport). When specified, it is recommended to set + * `computeUnitPrice=0`. Applies only when + * `binanceChainId=CT_501`. (optional) + * @return ApiResponse<QuoteAndBuildSwapTransactionResponse> + * @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 Swap transaction data returned successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Quote + * and Build Swap Transaction (Flash API) Documentation + */ + public ApiResponse quoteAndBuildSwapTransaction( + String binanceChainId, + String amount, + String fromTokenAddress, + String toTokenAddress, + String userWalletAddress, + Vendor vendor, + Long recvWindow, + String nonce, + String slippagePercent, + ApproveTransaction approveTransaction, + String approveAmount, + String gasLimit, + GasLevel gasLevel, + String priceImpactProtectionPercent, + AutoSlippage autoSlippage, + String maxAutoSlippagePercent, + String computeUnitLimit, + String computeUnitPrice, + String tips) + throws ApiException { + return tradingApi.quoteAndBuildSwapTransaction( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + userWalletAddress, + vendor, + recvWindow, + nonce, + slippagePercent, + approveTransaction, + approveAmount, + gasLimit, + gasLevel, + priceImpactProtectionPercent, + autoSlippage, + maxAutoSlippagePercent, + computeUnitLimit, + computeUnitPrice, + tips); + } + + /** + * Submit RFQ Order Submit a signed RFQ order to the backend for on-chain settlement via the + * corresponding vendor relayer. Only used when `executionMode=RFQ` (equity / RWA + * tokens such as Ondo and BStock). **Flow**: `GET /quote` → pick an RFQ route → + * `GET /swap` → sign `rfq.typedDataToSign` with EIP-712 + * (`eth_signTypedData_v4`) → call this endpoint → poll `GET + * /order/{orderId}` until `FILLED` or `FAILED`. **Idempotency**: + * Submitting with the same `requestId` within 30 minutes returns the original result + * without re-calling the vendor. Use a new UUID for each distinct order; reuse the same UUID + * when retrying. + * + * @param submitRfqOrderRequest (required) + * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). + * (optional) + * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. + * (optional) + * @return ApiResponse<SubmitRfqOrderResponse> + * @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 RFQ order submitted successfully. -
401 Unauthorized. The request is missing or contains an invalid API key. -
403 Forbidden. The API key does not have permission to access this endpoint. -
404 Not Found. The requested resource or endpoint does not exist. -
+ * + * @see Submit + * RFQ Order Documentation + */ + public ApiResponse submitRfqOrder( + SubmitRfqOrderRequest submitRfqOrderRequest, Long recvWindow, String nonce) + throws ApiException { + return tradingApi.submitRfqOrder(submitRfqOrderRequest, recvWindow, nonce); + } + /** * Broadcast Transactions Broadcast a client-signed transaction to the chain via the Binance * Web3 API relay. Returns the transaction hash and an internal `orderId` you can use * to track on-chain status via the post-transaction service. Optional MEV protection (EVM * chains only) routes the transaction through a private mempool to mitigate front-running and - * sandwich attacks. + * sandwich attacks. Tron and Solana do not support MEV protection; the flag is ignored on these + * chains. * * @param broadcastTransactionsRequest (required) * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -1152,8 +2218,11 @@ public ApiResponse getBroadcastOrders( /** * Get Gas Limit Estimate the gas limit (or compute-unit ceiling on Solana) for an unsigned - * transaction. Provide either `evmTx` for EVM chains or `solTx` for Solana, - * matching the value of `binanceChainId`. + * transaction. Provide either `evmTx` for EVM chains, `solTx` for Solana, + * or `tronTx` for Tron (\"CT_195\"), matching the value of + * `binanceChainId`. On Tron the response carries energy/bandwidth fields instead of a + * single gas limit; `gasLimit` is the fee limit (in sun) and the energy/bandwidth + * fields describe resource consumption and pricing. * * @param getGasLimitRequest (required) * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). @@ -1191,11 +2260,14 @@ public ApiResponse getGasPrice(TransactionApi.GetGasPriceRe * Get Gas Price Query the current network gas price for the specified chain. The response shape * varies by chain family: - EVM chains return both `evmLegacyGasPrice` (legacy * gasPrice) and `eip1559GasPrice` (baseFee + priority/max fees) when EIP-1559 is - * supported. - Solana returns `solanaGasPrice` (compute-unit prices and Jito tips). - * Fields not applicable to the chain family are returned as `null`. + * supported. - Solana returns `solanaGasPrice` (compute-unit prices and Jito tips). - + * Tron (\"CT_195\") returns an empty `data` object because Tron has no + * on-chain gas-price concept; use the gas-limit endpoint instead. Fields not applicable to the + * chain family are returned as `null`. * * @param binanceChainId Unique chain identifier (e.g. \"1\"=Ethereum, - * \"56\"=BSC, \"CT_501\"=Solana). (required) + * \"56\"=BSC, \"CT_501\"=Solana, + * \"CT_195\"=Tron). (required) * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). * (optional) * @param nonce Unique request identifier for anti-replay; falls back to X-OC-SIGN if omitted. @@ -1262,8 +2334,10 @@ public ApiResponse getTransactionSupporte * Simulate Transactions Simulate transaction execution off-chain to predict its outcome before * broadcasting. The response includes the predicted execution status, balance changes per * affected account/token, and ERC-20 allowance changes (EVM chains). Provide either - * `evmTx` (EVM chains) or `solTx` (Solana) matching - * `binanceChainId`. + * `evmTx` (EVM chains), `solTx` (Solana), or `tronTx` (Tron + * \"CT_195\") matching `binanceChainId`. On Tron, + * `allowanceChanges` is returned as an empty array. Note: Metis (chainId 1088) is not + * supported by this endpoint. * * @param simulateTransactionsRequest (required) * @param recvWindow Allowed time deviation in milliseconds (default: 5000, max: 60000). diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BinanceChainId.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BinanceChainId.java new file mode 100644 index 0000000..245765f --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BinanceChainId.java @@ -0,0 +1,71 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets binanceChainId */ +@JsonAdapter(BinanceChainId.Adapter.class) +public enum BinanceChainId { + CT_501("CT_501"); + + private String value; + + BinanceChainId(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BinanceChainId fromValue(String value) { + for (BinanceChainId b : BinanceChainId.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BinanceChainId enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BinanceChainId read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BinanceChainId.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BinanceChainId.fromValue(value); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BroadcastTransactionsRequest.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BroadcastTransactionsRequest.java index b87bdba..efdf154 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BroadcastTransactionsRequest.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BroadcastTransactionsRequest.java @@ -70,7 +70,7 @@ public BroadcastTransactionsRequest binanceChainId( /** * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, - * \"CT_501\"=Solana). + * \"CT_501\"=Solana, \"CT_195\"=Tron). * * @return binanceChainId */ @@ -91,8 +91,20 @@ public BroadcastTransactionsRequest signedTransaction( } /** - * Client-signed raw transaction. EVM chains use a hex-encoded RLP transaction; Solana uses a - * base64-encoded signed transaction. + * Client-signed raw transaction. Format depends on `binanceChainId`: - **EVM + * chains**: hex-encoded RLP transaction (e.g. `0xf86c...`). - **Solana + * (`CT_501`)**: base64-encoded signed transaction. - **Tron (`CT_195`)**: + * JSON string of the signed transaction returned by a Tron signer, containing + * `raw_data` (with `contract[].parameter.value.owner_address`) and a + * `signature` array. Example: + * `{\"raw_data\":{\"contract\":[{\"type\":\"TriggerSmartContract\",\"parameter\":{\"value\":{\"owner_address\":\"T...\",\"contract_address\":\"T...\",\"data\":\"<calldata + * hex>\",\"call_value\":0}}}]},\"signature\":[\"...\"]}`. + * Note for Tron: `signedTransaction` is NOT the calldata hex passed to + * `simulate` / `getGasLimit` under + * `tronTx.triggerSmartContractParams.data`. The signer is extracted from + * `raw_data.contract[0].parameter.value.owner_address` and must match + * `address`; passing calldata hex here will be rejected with `code=40001, + * invalid signedTransaction: failed to parse Tron signedTransaction: syntax error`. * * @return signedTransaction */ @@ -112,7 +124,8 @@ public BroadcastTransactionsRequest address(@jakarta.annotation.Nonnull String a } /** - * Sender wallet address. Used for status attribution and signature verification. + * Sender wallet address. Used for status attribution and signature verification. On Tron and + * Solana the address is case-sensitive base58check. * * @return address */ diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BroadcastTransactionsResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BroadcastTransactionsResponseData.java index 6eed464..82b579b 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BroadcastTransactionsResponseData.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BroadcastTransactionsResponseData.java @@ -76,7 +76,8 @@ public BroadcastTransactionsResponseData txHash(@jakarta.annotation.Nullable Str } /** - * On-chain transaction hash. + * On-chain transaction hash. EVM chains return a hex hash; Tron returns a base58check hash; + * Solana returns a base58 hash. * * @return txHash */ diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponse.java new file mode 100644 index 0000000..f9b3b0c --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponse.java @@ -0,0 +1,355 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** BuildSolanaSwapInstructionsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private BuildSolanaSwapInstructionsResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public BuildSolanaSwapInstructionsResponse() {} + + public BuildSolanaSwapInstructionsResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public BuildSolanaSwapInstructionsResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public BuildSolanaSwapInstructionsResponse data( + @jakarta.annotation.Nullable BuildSolanaSwapInstructionsResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public BuildSolanaSwapInstructionsResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable BuildSolanaSwapInstructionsResponseData data) { + this.data = data; + } + + public BuildSolanaSwapInstructionsResponse timestamp( + @jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public BuildSolanaSwapInstructionsResponse 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; + } + BuildSolanaSwapInstructionsResponse buildSolanaSwapInstructionsResponse = + (BuildSolanaSwapInstructionsResponse) o; + return Objects.equals(this.code, buildSolanaSwapInstructionsResponse.code) + && Objects.equals(this.msg, buildSolanaSwapInstructionsResponse.msg) + && Objects.equals(this.data, buildSolanaSwapInstructionsResponse.data) + && Objects.equals(this.timestamp, buildSolanaSwapInstructionsResponse.timestamp) + && Objects.equals(this.success, buildSolanaSwapInstructionsResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuildSolanaSwapInstructionsResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * BuildSolanaSwapInstructionsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BuildSolanaSwapInstructionsResponse is" + + " not found in the empty JSON string", + BuildSolanaSwapInstructionsResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + BuildSolanaSwapInstructionsResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BuildSolanaSwapInstructionsResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(BuildSolanaSwapInstructionsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BuildSolanaSwapInstructionsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSolanaSwapInstructionsResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSolanaSwapInstructionsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BuildSolanaSwapInstructionsResponse + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponse + */ + public static BuildSolanaSwapInstructionsResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, BuildSolanaSwapInstructionsResponse.class); + } + + /** + * Convert an instance of BuildSolanaSwapInstructionsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseData.java new file mode 100644 index 0000000..69fbb6d --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseData.java @@ -0,0 +1,409 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** BuildSolanaSwapInstructionsResponseData */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseData { + public static final String SERIALIZED_NAME_ADDRESS_LOOKUP_TABLE_ACCOUNT = + "addressLookupTableAccount"; + + @SerializedName(SERIALIZED_NAME_ADDRESS_LOOKUP_TABLE_ACCOUNT) + @jakarta.annotation.Nullable + private List addressLookupTableAccount; + + public static final String SERIALIZED_NAME_INSTRUCTION_LISTS = "instructionLists"; + + @SerializedName(SERIALIZED_NAME_INSTRUCTION_LISTS) + @jakarta.annotation.Nullable + private List<@Valid BuildSolanaSwapInstructionsResponseDataInstructionListsInner> + instructionLists; + + public static final String SERIALIZED_NAME_ROUTER_RESULT = "routerResult"; + + @SerializedName(SERIALIZED_NAME_ROUTER_RESULT) + @jakarta.annotation.Nullable + private BuildSolanaSwapInstructionsResponseDataRouterResult routerResult; + + public static final String SERIALIZED_NAME_TX = "tx"; + + @SerializedName(SERIALIZED_NAME_TX) + @jakarta.annotation.Nullable + private BuildSolanaSwapInstructionsResponseDataTx tx; + + public BuildSolanaSwapInstructionsResponseData() {} + + public BuildSolanaSwapInstructionsResponseData addressLookupTableAccount( + @jakarta.annotation.Nullable List addressLookupTableAccount) { + this.addressLookupTableAccount = addressLookupTableAccount; + return this; + } + + public BuildSolanaSwapInstructionsResponseData addAddressLookupTableAccountItem( + String addressLookupTableAccountItem) { + if (this.addressLookupTableAccount == null) { + this.addressLookupTableAccount = new ArrayList<>(); + } + this.addressLookupTableAccount.add(addressLookupTableAccountItem); + return this; + } + + /** + * Address Lookup Table addresses (Base58) referenced by the transaction, including the + * platform-injected custom ALT. The caller must fetch each ALT account + * (`getAccountInfo`) and pass the parsed lookup data when compiling the v0 message. + * + * @return addressLookupTableAccount + */ + @jakarta.annotation.Nullable + public List getAddressLookupTableAccount() { + return addressLookupTableAccount; + } + + public void setAddressLookupTableAccount( + @jakarta.annotation.Nullable List addressLookupTableAccount) { + this.addressLookupTableAccount = addressLookupTableAccount; + } + + public BuildSolanaSwapInstructionsResponseData instructionLists( + @jakarta.annotation.Nullable + List<@Valid BuildSolanaSwapInstructionsResponseDataInstructionListsInner> + instructionLists) { + this.instructionLists = instructionLists; + return this; + } + + public BuildSolanaSwapInstructionsResponseData addInstructionListsItem( + BuildSolanaSwapInstructionsResponseDataInstructionListsInner instructionListsItem) { + if (this.instructionLists == null) { + this.instructionLists = new ArrayList<>(); + } + this.instructionLists.add(instructionListsItem); + return this; + } + + /** + * Ordered uncompiled instructions to assemble into the v0 transaction. + * + * @return instructionLists + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid BuildSolanaSwapInstructionsResponseDataInstructionListsInner> + getInstructionLists() { + return instructionLists; + } + + public void setInstructionLists( + @jakarta.annotation.Nullable + List<@Valid BuildSolanaSwapInstructionsResponseDataInstructionListsInner> + instructionLists) { + this.instructionLists = instructionLists; + } + + public BuildSolanaSwapInstructionsResponseData routerResult( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResult routerResult) { + this.routerResult = routerResult; + return this; + } + + /** + * Get routerResult + * + * @return routerResult + */ + @jakarta.annotation.Nullable + @Valid + public BuildSolanaSwapInstructionsResponseDataRouterResult getRouterResult() { + return routerResult; + } + + public void setRouterResult( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResult routerResult) { + this.routerResult = routerResult; + } + + public BuildSolanaSwapInstructionsResponseData tx( + @jakarta.annotation.Nullable BuildSolanaSwapInstructionsResponseDataTx tx) { + this.tx = tx; + return this; + } + + /** + * Get tx + * + * @return tx + */ + @jakarta.annotation.Nullable + @Valid + public BuildSolanaSwapInstructionsResponseDataTx getTx() { + return tx; + } + + public void setTx(@jakarta.annotation.Nullable BuildSolanaSwapInstructionsResponseDataTx tx) { + this.tx = tx; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseData buildSolanaSwapInstructionsResponseData = + (BuildSolanaSwapInstructionsResponseData) o; + return Objects.equals( + this.addressLookupTableAccount, + buildSolanaSwapInstructionsResponseData.addressLookupTableAccount) + && Objects.equals( + this.instructionLists, + buildSolanaSwapInstructionsResponseData.instructionLists) + && Objects.equals( + this.routerResult, buildSolanaSwapInstructionsResponseData.routerResult) + && Objects.equals(this.tx, buildSolanaSwapInstructionsResponseData.tx); + } + + @Override + public int hashCode() { + return Objects.hash(addressLookupTableAccount, instructionLists, routerResult, tx); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuildSolanaSwapInstructionsResponseData {\n"); + sb.append(" addressLookupTableAccount: ") + .append(toIndentedString(addressLookupTableAccount)) + .append("\n"); + sb.append(" instructionLists: ").append(toIndentedString(instructionLists)).append("\n"); + sb.append(" routerResult: ").append(toIndentedString(routerResult)).append("\n"); + sb.append(" tx: ").append(toIndentedString(tx)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object addressLookupTableAccountValue = getAddressLookupTableAccount(); + String addressLookupTableAccountValueAsString = ""; + addressLookupTableAccountValueAsString = + (String) + ((Collection) addressLookupTableAccountValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("addressLookupTableAccount=") + .append(urlEncode(addressLookupTableAccountValueAsString)) + .append(""); + Object instructionListsValue = getInstructionLists(); + String instructionListsValueAsString = ""; + instructionListsValueAsString = + (String) + ((Collection) instructionListsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("instructionLists=").append(urlEncode(instructionListsValueAsString)).append(""); + Object routerResultValue = getRouterResult(); + String routerResultValueAsString = ""; + routerResultValueAsString = routerResultValue.toString(); + sb.append("routerResult=").append(urlEncode(routerResultValueAsString)).append(""); + Object txValue = getTx(); + String txValueAsString = ""; + txValueAsString = txValue.toString(); + sb.append("tx=").append(urlEncode(txValueAsString)).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("addressLookupTableAccount"); + openapiFields.add("instructionLists"); + openapiFields.add("routerResult"); + openapiFields.add("tx"); + + // 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 + * BuildSolanaSwapInstructionsResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseData is not found in the" + + " empty JSON string", + BuildSolanaSwapInstructionsResponseData.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("addressLookupTableAccount") != null + && !jsonObj.get("addressLookupTableAccount").isJsonNull() + && !jsonObj.get("addressLookupTableAccount").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `addressLookupTableAccount` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("addressLookupTableAccount").toString())); + } + if (jsonObj.get("instructionLists") != null + && !jsonObj.get("instructionLists").isJsonNull()) { + JsonArray jsonArrayinstructionLists = jsonObj.getAsJsonArray("instructionLists"); + if (jsonArrayinstructionLists != null) { + // ensure the json data is an array + if (!jsonObj.get("instructionLists").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `instructionLists` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("instructionLists").toString())); + } + + // validate the optional field `instructionLists` (array) + for (int i = 0; i < jsonArrayinstructionLists.size(); i++) { + BuildSolanaSwapInstructionsResponseDataInstructionListsInner + .validateJsonElement(jsonArrayinstructionLists.get(i)); + } + ; + } + } + // validate the optional field `routerResult` + if (jsonObj.get("routerResult") != null && !jsonObj.get("routerResult").isJsonNull()) { + BuildSolanaSwapInstructionsResponseDataRouterResult.validateJsonElement( + jsonObj.get("routerResult")); + } + // validate the optional field `tx` + if (jsonObj.get("tx") != null && !jsonObj.get("tx").isJsonNull()) { + BuildSolanaSwapInstructionsResponseDataTx.validateJsonElement(jsonObj.get("tx")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseData.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'BuildSolanaSwapInstructionsResponseData' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(BuildSolanaSwapInstructionsResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, BuildSolanaSwapInstructionsResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSolanaSwapInstructionsResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSolanaSwapInstructionsResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of BuildSolanaSwapInstructionsResponseData + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseData + */ + public static BuildSolanaSwapInstructionsResponseData fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, BuildSolanaSwapInstructionsResponseData.class); + } + + /** + * Convert an instance of BuildSolanaSwapInstructionsResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataInstructionListsInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataInstructionListsInner.java new file mode 100644 index 0000000..fe105af --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataInstructionListsInner.java @@ -0,0 +1,367 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** BuildSolanaSwapInstructionsResponseDataInstructionListsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataInstructionListsInner { + public static final String SERIALIZED_NAME_PROGRAM_ID = "programId"; + + @SerializedName(SERIALIZED_NAME_PROGRAM_ID) + @jakarta.annotation.Nullable + private String programId; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private String data; + + public static final String SERIALIZED_NAME_ACCOUNTS = "accounts"; + + @SerializedName(SERIALIZED_NAME_ACCOUNTS) + @jakarta.annotation.Nullable + private List<@Valid BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner> + accounts; + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInner() {} + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInner programId( + @jakarta.annotation.Nullable String programId) { + this.programId = programId; + return this; + } + + /** + * Program that owns the instruction (Base58). + * + * @return programId + */ + @jakarta.annotation.Nullable + public String getProgramId() { + return programId; + } + + public void setProgramId(@jakarta.annotation.Nullable String programId) { + this.programId = programId; + } + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInner data( + @jakarta.annotation.Nullable String data) { + this.data = data; + return this; + } + + /** + * Instruction data, Base64-encoded. May be an empty string for instructions without data. + * + * @return data + */ + @jakarta.annotation.Nullable + public String getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable String data) { + this.data = data; + } + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInner accounts( + @jakarta.annotation.Nullable + List< + @Valid + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner> + accounts) { + this.accounts = accounts; + return this; + } + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInner addAccountsItem( + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); + } + this.accounts.add(accountsItem); + return this; + } + + /** + * Accounts referenced by the instruction, in ABI order. + * + * @return accounts + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner> + getAccounts() { + return accounts; + } + + public void setAccounts( + @jakarta.annotation.Nullable + List< + @Valid + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner> + accounts) { + this.accounts = accounts; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataInstructionListsInner + buildSolanaSwapInstructionsResponseDataInstructionListsInner = + (BuildSolanaSwapInstructionsResponseDataInstructionListsInner) o; + return Objects.equals( + this.programId, + buildSolanaSwapInstructionsResponseDataInstructionListsInner.programId) + && Objects.equals( + this.data, + buildSolanaSwapInstructionsResponseDataInstructionListsInner.data) + && Objects.equals( + this.accounts, + buildSolanaSwapInstructionsResponseDataInstructionListsInner.accounts); + } + + @Override + public int hashCode() { + return Objects.hash(programId, data, accounts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuildSolanaSwapInstructionsResponseDataInstructionListsInner {\n"); + sb.append(" programId: ").append(toIndentedString(programId)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object programIdValue = getProgramId(); + String programIdValueAsString = ""; + programIdValueAsString = programIdValue.toString(); + sb.append("programId=").append(urlEncode(programIdValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object accountsValue = getAccounts(); + String accountsValueAsString = ""; + accountsValueAsString = + (String) + ((Collection) accountsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("accounts=").append(urlEncode(accountsValueAsString)).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("programId"); + openapiFields.add("data"); + openapiFields.add("accounts"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataInstructionListsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataInstructionListsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataInstructionListsInner" + + " is not found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataInstructionListsInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("programId") != null && !jsonObj.get("programId").isJsonNull()) + && !jsonObj.get("programId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `programId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("programId").toString())); + } + if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) + && !jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `data` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("data").toString())); + } + if (jsonObj.get("accounts") != null && !jsonObj.get("accounts").isJsonNull()) { + JsonArray jsonArrayaccounts = jsonObj.getAsJsonArray("accounts"); + if (jsonArrayaccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("accounts").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `accounts` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("accounts").toString())); + } + + // validate the optional field `accounts` (array) + for (int i = 0; i < jsonArrayaccounts.size(); i++) { + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .validateJsonElement(jsonArrayaccounts.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataInstructionListsInner.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataInstructionListsInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataInstructionListsInner + .class)); + + return (TypeAdapter) + new TypeAdapter< + BuildSolanaSwapInstructionsResponseDataInstructionListsInner>() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataInstructionListsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSolanaSwapInstructionsResponseDataInstructionListsInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSolanaSwapInstructionsResponseDataInstructionListsInner given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of BuildSolanaSwapInstructionsResponseDataInstructionListsInner + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataInstructionListsInner + */ + public static BuildSolanaSwapInstructionsResponseDataInstructionListsInner fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + BuildSolanaSwapInstructionsResponseDataInstructionListsInner.class); + } + + /** + * Convert an instance of BuildSolanaSwapInstructionsResponseDataInstructionListsInner to an + * JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.java new file mode 100644 index 0000000..6f1d852 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.java @@ -0,0 +1,321 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner { + public static final String SERIALIZED_NAME_PUBKEY = "pubkey"; + + @SerializedName(SERIALIZED_NAME_PUBKEY) + @jakarta.annotation.Nullable + private String pubkey; + + public static final String SERIALIZED_NAME_IS_SIGNER = "isSigner"; + + @SerializedName(SERIALIZED_NAME_IS_SIGNER) + @jakarta.annotation.Nullable + private Boolean isSigner; + + public static final String SERIALIZED_NAME_IS_WRITABLE = "isWritable"; + + @SerializedName(SERIALIZED_NAME_IS_WRITABLE) + @jakarta.annotation.Nullable + private Boolean isWritable; + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner() {} + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner pubkey( + @jakarta.annotation.Nullable String pubkey) { + this.pubkey = pubkey; + return this; + } + + /** + * Account public key (Base58). + * + * @return pubkey + */ + @jakarta.annotation.Nullable + public String getPubkey() { + return pubkey; + } + + public void setPubkey(@jakarta.annotation.Nullable String pubkey) { + this.pubkey = pubkey; + } + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner isSigner( + @jakarta.annotation.Nullable Boolean isSigner) { + this.isSigner = isSigner; + return this; + } + + /** + * Whether the account must sign the transaction. + * + * @return isSigner + */ + @jakarta.annotation.Nullable + public Boolean getIsSigner() { + return isSigner; + } + + public void setIsSigner(@jakarta.annotation.Nullable Boolean isSigner) { + this.isSigner = isSigner; + } + + public BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner isWritable( + @jakarta.annotation.Nullable Boolean isWritable) { + this.isWritable = isWritable; + return this; + } + + /** + * Whether the account is writable. + * + * @return isWritable + */ + @jakarta.annotation.Nullable + public Boolean getIsWritable() { + return isWritable; + } + + public void setIsWritable(@jakarta.annotation.Nullable Boolean isWritable) { + this.isWritable = isWritable; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + buildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner = + (BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner) + o; + return Objects.equals( + this.pubkey, + buildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .pubkey) + && Objects.equals( + this.isSigner, + buildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .isSigner) + && Objects.equals( + this.isWritable, + buildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .isWritable); + } + + @Override + public int hashCode() { + return Objects.hash(pubkey, isSigner, isWritable); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner" + + " {\n"); + sb.append(" pubkey: ").append(toIndentedString(pubkey)).append("\n"); + sb.append(" isSigner: ").append(toIndentedString(isSigner)).append("\n"); + sb.append(" isWritable: ").append(toIndentedString(isWritable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object pubkeyValue = getPubkey(); + String pubkeyValueAsString = ""; + pubkeyValueAsString = pubkeyValue.toString(); + sb.append("pubkey=").append(urlEncode(pubkeyValueAsString)).append(""); + Object isSignerValue = getIsSigner(); + String isSignerValueAsString = ""; + isSignerValueAsString = isSignerValue.toString(); + sb.append("isSigner=").append(urlEncode(isSignerValueAsString)).append(""); + Object isWritableValue = getIsWritable(); + String isWritableValueAsString = ""; + isWritableValueAsString = isWritableValue.toString(); + sb.append("isWritable=").append(urlEncode(isWritableValueAsString)).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("pubkey"); + openapiFields.add("isSigner"); + openapiFields.add("isWritable"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner" + + " is not found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("pubkey") != null && !jsonObj.get("pubkey").isJsonNull()) + && !jsonObj.get("pubkey").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pubkey` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("pubkey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter< + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner> + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .class)); + + return (TypeAdapter) + new TypeAdapter< + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner>() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of + * BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of + * BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + */ + public static BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + fromJson(String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner + .class); + } + + /** + * Convert an instance of + * BuildSolanaSwapInstructionsResponseDataInstructionListsInnerAccountsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResult.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResult.java new file mode 100644 index 0000000..f6d8462 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResult.java @@ -0,0 +1,740 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.Arrays; +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.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Routing result (same shape and semantics as `/swap`'s `routerResult`). + */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataRouterResult { + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_VENDOR_NAME = "vendorName"; + + @SerializedName(SERIALIZED_NAME_VENDOR_NAME) + @jakarta.annotation.Nullable + private String vendorName; + + public static final String SERIALIZED_NAME_FROM_TOKEN_AMOUNT = "fromTokenAmount"; + + @SerializedName(SERIALIZED_NAME_FROM_TOKEN_AMOUNT) + @jakarta.annotation.Nullable + private String fromTokenAmount; + + public static final String SERIALIZED_NAME_TO_TOKEN_AMOUNT = "toTokenAmount"; + + @SerializedName(SERIALIZED_NAME_TO_TOKEN_AMOUNT) + @jakarta.annotation.Nullable + private String toTokenAmount; + + public static final String SERIALIZED_NAME_TRADE_FEE = "tradeFee"; + + @SerializedName(SERIALIZED_NAME_TRADE_FEE) + @jakarta.annotation.Nullable + private String tradeFee; + + public static final String SERIALIZED_NAME_ESTIMATE_GAS_FEE = "estimateGasFee"; + + @SerializedName(SERIALIZED_NAME_ESTIMATE_GAS_FEE) + @jakarta.annotation.Nullable + private String estimateGasFee; + + public static final String SERIALIZED_NAME_ROUTER = "router"; + + @SerializedName(SERIALIZED_NAME_ROUTER) + @jakarta.annotation.Nullable + private String router; + + public static final String SERIALIZED_NAME_PRICE_IMPACT_PERCENT = "priceImpactPercent"; + + @SerializedName(SERIALIZED_NAME_PRICE_IMPACT_PERCENT) + @jakarta.annotation.Nullable + private String priceImpactPercent; + + public static final String SERIALIZED_NAME_DEX_ROUTER_LIST = "dexRouterList"; + + @SerializedName(SERIALIZED_NAME_DEX_ROUTER_LIST) + @jakarta.annotation.Nullable + private List<@Valid BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner> + dexRouterList; + + public static final String SERIALIZED_NAME_FROM_TOKEN = "fromToken"; + + @SerializedName(SERIALIZED_NAME_FROM_TOKEN) + @jakarta.annotation.Nullable + private BuildSolanaSwapInstructionsResponseDataRouterResultFromToken fromToken; + + public static final String SERIALIZED_NAME_TO_TOKEN = "toToken"; + + @SerializedName(SERIALIZED_NAME_TO_TOKEN) + @jakarta.annotation.Nullable + private BuildSolanaSwapInstructionsResponseDataRouterResultToToken toToken; + + public BuildSolanaSwapInstructionsResponseDataRouterResult() {} + + public BuildSolanaSwapInstructionsResponseDataRouterResult binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Chain identifier (always `CT_501`). + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult vendorName( + @jakarta.annotation.Nullable String vendorName) { + this.vendorName = vendorName; + return this; + } + + /** + * Vendor that supplied the executed quote (Solana vendors include Jupiter, LiquidMesh). + * + * @return vendorName + */ + @jakarta.annotation.Nullable + public String getVendorName() { + return vendorName; + } + + public void setVendorName(@jakarta.annotation.Nullable String vendorName) { + this.vendorName = vendorName; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult fromTokenAmount( + @jakarta.annotation.Nullable String fromTokenAmount) { + this.fromTokenAmount = fromTokenAmount; + return this; + } + + /** + * Sell-token amount (smallest unit, integer string). + * + * @return fromTokenAmount + */ + @jakarta.annotation.Nullable + public String getFromTokenAmount() { + return fromTokenAmount; + } + + public void setFromTokenAmount(@jakarta.annotation.Nullable String fromTokenAmount) { + this.fromTokenAmount = fromTokenAmount; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult toTokenAmount( + @jakarta.annotation.Nullable String toTokenAmount) { + this.toTokenAmount = toTokenAmount; + return this; + } + + /** + * Estimated buy-token amount (smallest unit, integer string). + * + * @return toTokenAmount + */ + @jakarta.annotation.Nullable + public String getToTokenAmount() { + return toTokenAmount; + } + + public void setToTokenAmount(@jakarta.annotation.Nullable String toTokenAmount) { + this.toTokenAmount = toTokenAmount; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult tradeFee( + @jakarta.annotation.Nullable String tradeFee) { + this.tradeFee = tradeFee; + return this; + } + + /** + * Estimated network fee in USD. + * + * @return tradeFee + */ + @jakarta.annotation.Nullable + public String getTradeFee() { + return tradeFee; + } + + public void setTradeFee(@jakarta.annotation.Nullable String tradeFee) { + this.tradeFee = tradeFee; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult estimateGasFee( + @jakarta.annotation.Nullable String estimateGasFee) { + this.estimateGasFee = estimateGasFee; + return this; + } + + /** + * Estimated compute units for the transaction (echoes `computeUnitLimit`). + * + * @return estimateGasFee + */ + @jakarta.annotation.Nullable + public String getEstimateGasFee() { + return estimateGasFee; + } + + public void setEstimateGasFee(@jakarta.annotation.Nullable String estimateGasFee) { + this.estimateGasFee = estimateGasFee; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult router( + @jakarta.annotation.Nullable String router) { + this.router = router; + return this; + } + + /** + * Routing path description, mints joined with \"--\". + * + * @return router + */ + @jakarta.annotation.Nullable + public String getRouter() { + return router; + } + + public void setRouter(@jakarta.annotation.Nullable String router) { + this.router = router; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult priceImpactPercent( + @jakarta.annotation.Nullable String priceImpactPercent) { + this.priceImpactPercent = priceImpactPercent; + return this; + } + + /** + * Price impact percentage. + * + * @return priceImpactPercent + */ + @jakarta.annotation.Nullable + public String getPriceImpactPercent() { + return priceImpactPercent; + } + + public void setPriceImpactPercent(@jakarta.annotation.Nullable String priceImpactPercent) { + this.priceImpactPercent = priceImpactPercent; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult dexRouterList( + @jakarta.annotation.Nullable + List< + @Valid + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner> + dexRouterList) { + this.dexRouterList = dexRouterList; + return this; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult addDexRouterListItem( + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + dexRouterListItem) { + if (this.dexRouterList == null) { + this.dexRouterList = new ArrayList<>(); + } + this.dexRouterList.add(dexRouterListItem); + return this; + } + + /** + * Routing path segments (same shape as `/quote`'s `dexRouterList`). + * + * @return dexRouterList + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner> + getDexRouterList() { + return dexRouterList; + } + + public void setDexRouterList( + @jakarta.annotation.Nullable + List< + @Valid + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner> + dexRouterList) { + this.dexRouterList = dexRouterList; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult fromToken( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken fromToken) { + this.fromToken = fromToken; + return this; + } + + /** + * Get fromToken + * + * @return fromToken + */ + @jakarta.annotation.Nullable + @Valid + public BuildSolanaSwapInstructionsResponseDataRouterResultFromToken getFromToken() { + return fromToken; + } + + public void setFromToken( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken fromToken) { + this.fromToken = fromToken; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResult toToken( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultToToken toToken) { + this.toToken = toToken; + return this; + } + + /** + * Get toToken + * + * @return toToken + */ + @jakarta.annotation.Nullable + @Valid + public BuildSolanaSwapInstructionsResponseDataRouterResultToToken getToToken() { + return toToken; + } + + public void setToToken( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultToToken toToken) { + this.toToken = toToken; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataRouterResult + buildSolanaSwapInstructionsResponseDataRouterResult = + (BuildSolanaSwapInstructionsResponseDataRouterResult) o; + return Objects.equals( + this.binanceChainId, + buildSolanaSwapInstructionsResponseDataRouterResult.binanceChainId) + && Objects.equals( + this.vendorName, + buildSolanaSwapInstructionsResponseDataRouterResult.vendorName) + && Objects.equals( + this.fromTokenAmount, + buildSolanaSwapInstructionsResponseDataRouterResult.fromTokenAmount) + && Objects.equals( + this.toTokenAmount, + buildSolanaSwapInstructionsResponseDataRouterResult.toTokenAmount) + && Objects.equals( + this.tradeFee, buildSolanaSwapInstructionsResponseDataRouterResult.tradeFee) + && Objects.equals( + this.estimateGasFee, + buildSolanaSwapInstructionsResponseDataRouterResult.estimateGasFee) + && Objects.equals( + this.router, buildSolanaSwapInstructionsResponseDataRouterResult.router) + && Objects.equals( + this.priceImpactPercent, + buildSolanaSwapInstructionsResponseDataRouterResult.priceImpactPercent) + && Objects.equals( + this.dexRouterList, + buildSolanaSwapInstructionsResponseDataRouterResult.dexRouterList) + && Objects.equals( + this.fromToken, + buildSolanaSwapInstructionsResponseDataRouterResult.fromToken) + && Objects.equals( + this.toToken, buildSolanaSwapInstructionsResponseDataRouterResult.toToken); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + binanceChainId, + vendorName, + fromTokenAmount, + toTokenAmount, + tradeFee, + estimateGasFee, + router, + priceImpactPercent, + dexRouterList, + fromToken, + toToken); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuildSolanaSwapInstructionsResponseDataRouterResult {\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" vendorName: ").append(toIndentedString(vendorName)).append("\n"); + sb.append(" fromTokenAmount: ").append(toIndentedString(fromTokenAmount)).append("\n"); + sb.append(" toTokenAmount: ").append(toIndentedString(toTokenAmount)).append("\n"); + sb.append(" tradeFee: ").append(toIndentedString(tradeFee)).append("\n"); + sb.append(" estimateGasFee: ").append(toIndentedString(estimateGasFee)).append("\n"); + sb.append(" router: ").append(toIndentedString(router)).append("\n"); + sb.append(" priceImpactPercent: ") + .append(toIndentedString(priceImpactPercent)) + .append("\n"); + sb.append(" dexRouterList: ").append(toIndentedString(dexRouterList)).append("\n"); + sb.append(" fromToken: ").append(toIndentedString(fromToken)).append("\n"); + sb.append(" toToken: ").append(toIndentedString(toToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object vendorNameValue = getVendorName(); + String vendorNameValueAsString = ""; + vendorNameValueAsString = vendorNameValue.toString(); + sb.append("vendorName=").append(urlEncode(vendorNameValueAsString)).append(""); + Object fromTokenAmountValue = getFromTokenAmount(); + String fromTokenAmountValueAsString = ""; + fromTokenAmountValueAsString = fromTokenAmountValue.toString(); + sb.append("fromTokenAmount=").append(urlEncode(fromTokenAmountValueAsString)).append(""); + Object toTokenAmountValue = getToTokenAmount(); + String toTokenAmountValueAsString = ""; + toTokenAmountValueAsString = toTokenAmountValue.toString(); + sb.append("toTokenAmount=").append(urlEncode(toTokenAmountValueAsString)).append(""); + Object tradeFeeValue = getTradeFee(); + String tradeFeeValueAsString = ""; + tradeFeeValueAsString = tradeFeeValue.toString(); + sb.append("tradeFee=").append(urlEncode(tradeFeeValueAsString)).append(""); + Object estimateGasFeeValue = getEstimateGasFee(); + String estimateGasFeeValueAsString = ""; + estimateGasFeeValueAsString = estimateGasFeeValue.toString(); + sb.append("estimateGasFee=").append(urlEncode(estimateGasFeeValueAsString)).append(""); + Object routerValue = getRouter(); + String routerValueAsString = ""; + routerValueAsString = routerValue.toString(); + sb.append("router=").append(urlEncode(routerValueAsString)).append(""); + Object priceImpactPercentValue = getPriceImpactPercent(); + String priceImpactPercentValueAsString = ""; + priceImpactPercentValueAsString = priceImpactPercentValue.toString(); + sb.append("priceImpactPercent=") + .append(urlEncode(priceImpactPercentValueAsString)) + .append(""); + Object dexRouterListValue = getDexRouterList(); + String dexRouterListValueAsString = ""; + dexRouterListValueAsString = + (String) + ((Collection) dexRouterListValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("dexRouterList=").append(urlEncode(dexRouterListValueAsString)).append(""); + Object fromTokenValue = getFromToken(); + String fromTokenValueAsString = ""; + fromTokenValueAsString = fromTokenValue.toString(); + sb.append("fromToken=").append(urlEncode(fromTokenValueAsString)).append(""); + Object toTokenValue = getToToken(); + String toTokenValueAsString = ""; + toTokenValueAsString = toTokenValue.toString(); + sb.append("toToken=").append(urlEncode(toTokenValueAsString)).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("binanceChainId"); + openapiFields.add("vendorName"); + openapiFields.add("fromTokenAmount"); + openapiFields.add("toTokenAmount"); + openapiFields.add("tradeFee"); + openapiFields.add("estimateGasFee"); + openapiFields.add("router"); + openapiFields.add("priceImpactPercent"); + openapiFields.add("dexRouterList"); + openapiFields.add("fromToken"); + openapiFields.add("toToken"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataRouterResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataRouterResult is not" + + " found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataRouterResult + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("vendorName") != null && !jsonObj.get("vendorName").isJsonNull()) + && !jsonObj.get("vendorName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `vendorName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("vendorName").toString())); + } + if ((jsonObj.get("fromTokenAmount") != null && !jsonObj.get("fromTokenAmount").isJsonNull()) + && !jsonObj.get("fromTokenAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fromTokenAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("fromTokenAmount").toString())); + } + if ((jsonObj.get("toTokenAmount") != null && !jsonObj.get("toTokenAmount").isJsonNull()) + && !jsonObj.get("toTokenAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `toTokenAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("toTokenAmount").toString())); + } + if ((jsonObj.get("tradeFee") != null && !jsonObj.get("tradeFee").isJsonNull()) + && !jsonObj.get("tradeFee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tradeFee` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tradeFee").toString())); + } + if ((jsonObj.get("estimateGasFee") != null && !jsonObj.get("estimateGasFee").isJsonNull()) + && !jsonObj.get("estimateGasFee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `estimateGasFee` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("estimateGasFee").toString())); + } + if ((jsonObj.get("router") != null && !jsonObj.get("router").isJsonNull()) + && !jsonObj.get("router").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `router` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("router").toString())); + } + if ((jsonObj.get("priceImpactPercent") != null + && !jsonObj.get("priceImpactPercent").isJsonNull()) + && !jsonObj.get("priceImpactPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceImpactPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("priceImpactPercent").toString())); + } + if (jsonObj.get("dexRouterList") != null && !jsonObj.get("dexRouterList").isJsonNull()) { + JsonArray jsonArraydexRouterList = jsonObj.getAsJsonArray("dexRouterList"); + if (jsonArraydexRouterList != null) { + // ensure the json data is an array + if (!jsonObj.get("dexRouterList").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dexRouterList` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("dexRouterList").toString())); + } + + // validate the optional field `dexRouterList` (array) + for (int i = 0; i < jsonArraydexRouterList.size(); i++) { + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .validateJsonElement(jsonArraydexRouterList.get(i)); + } + ; + } + } + // validate the optional field `fromToken` + if (jsonObj.get("fromToken") != null && !jsonObj.get("fromToken").isJsonNull()) { + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.validateJsonElement( + jsonObj.get("fromToken")); + } + // validate the optional field `toToken` + if (jsonObj.get("toToken") != null && !jsonObj.get("toToken").isJsonNull()) { + BuildSolanaSwapInstructionsResponseDataRouterResultToToken.validateJsonElement( + jsonObj.get("toToken")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResult.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataRouterResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataRouterResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataRouterResult value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSolanaSwapInstructionsResponseDataRouterResult read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSolanaSwapInstructionsResponseDataRouterResult given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of BuildSolanaSwapInstructionsResponseDataRouterResult + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataRouterResult + */ + public static BuildSolanaSwapInstructionsResponseDataRouterResult fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, BuildSolanaSwapInstructionsResponseDataRouterResult.class); + } + + /** + * Convert an instance of BuildSolanaSwapInstructionsResponseDataRouterResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.java new file mode 100644 index 0000000..5db4e03 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.java @@ -0,0 +1,434 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner { + public static final String SERIALIZED_NAME_DEX_PROTOCOL = "dexProtocol"; + + @SerializedName(SERIALIZED_NAME_DEX_PROTOCOL) + @jakarta.annotation.Nullable + private BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + dexProtocol; + + public static final String SERIALIZED_NAME_FROM_TOKEN = "fromToken"; + + @SerializedName(SERIALIZED_NAME_FROM_TOKEN) + @jakarta.annotation.Nullable + private BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + fromToken; + + public static final String SERIALIZED_NAME_FROM_TOKEN_INDEX = "fromTokenIndex"; + + @SerializedName(SERIALIZED_NAME_FROM_TOKEN_INDEX) + @jakarta.annotation.Nullable + private String fromTokenIndex; + + public static final String SERIALIZED_NAME_TO_TOKEN = "toToken"; + + @SerializedName(SERIALIZED_NAME_TO_TOKEN) + @jakarta.annotation.Nullable + private BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken toToken; + + public static final String SERIALIZED_NAME_TO_TOKEN_INDEX = "toTokenIndex"; + + @SerializedName(SERIALIZED_NAME_TO_TOKEN_INDEX) + @jakarta.annotation.Nullable + private String toTokenIndex; + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner() {} + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner dexProtocol( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + dexProtocol) { + this.dexProtocol = dexProtocol; + return this; + } + + /** + * Get dexProtocol + * + * @return dexProtocol + */ + @jakarta.annotation.Nullable + @Valid + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + getDexProtocol() { + return dexProtocol; + } + + public void setDexProtocol( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + dexProtocol) { + this.dexProtocol = dexProtocol; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner fromToken( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + fromToken) { + this.fromToken = fromToken; + return this; + } + + /** + * Get fromToken + * + * @return fromToken + */ + @jakarta.annotation.Nullable + @Valid + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + getFromToken() { + return fromToken; + } + + public void setFromToken( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + fromToken) { + this.fromToken = fromToken; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner fromTokenIndex( + @jakarta.annotation.Nullable String fromTokenIndex) { + this.fromTokenIndex = fromTokenIndex; + return this; + } + + /** + * Get fromTokenIndex + * + * @return fromTokenIndex + */ + @jakarta.annotation.Nullable + public String getFromTokenIndex() { + return fromTokenIndex; + } + + public void setFromTokenIndex(@jakarta.annotation.Nullable String fromTokenIndex) { + this.fromTokenIndex = fromTokenIndex; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner toToken( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + toToken) { + this.toToken = toToken; + return this; + } + + /** + * Get toToken + * + * @return toToken + */ + @jakarta.annotation.Nullable + @Valid + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + getToToken() { + return toToken; + } + + public void setToToken( + @jakarta.annotation.Nullable + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + toToken) { + this.toToken = toToken; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner toTokenIndex( + @jakarta.annotation.Nullable String toTokenIndex) { + this.toTokenIndex = toTokenIndex; + return this; + } + + /** + * Get toTokenIndex + * + * @return toTokenIndex + */ + @jakarta.annotation.Nullable + public String getToTokenIndex() { + return toTokenIndex; + } + + public void setToTokenIndex(@jakarta.annotation.Nullable String toTokenIndex) { + this.toTokenIndex = toTokenIndex; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner = + (BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner) o; + return Objects.equals( + this.dexProtocol, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .dexProtocol) + && Objects.equals( + this.fromToken, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .fromToken) + && Objects.equals( + this.fromTokenIndex, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .fromTokenIndex) + && Objects.equals( + this.toToken, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .toToken) + && Objects.equals( + this.toTokenIndex, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .toTokenIndex); + } + + @Override + public int hashCode() { + return Objects.hash(dexProtocol, fromToken, fromTokenIndex, toToken, toTokenIndex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner {\n"); + sb.append(" dexProtocol: ").append(toIndentedString(dexProtocol)).append("\n"); + sb.append(" fromToken: ").append(toIndentedString(fromToken)).append("\n"); + sb.append(" fromTokenIndex: ").append(toIndentedString(fromTokenIndex)).append("\n"); + sb.append(" toToken: ").append(toIndentedString(toToken)).append("\n"); + sb.append(" toTokenIndex: ").append(toIndentedString(toTokenIndex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object dexProtocolValue = getDexProtocol(); + String dexProtocolValueAsString = ""; + dexProtocolValueAsString = dexProtocolValue.toString(); + sb.append("dexProtocol=").append(urlEncode(dexProtocolValueAsString)).append(""); + Object fromTokenValue = getFromToken(); + String fromTokenValueAsString = ""; + fromTokenValueAsString = fromTokenValue.toString(); + sb.append("fromToken=").append(urlEncode(fromTokenValueAsString)).append(""); + Object fromTokenIndexValue = getFromTokenIndex(); + String fromTokenIndexValueAsString = ""; + fromTokenIndexValueAsString = fromTokenIndexValue.toString(); + sb.append("fromTokenIndex=").append(urlEncode(fromTokenIndexValueAsString)).append(""); + Object toTokenValue = getToToken(); + String toTokenValueAsString = ""; + toTokenValueAsString = toTokenValue.toString(); + sb.append("toToken=").append(urlEncode(toTokenValueAsString)).append(""); + Object toTokenIndexValue = getToTokenIndex(); + String toTokenIndexValueAsString = ""; + toTokenIndexValueAsString = toTokenIndexValue.toString(); + sb.append("toTokenIndex=").append(urlEncode(toTokenIndexValueAsString)).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("dexProtocol"); + openapiFields.add("fromToken"); + openapiFields.add("fromTokenIndex"); + openapiFields.add("toToken"); + openapiFields.add("toTokenIndex"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner" + + " is not found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `dexProtocol` + if (jsonObj.get("dexProtocol") != null && !jsonObj.get("dexProtocol").isJsonNull()) { + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .validateJsonElement(jsonObj.get("dexProtocol")); + } + // validate the optional field `fromToken` + if (jsonObj.get("fromToken") != null && !jsonObj.get("fromToken").isJsonNull()) { + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .validateJsonElement(jsonObj.get("fromToken")); + } + if ((jsonObj.get("fromTokenIndex") != null && !jsonObj.get("fromTokenIndex").isJsonNull()) + && !jsonObj.get("fromTokenIndex").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fromTokenIndex` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("fromTokenIndex").toString())); + } + // validate the optional field `toToken` + if (jsonObj.get("toToken") != null && !jsonObj.get("toToken").isJsonNull()) { + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + .validateJsonElement(jsonObj.get("toToken")); + } + if ((jsonObj.get("toTokenIndex") != null && !jsonObj.get("toTokenIndex").isJsonNull()) + && !jsonObj.get("toTokenIndex").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `toTokenIndex` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("toTokenIndex").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .class)); + + return (TypeAdapter) + new TypeAdapter< + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner>() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + * given an JSON string + * + * @param jsonString JSON string + * @return An instance of BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + */ + public static BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + .class); + } + + /** + * Convert an instance of BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInner + * to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.java new file mode 100644 index 0000000..5e44a40 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol.java @@ -0,0 +1,295 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol { + public static final String SERIALIZED_NAME_DEX_NAME = "dexName"; + + @SerializedName(SERIALIZED_NAME_DEX_NAME) + @jakarta.annotation.Nullable + private String dexName; + + public static final String SERIALIZED_NAME_PERCENT = "percent"; + + @SerializedName(SERIALIZED_NAME_PERCENT) + @jakarta.annotation.Nullable + private String percent; + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol() {} + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol dexName( + @jakarta.annotation.Nullable String dexName) { + this.dexName = dexName; + return this; + } + + /** + * Get dexName + * + * @return dexName + */ + @jakarta.annotation.Nullable + public String getDexName() { + return dexName; + } + + public void setDexName(@jakarta.annotation.Nullable String dexName) { + this.dexName = dexName; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol percent( + @jakarta.annotation.Nullable String percent) { + this.percent = percent; + return this; + } + + /** + * Get percent + * + * @return percent + */ + @jakarta.annotation.Nullable + public String getPercent() { + return percent; + } + + public void setPercent(@jakarta.annotation.Nullable String percent) { + this.percent = percent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol = + (BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol) + o; + return Objects.equals( + this.dexName, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .dexName) + && Objects.equals( + this.percent, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .percent); + } + + @Override + public int hashCode() { + return Objects.hash(dexName, percent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class" + + " BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol" + + " {\n"); + sb.append(" dexName: ").append(toIndentedString(dexName)).append("\n"); + sb.append(" percent: ").append(toIndentedString(percent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object dexNameValue = getDexName(); + String dexNameValueAsString = ""; + dexNameValueAsString = dexNameValue.toString(); + sb.append("dexName=").append(urlEncode(dexNameValueAsString)).append(""); + Object percentValue = getPercent(); + String percentValueAsString = ""; + percentValueAsString = percentValue.toString(); + sb.append("percent=").append(urlEncode(percentValueAsString)).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("dexName"); + openapiFields.add("percent"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol" + + " is not found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("dexName") != null && !jsonObj.get("dexName").isJsonNull()) + && !jsonObj.get("dexName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dexName` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("dexName").toString())); + } + if ((jsonObj.get("percent") != null && !jsonObj.get("percent").isJsonNull()) + && !jsonObj.get("percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `percent` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("percent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter< + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol> + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .class)); + + return (TypeAdapter) + new TypeAdapter< + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol>() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + */ + public static BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + fromJson(String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol + .class); + } + + /** + * Convert an instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerDexProtocol to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.java new file mode 100644 index 0000000..7713680 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken.java @@ -0,0 +1,301 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken { + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken() {} + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + tokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Get tokenContractAddress + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + tokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Get tokenSymbol + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken = + (BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken) + o; + return Objects.equals( + this.tokenContractAddress, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .tokenContractAddress) + && Objects.equals( + this.tokenSymbol, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .tokenSymbol); + } + + @Override + public int hashCode() { + return Objects.hash(tokenContractAddress, tokenSymbol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class" + + " BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken" + + " {\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).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("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken" + + " is not found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter< + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken> + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .class)); + + return (TypeAdapter) + new TypeAdapter< + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken>() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + */ + public static BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + fromJson(String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken + .class); + } + + /** + * Convert an instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerFromToken to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.java new file mode 100644 index 0000000..ce464cd --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.java @@ -0,0 +1,299 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken { + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken() {} + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + tokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Get tokenContractAddress + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Get tokenSymbol + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken = + (BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken) + o; + return Objects.equals( + this.tokenContractAddress, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + .tokenContractAddress) + && Objects.equals( + this.tokenSymbol, + buildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + .tokenSymbol); + } + + @Override + public int hashCode() { + return Objects.hash(tokenContractAddress, tokenSymbol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append( + "class BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken" + + " {\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).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("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + .openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken" + + " is not found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter< + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken> + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + .class)); + + return (TypeAdapter) + new TypeAdapter< + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken>() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + */ + public static BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + fromJson(String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken + .class); + } + + /** + * Convert an instance of + * BuildSolanaSwapInstructionsResponseDataRouterResultDexRouterListInnerToToken to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.java new file mode 100644 index 0000000..83750fb --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.java @@ -0,0 +1,330 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Sell-token metadata. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataRouterResultFromToken { + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_DECIMAL = "decimal"; + + @SerializedName(SERIALIZED_NAME_DECIMAL) + @jakarta.annotation.Nullable + private String decimal; + + public BuildSolanaSwapInstructionsResponseDataRouterResultFromToken() {} + + public BuildSolanaSwapInstructionsResponseDataRouterResultFromToken tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Get tokenContractAddress + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultFromToken tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Get tokenSymbol + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultFromToken decimal( + @jakarta.annotation.Nullable String decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * + * @return decimal + */ + @jakarta.annotation.Nullable + public String getDecimal() { + return decimal; + } + + public void setDecimal(@jakarta.annotation.Nullable String decimal) { + this.decimal = decimal; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken + buildSolanaSwapInstructionsResponseDataRouterResultFromToken = + (BuildSolanaSwapInstructionsResponseDataRouterResultFromToken) o; + return Objects.equals( + this.tokenContractAddress, + buildSolanaSwapInstructionsResponseDataRouterResultFromToken + .tokenContractAddress) + && Objects.equals( + this.tokenSymbol, + buildSolanaSwapInstructionsResponseDataRouterResultFromToken.tokenSymbol) + && Objects.equals( + this.decimal, + buildSolanaSwapInstructionsResponseDataRouterResultFromToken.decimal); + } + + @Override + public int hashCode() { + return Objects.hash(tokenContractAddress, tokenSymbol, decimal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuildSolanaSwapInstructionsResponseDataRouterResultFromToken {\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object decimalValue = getDecimal(); + String decimalValueAsString = ""; + decimalValueAsString = decimalValue.toString(); + sb.append("decimal=").append(urlEncode(decimalValueAsString)).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("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + openapiFields.add("decimal"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataRouterResultFromToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataRouterResultFromToken" + + " is not found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + if ((jsonObj.get("decimal") != null && !jsonObj.get("decimal").isJsonNull()) + && !jsonObj.get("decimal").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `decimal` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("decimal").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataRouterResultFromToken' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken + .class)); + + return (TypeAdapter) + new TypeAdapter< + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken>() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSolanaSwapInstructionsResponseDataRouterResultFromToken read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSolanaSwapInstructionsResponseDataRouterResultFromToken given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of BuildSolanaSwapInstructionsResponseDataRouterResultFromToken + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataRouterResultFromToken + */ + public static BuildSolanaSwapInstructionsResponseDataRouterResultFromToken fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + BuildSolanaSwapInstructionsResponseDataRouterResultFromToken.class); + } + + /** + * Convert an instance of BuildSolanaSwapInstructionsResponseDataRouterResultFromToken to an + * JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultToToken.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultToToken.java new file mode 100644 index 0000000..077f98b --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataRouterResultToToken.java @@ -0,0 +1,329 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Buy-token metadata. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataRouterResultToToken { + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_DECIMAL = "decimal"; + + @SerializedName(SERIALIZED_NAME_DECIMAL) + @jakarta.annotation.Nullable + private String decimal; + + public BuildSolanaSwapInstructionsResponseDataRouterResultToToken() {} + + public BuildSolanaSwapInstructionsResponseDataRouterResultToToken tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Get tokenContractAddress + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultToToken tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Get tokenSymbol + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public BuildSolanaSwapInstructionsResponseDataRouterResultToToken decimal( + @jakarta.annotation.Nullable String decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * + * @return decimal + */ + @jakarta.annotation.Nullable + public String getDecimal() { + return decimal; + } + + public void setDecimal(@jakarta.annotation.Nullable String decimal) { + this.decimal = decimal; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataRouterResultToToken + buildSolanaSwapInstructionsResponseDataRouterResultToToken = + (BuildSolanaSwapInstructionsResponseDataRouterResultToToken) o; + return Objects.equals( + this.tokenContractAddress, + buildSolanaSwapInstructionsResponseDataRouterResultToToken + .tokenContractAddress) + && Objects.equals( + this.tokenSymbol, + buildSolanaSwapInstructionsResponseDataRouterResultToToken.tokenSymbol) + && Objects.equals( + this.decimal, + buildSolanaSwapInstructionsResponseDataRouterResultToToken.decimal); + } + + @Override + public int hashCode() { + return Objects.hash(tokenContractAddress, tokenSymbol, decimal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuildSolanaSwapInstructionsResponseDataRouterResultToToken {\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object decimalValue = getDecimal(); + String decimalValueAsString = ""; + decimalValueAsString = decimalValue.toString(); + sb.append("decimal=").append(urlEncode(decimalValueAsString)).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("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + openapiFields.add("decimal"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataRouterResultToToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultToToken.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataRouterResultToToken" + + " is not found in the empty JSON string", + BuildSolanaSwapInstructionsResponseDataRouterResultToToken + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + if ((jsonObj.get("decimal") != null && !jsonObj.get("decimal").isJsonNull()) + && !jsonObj.get("decimal").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `decimal` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("decimal").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataRouterResultToToken.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataRouterResultToToken' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BuildSolanaSwapInstructionsResponseDataRouterResultToToken + .class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + BuildSolanaSwapInstructionsResponseDataRouterResultToToken value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSolanaSwapInstructionsResponseDataRouterResultToToken read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSolanaSwapInstructionsResponseDataRouterResultToToken given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of BuildSolanaSwapInstructionsResponseDataRouterResultToToken + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataRouterResultToToken + */ + public static BuildSolanaSwapInstructionsResponseDataRouterResultToToken fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + BuildSolanaSwapInstructionsResponseDataRouterResultToToken.class); + } + + /** + * Convert an instance of BuildSolanaSwapInstructionsResponseDataRouterResultToToken to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataTx.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataTx.java new file mode 100644 index 0000000..6eca324 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSolanaSwapInstructionsResponseDataTx.java @@ -0,0 +1,353 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** + * Transaction summary (no `data` field — replaced by `instructionLists`). + * Contains the fields the caller needs to display or audit before signing. + */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSolanaSwapInstructionsResponseDataTx { + public static final String SERIALIZED_NAME_FROM = "from"; + + @SerializedName(SERIALIZED_NAME_FROM) + @jakarta.annotation.Nullable + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + + @SerializedName(SERIALIZED_NAME_TO) + @jakarta.annotation.Nullable + private String to; + + public static final String SERIALIZED_NAME_MIN_RECEIVE_AMOUNT = "minReceiveAmount"; + + @SerializedName(SERIALIZED_NAME_MIN_RECEIVE_AMOUNT) + @jakarta.annotation.Nullable + private String minReceiveAmount; + + public static final String SERIALIZED_NAME_SLIPPAGE_PERCENT = "slippagePercent"; + + @SerializedName(SERIALIZED_NAME_SLIPPAGE_PERCENT) + @jakarta.annotation.Nullable + private String slippagePercent; + + public BuildSolanaSwapInstructionsResponseDataTx() {} + + public BuildSolanaSwapInstructionsResponseDataTx from( + @jakarta.annotation.Nullable String from) { + this.from = from; + return this; + } + + /** + * User wallet address (transaction sender / fee payer). + * + * @return from + */ + @jakarta.annotation.Nullable + public String getFrom() { + return from; + } + + public void setFrom(@jakarta.annotation.Nullable String from) { + this.from = from; + } + + public BuildSolanaSwapInstructionsResponseDataTx to(@jakarta.annotation.Nullable String to) { + this.to = to; + return this; + } + + /** + * Platform Router program address (the swap target program). + * + * @return to + */ + @jakarta.annotation.Nullable + public String getTo() { + return to; + } + + public void setTo(@jakarta.annotation.Nullable String to) { + this.to = to; + } + + public BuildSolanaSwapInstructionsResponseDataTx minReceiveAmount( + @jakarta.annotation.Nullable String minReceiveAmount) { + this.minReceiveAmount = minReceiveAmount; + return this; + } + + /** + * Minimum buy-token amount the user accepts at the slippage limit (smallest unit, integer + * string). + * + * @return minReceiveAmount + */ + @jakarta.annotation.Nullable + public String getMinReceiveAmount() { + return minReceiveAmount; + } + + public void setMinReceiveAmount(@jakarta.annotation.Nullable String minReceiveAmount) { + this.minReceiveAmount = minReceiveAmount; + } + + public BuildSolanaSwapInstructionsResponseDataTx slippagePercent( + @jakarta.annotation.Nullable String slippagePercent) { + this.slippagePercent = slippagePercent; + return this; + } + + /** + * Slippage value applied to this transaction (percentage string). + * + * @return slippagePercent + */ + @jakarta.annotation.Nullable + public String getSlippagePercent() { + return slippagePercent; + } + + public void setSlippagePercent(@jakarta.annotation.Nullable String slippagePercent) { + this.slippagePercent = slippagePercent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSolanaSwapInstructionsResponseDataTx buildSolanaSwapInstructionsResponseDataTx = + (BuildSolanaSwapInstructionsResponseDataTx) o; + return Objects.equals(this.from, buildSolanaSwapInstructionsResponseDataTx.from) + && Objects.equals(this.to, buildSolanaSwapInstructionsResponseDataTx.to) + && Objects.equals( + this.minReceiveAmount, + buildSolanaSwapInstructionsResponseDataTx.minReceiveAmount) + && Objects.equals( + this.slippagePercent, + buildSolanaSwapInstructionsResponseDataTx.slippagePercent); + } + + @Override + public int hashCode() { + return Objects.hash(from, to, minReceiveAmount, slippagePercent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuildSolanaSwapInstructionsResponseDataTx {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" minReceiveAmount: ").append(toIndentedString(minReceiveAmount)).append("\n"); + sb.append(" slippagePercent: ").append(toIndentedString(slippagePercent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object fromValue = getFrom(); + String fromValueAsString = ""; + fromValueAsString = fromValue.toString(); + sb.append("from=").append(urlEncode(fromValueAsString)).append(""); + Object toValue = getTo(); + String toValueAsString = ""; + toValueAsString = toValue.toString(); + sb.append("to=").append(urlEncode(toValueAsString)).append(""); + Object minReceiveAmountValue = getMinReceiveAmount(); + String minReceiveAmountValueAsString = ""; + minReceiveAmountValueAsString = minReceiveAmountValue.toString(); + sb.append("minReceiveAmount=").append(urlEncode(minReceiveAmountValueAsString)).append(""); + Object slippagePercentValue = getSlippagePercent(); + String slippagePercentValueAsString = ""; + slippagePercentValueAsString = slippagePercentValue.toString(); + sb.append("slippagePercent=").append(urlEncode(slippagePercentValueAsString)).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("from"); + openapiFields.add("to"); + openapiFields.add("minReceiveAmount"); + openapiFields.add("slippagePercent"); + + // 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 + * BuildSolanaSwapInstructionsResponseDataTx + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSolanaSwapInstructionsResponseDataTx.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BuildSolanaSwapInstructionsResponseDataTx is not found in" + + " the empty JSON string", + BuildSolanaSwapInstructionsResponseDataTx.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) + && !jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `from` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("from").toString())); + } + if ((jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) + && !jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `to` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("to").toString())); + } + if ((jsonObj.get("minReceiveAmount") != null + && !jsonObj.get("minReceiveAmount").isJsonNull()) + && !jsonObj.get("minReceiveAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minReceiveAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("minReceiveAmount").toString())); + } + if ((jsonObj.get("slippagePercent") != null && !jsonObj.get("slippagePercent").isJsonNull()) + && !jsonObj.get("slippagePercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slippagePercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("slippagePercent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSolanaSwapInstructionsResponseDataTx.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'BuildSolanaSwapInstructionsResponseDataTx' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(BuildSolanaSwapInstructionsResponseDataTx.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, BuildSolanaSwapInstructionsResponseDataTx value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSolanaSwapInstructionsResponseDataTx read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSolanaSwapInstructionsResponseDataTx given an JSON string + * + * @param jsonString JSON string + * @return An instance of BuildSolanaSwapInstructionsResponseDataTx + * @throws IOException if the JSON string is invalid with respect to + * BuildSolanaSwapInstructionsResponseDataTx + */ + public static BuildSolanaSwapInstructionsResponseDataTx fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, BuildSolanaSwapInstructionsResponseDataTx.class); + } + + /** + * Convert an instance of BuildSolanaSwapInstructionsResponseDataTx to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSwapTransactionResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSwapTransactionResponseData.java index 7e3c9c2..a123eee 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSwapTransactionResponseData.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSwapTransactionResponseData.java @@ -28,9 +28,11 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.HashSet; import java.util.Objects; import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; /** BuildSwapTransactionResponseData */ @jakarta.annotation.Generated( @@ -49,6 +51,18 @@ public class BuildSwapTransactionResponseData { @jakarta.annotation.Nullable private BuildSwapTransactionResponseDataTx tx; + public static final String SERIALIZED_NAME_EXECUTION_MODE = "executionMode"; + + @SerializedName(SERIALIZED_NAME_EXECUTION_MODE) + @jakarta.annotation.Nullable + private String executionMode; + + public static final String SERIALIZED_NAME_RFQ = "rfq"; + + @SerializedName(SERIALIZED_NAME_RFQ) + @jakarta.annotation.Nullable + private BuildSwapTransactionResponseDataRfq rfq; + public BuildSwapTransactionResponseData() {} public BuildSwapTransactionResponseData routerResult( @@ -96,6 +110,51 @@ public void setTx(@jakarta.annotation.Nullable BuildSwapTransactionResponseDataT this.tx = tx; } + public BuildSwapTransactionResponseData executionMode( + @jakarta.annotation.Nullable String executionMode) { + this.executionMode = executionMode; + return this; + } + + /** + * Execution mode for this swap. `SWAP` = sign the `tx` object and + * broadcast to the chain. `RFQ` = sign `rfq.typedDataToSign` with + * EIP-712 (`eth_signTypedData_v4`), then submit via `POST /order/submit` + * and poll `GET /order/{orderId}` for settlement status. Equity / RWA tokens always + * return `RFQ`. + * + * @return executionMode + */ + @jakarta.annotation.Nullable + public String getExecutionMode() { + return executionMode; + } + + public void setExecutionMode(@jakarta.annotation.Nullable String executionMode) { + this.executionMode = executionMode; + } + + public BuildSwapTransactionResponseData rfq( + @jakarta.annotation.Nullable BuildSwapTransactionResponseDataRfq rfq) { + this.rfq = rfq; + return this; + } + + /** + * Get rfq + * + * @return rfq + */ + @jakarta.annotation.Nullable + @Valid + public BuildSwapTransactionResponseDataRfq getRfq() { + return rfq; + } + + public void setRfq(@jakarta.annotation.Nullable BuildSwapTransactionResponseDataRfq rfq) { + this.rfq = rfq; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -107,12 +166,31 @@ public boolean equals(Object o) { BuildSwapTransactionResponseData buildSwapTransactionResponseData = (BuildSwapTransactionResponseData) o; return Objects.equals(this.routerResult, buildSwapTransactionResponseData.routerResult) - && Objects.equals(this.tx, buildSwapTransactionResponseData.tx); + && Objects.equals(this.tx, buildSwapTransactionResponseData.tx) + && Objects.equals( + this.executionMode, buildSwapTransactionResponseData.executionMode) + && Objects.equals(this.rfq, buildSwapTransactionResponseData.rfq); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(routerResult, tx); + return Objects.hash(routerResult, tx, executionMode, rfq); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } @Override @@ -121,6 +199,8 @@ public String toString() { sb.append("class BuildSwapTransactionResponseData {\n"); sb.append(" routerResult: ").append(toIndentedString(routerResult)).append("\n"); sb.append(" tx: ").append(toIndentedString(tx)).append("\n"); + sb.append(" executionMode: ").append(toIndentedString(executionMode)).append("\n"); + sb.append(" rfq: ").append(toIndentedString(rfq)).append("\n"); sb.append("}"); return sb.toString(); } @@ -136,6 +216,14 @@ public String toUrlQueryString() { String txValueAsString = ""; txValueAsString = txValue.toString(); sb.append("tx=").append(urlEncode(txValueAsString)).append(""); + Object executionModeValue = getExecutionMode(); + String executionModeValueAsString = ""; + executionModeValueAsString = executionModeValue.toString(); + sb.append("executionMode=").append(urlEncode(executionModeValueAsString)).append(""); + Object rfqValue = getRfq(); + String rfqValueAsString = ""; + rfqValueAsString = rfqValue.toString(); + sb.append("rfq=").append(urlEncode(rfqValueAsString)).append(""); return sb.toString(); } @@ -166,6 +254,8 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("routerResult"); openapiFields.add("tx"); + openapiFields.add("executionMode"); + openapiFields.add("rfq"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -199,6 +289,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("tx") != null && !jsonObj.get("tx").isJsonNull()) { BuildSwapTransactionResponseDataTx.validateJsonElement(jsonObj.get("tx")); } + if ((jsonObj.get("executionMode") != null && !jsonObj.get("executionMode").isJsonNull()) + && !jsonObj.get("executionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executionMode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executionMode").toString())); + } + // validate the optional field `rfq` + if (jsonObj.get("rfq") != null && !jsonObj.get("rfq").isJsonNull()) { + BuildSwapTransactionResponseDataRfq.validateJsonElement(jsonObj.get("rfq")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSwapTransactionResponseDataRfq.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSwapTransactionResponseDataRfq.java new file mode 100644 index 0000000..c2d653f --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/BuildSwapTransactionResponseDataRfq.java @@ -0,0 +1,415 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.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.*; + +/** + * RFQ order payload. Present only when `executionMode=RFQ`. Contains the EIP-712 + * typed data to sign, the target vendor, the signing scheme, and (when requested) the approve + * transaction data. + */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class BuildSwapTransactionResponseDataRfq { + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + + @SerializedName(SERIALIZED_NAME_VENDOR) + @jakarta.annotation.Nullable + private String vendor; + + public static final String SERIALIZED_NAME_TX_TYPE = "txType"; + + @SerializedName(SERIALIZED_NAME_TX_TYPE) + @jakarta.annotation.Nullable + private String txType; + + public static final String SERIALIZED_NAME_TYPED_DATA_TO_SIGN = "typedDataToSign"; + + @SerializedName(SERIALIZED_NAME_TYPED_DATA_TO_SIGN) + @jakarta.annotation.Nullable + private String typedDataToSign; + + public static final String SERIALIZED_NAME_SIGNING_SCHEME = "signingScheme"; + + @SerializedName(SERIALIZED_NAME_SIGNING_SCHEME) + @jakarta.annotation.Nullable + private String signingScheme; + + public static final String SERIALIZED_NAME_SIGNATURE_DATA = "signatureData"; + + @SerializedName(SERIALIZED_NAME_SIGNATURE_DATA) + @jakarta.annotation.Nullable + private List signatureData; + + public BuildSwapTransactionResponseDataRfq() {} + + public BuildSwapTransactionResponseDataRfq vendor(@jakarta.annotation.Nullable String vendor) { + this.vendor = vendor; + return this; + } + + /** + * RFQ vendor that will settle this order on-chain. Pass this as the `vendor` field in + * `POST /order/submit`. + * + * @return vendor + */ + @jakarta.annotation.Nullable + public String getVendor() { + return vendor; + } + + public void setVendor(@jakarta.annotation.Nullable String vendor) { + this.vendor = vendor; + } + + public BuildSwapTransactionResponseDataRfq txType(@jakarta.annotation.Nullable String txType) { + this.txType = txType; + return this; + } + + /** + * Transaction type for this RFQ order. Currently always `EIP712` (all three RFQ + * vendors use EIP-712 typed-data signing); reserved for future signing schemes. + * + * @return txType + */ + @jakarta.annotation.Nullable + public String getTxType() { + return txType; + } + + public void setTxType(@jakarta.annotation.Nullable String txType) { + this.txType = txType; + } + + public BuildSwapTransactionResponseDataRfq typedDataToSign( + @jakarta.annotation.Nullable String typedDataToSign) { + this.typedDataToSign = typedDataToSign; + return this; + } + + /** + * EIP-712 typed data payload for `eth_signTypedData_v4`, serialized as a hex string + * (or JSON-encoded string). Sign with the wallet that matches `userWalletAddress` + * from `/quote`. Pass the resulting signature as `userSignature` in + * `POST /order/submit`. + * + * @return typedDataToSign + */ + @jakarta.annotation.Nullable + public String getTypedDataToSign() { + return typedDataToSign; + } + + public void setTypedDataToSign(@jakarta.annotation.Nullable String typedDataToSign) { + this.typedDataToSign = typedDataToSign; + } + + public BuildSwapTransactionResponseDataRfq signingScheme( + @jakarta.annotation.Nullable String signingScheme) { + this.signingScheme = signingScheme; + return this; + } + + /** + * Signing scheme required by this vendor. Pass this as `signingScheme` in `POST + * /order/submit`. + * + * @return signingScheme + */ + @jakarta.annotation.Nullable + public String getSigningScheme() { + return signingScheme; + } + + public void setSigningScheme(@jakarta.annotation.Nullable String signingScheme) { + this.signingScheme = signingScheme; + } + + public BuildSwapTransactionResponseDataRfq signatureData( + @jakarta.annotation.Nullable List signatureData) { + this.signatureData = signatureData; + return this; + } + + public BuildSwapTransactionResponseDataRfq addSignatureDataItem(String signatureDataItem) { + if (this.signatureData == null) { + this.signatureData = new ArrayList<>(); + } + this.signatureData.add(signatureDataItem); + return this; + } + + /** + * Approve transaction data, present only when `approveTransaction=true` was + * passed and the from-token is an EVM ERC-20. Each element is a JSON string containing + * `approveContract` (the spender address, resolved per vendor: InchFusion→router, + * PcsXRfq→Permit2, CowSwap→VaultRelayer) and `approveTxCalldata` (the ERC-20 + * `approve()` calldata). Empty list otherwise. + * + * @return signatureData + */ + @jakarta.annotation.Nullable + public List getSignatureData() { + return signatureData; + } + + public void setSignatureData(@jakarta.annotation.Nullable List signatureData) { + this.signatureData = signatureData; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuildSwapTransactionResponseDataRfq buildSwapTransactionResponseDataRfq = + (BuildSwapTransactionResponseDataRfq) o; + return Objects.equals(this.vendor, buildSwapTransactionResponseDataRfq.vendor) + && Objects.equals(this.txType, buildSwapTransactionResponseDataRfq.txType) + && Objects.equals( + this.typedDataToSign, buildSwapTransactionResponseDataRfq.typedDataToSign) + && Objects.equals( + this.signingScheme, buildSwapTransactionResponseDataRfq.signingScheme) + && Objects.equals( + this.signatureData, buildSwapTransactionResponseDataRfq.signatureData); + } + + @Override + public int hashCode() { + return Objects.hash(vendor, txType, typedDataToSign, signingScheme, signatureData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuildSwapTransactionResponseDataRfq {\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" txType: ").append(toIndentedString(txType)).append("\n"); + sb.append(" typedDataToSign: ").append(toIndentedString(typedDataToSign)).append("\n"); + sb.append(" signingScheme: ").append(toIndentedString(signingScheme)).append("\n"); + sb.append(" signatureData: ").append(toIndentedString(signatureData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object vendorValue = getVendor(); + String vendorValueAsString = ""; + vendorValueAsString = vendorValue.toString(); + sb.append("vendor=").append(urlEncode(vendorValueAsString)).append(""); + Object txTypeValue = getTxType(); + String txTypeValueAsString = ""; + txTypeValueAsString = txTypeValue.toString(); + sb.append("txType=").append(urlEncode(txTypeValueAsString)).append(""); + Object typedDataToSignValue = getTypedDataToSign(); + String typedDataToSignValueAsString = ""; + typedDataToSignValueAsString = typedDataToSignValue.toString(); + sb.append("typedDataToSign=").append(urlEncode(typedDataToSignValueAsString)).append(""); + Object signingSchemeValue = getSigningScheme(); + String signingSchemeValueAsString = ""; + signingSchemeValueAsString = signingSchemeValue.toString(); + sb.append("signingScheme=").append(urlEncode(signingSchemeValueAsString)).append(""); + Object signatureDataValue = getSignatureData(); + String signatureDataValueAsString = ""; + signatureDataValueAsString = + (String) + ((Collection) signatureDataValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("signatureData=").append(urlEncode(signatureDataValueAsString)).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("vendor"); + openapiFields.add("txType"); + openapiFields.add("typedDataToSign"); + openapiFields.add("signingScheme"); + openapiFields.add("signatureData"); + + // 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 + * BuildSwapTransactionResponseDataRfq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuildSwapTransactionResponseDataRfq.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BuildSwapTransactionResponseDataRfq is" + + " not found in the empty JSON string", + BuildSwapTransactionResponseDataRfq.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("vendor") != null && !jsonObj.get("vendor").isJsonNull()) + && !jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `vendor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("vendor").toString())); + } + if ((jsonObj.get("txType") != null && !jsonObj.get("txType").isJsonNull()) + && !jsonObj.get("txType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txType` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("txType").toString())); + } + if ((jsonObj.get("typedDataToSign") != null && !jsonObj.get("typedDataToSign").isJsonNull()) + && !jsonObj.get("typedDataToSign").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `typedDataToSign` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("typedDataToSign").toString())); + } + if ((jsonObj.get("signingScheme") != null && !jsonObj.get("signingScheme").isJsonNull()) + && !jsonObj.get("signingScheme").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `signingScheme` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("signingScheme").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("signatureData") != null + && !jsonObj.get("signatureData").isJsonNull() + && !jsonObj.get("signatureData").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `signatureData` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("signatureData").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuildSwapTransactionResponseDataRfq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BuildSwapTransactionResponseDataRfq' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(BuildSwapTransactionResponseDataRfq.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BuildSwapTransactionResponseDataRfq value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuildSwapTransactionResponseDataRfq read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BuildSwapTransactionResponseDataRfq given an JSON string + * + * @param jsonString JSON string + * @return An instance of BuildSwapTransactionResponseDataRfq + * @throws IOException if the JSON string is invalid with respect to + * BuildSwapTransactionResponseDataRfq + */ + public static BuildSwapTransactionResponseDataRfq fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, BuildSwapTransactionResponseDataRfq.class); + } + + /** + * Convert an instance of BuildSwapTransactionResponseDataRfq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPnLForSpecificTokenResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPnLForSpecificTokenResponse.java new file mode 100644 index 0000000..4a4c179 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPnLForSpecificTokenResponse.java @@ -0,0 +1,357 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetAddressPnLForSpecificTokenResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressPnLForSpecificTokenResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetAddressPnLForSpecificTokenResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetAddressPnLForSpecificTokenResponse() {} + + public GetAddressPnLForSpecificTokenResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetAddressPnLForSpecificTokenResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetAddressPnLForSpecificTokenResponse data( + @jakarta.annotation.Nullable GetAddressPnLForSpecificTokenResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetAddressPnLForSpecificTokenResponseData getData() { + return data; + } + + public void setData( + @jakarta.annotation.Nullable GetAddressPnLForSpecificTokenResponseData data) { + this.data = data; + } + + public GetAddressPnLForSpecificTokenResponse timestamp( + @jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetAddressPnLForSpecificTokenResponse 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; + } + GetAddressPnLForSpecificTokenResponse getAddressPnLForSpecificTokenResponse = + (GetAddressPnLForSpecificTokenResponse) o; + return Objects.equals(this.code, getAddressPnLForSpecificTokenResponse.code) + && Objects.equals(this.msg, getAddressPnLForSpecificTokenResponse.msg) + && Objects.equals(this.data, getAddressPnLForSpecificTokenResponse.data) + && Objects.equals(this.timestamp, getAddressPnLForSpecificTokenResponse.timestamp) + && Objects.equals(this.success, getAddressPnLForSpecificTokenResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressPnLForSpecificTokenResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * GetAddressPnLForSpecificTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressPnLForSpecificTokenResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAddressPnLForSpecificTokenResponse" + + " is not found in the empty JSON string", + GetAddressPnLForSpecificTokenResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetAddressPnLForSpecificTokenResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressPnLForSpecificTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAddressPnLForSpecificTokenResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAddressPnLForSpecificTokenResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetAddressPnLForSpecificTokenResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressPnLForSpecificTokenResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressPnLForSpecificTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressPnLForSpecificTokenResponse + * @throws IOException if the JSON string is invalid with respect to + * GetAddressPnLForSpecificTokenResponse + */ + public static GetAddressPnLForSpecificTokenResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetAddressPnLForSpecificTokenResponse.class); + } + + /** + * Convert an instance of GetAddressPnLForSpecificTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPnLForSpecificTokenResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPnLForSpecificTokenResponseData.java new file mode 100644 index 0000000..cbcc80b --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPnLForSpecificTokenResponseData.java @@ -0,0 +1,841 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Token latest PnL details. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressPnLForSpecificTokenResponseData { + public static final String SERIALIZED_NAME_REALIZED_PNL_USD = "realizedPnlUsd"; + + @SerializedName(SERIALIZED_NAME_REALIZED_PNL_USD) + @jakarta.annotation.Nullable + private String realizedPnlUsd; + + public static final String SERIALIZED_NAME_REALIZED_PNL_PERCENT = "realizedPnlPercent"; + + @SerializedName(SERIALIZED_NAME_REALIZED_PNL_PERCENT) + @jakarta.annotation.Nullable + private String realizedPnlPercent; + + public static final String SERIALIZED_NAME_BUY_TX_VOLUME = "buyTxVolume"; + + @SerializedName(SERIALIZED_NAME_BUY_TX_VOLUME) + @jakarta.annotation.Nullable + private String buyTxVolume; + + public static final String SERIALIZED_NAME_BUY_AMOUNT = "buyAmount"; + + @SerializedName(SERIALIZED_NAME_BUY_AMOUNT) + @jakarta.annotation.Nullable + private String buyAmount; + + public static final String SERIALIZED_NAME_BUY_TX_COUNT = "buyTxCount"; + + @SerializedName(SERIALIZED_NAME_BUY_TX_COUNT) + @jakarta.annotation.Nullable + private String buyTxCount; + + public static final String SERIALIZED_NAME_SELL_TX_VOLUME = "sellTxVolume"; + + @SerializedName(SERIALIZED_NAME_SELL_TX_VOLUME) + @jakarta.annotation.Nullable + private String sellTxVolume; + + public static final String SERIALIZED_NAME_SELL_AMOUNT = "sellAmount"; + + @SerializedName(SERIALIZED_NAME_SELL_AMOUNT) + @jakarta.annotation.Nullable + private String sellAmount; + + public static final String SERIALIZED_NAME_SELL_TX_COUNT = "sellTxCount"; + + @SerializedName(SERIALIZED_NAME_SELL_TX_COUNT) + @jakarta.annotation.Nullable + private String sellTxCount; + + public static final String SERIALIZED_NAME_BUY_AVG_PRICE = "buyAvgPrice"; + + @SerializedName(SERIALIZED_NAME_BUY_AVG_PRICE) + @jakarta.annotation.Nullable + private String buyAvgPrice; + + public static final String SERIALIZED_NAME_SELL_AVG_PRICE = "sellAvgPrice"; + + @SerializedName(SERIALIZED_NAME_SELL_AVG_PRICE) + @jakarta.annotation.Nullable + private String sellAvgPrice; + + public static final String SERIALIZED_NAME_TOKEN_BALANCE_USD = "tokenBalanceUsd"; + + @SerializedName(SERIALIZED_NAME_TOKEN_BALANCE_USD) + @jakarta.annotation.Nullable + private String tokenBalanceUsd; + + public static final String SERIALIZED_NAME_TOKEN_BALANCE_AMOUNT = "tokenBalanceAmount"; + + @SerializedName(SERIALIZED_NAME_TOKEN_BALANCE_AMOUNT) + @jakarta.annotation.Nullable + private String tokenBalanceAmount; + + public static final String SERIALIZED_NAME_MAX_BALANCE_AMOUNT = "maxBalanceAmount"; + + @SerializedName(SERIALIZED_NAME_MAX_BALANCE_AMOUNT) + @jakarta.annotation.Nullable + private String maxBalanceAmount; + + public static final String SERIALIZED_NAME_HOLDING_DURATION = "holdingDuration"; + + @SerializedName(SERIALIZED_NAME_HOLDING_DURATION) + @jakarta.annotation.Nullable + private String holdingDuration; + + public static final String SERIALIZED_NAME_IS_PNL_SUPPORTED = "isPnlSupported"; + + @SerializedName(SERIALIZED_NAME_IS_PNL_SUPPORTED) + @jakarta.annotation.Nullable + private Boolean isPnlSupported; + + public GetAddressPnLForSpecificTokenResponseData() {} + + public GetAddressPnLForSpecificTokenResponseData realizedPnlUsd( + @jakarta.annotation.Nullable String realizedPnlUsd) { + this.realizedPnlUsd = realizedPnlUsd; + return this; + } + + /** + * Cumulative realized PnL for this token, denominated in USD. Positive means profit, negative + * means loss. + * + * @return realizedPnlUsd + */ + @jakarta.annotation.Nullable + public String getRealizedPnlUsd() { + return realizedPnlUsd; + } + + public void setRealizedPnlUsd(@jakarta.annotation.Nullable String realizedPnlUsd) { + this.realizedPnlUsd = realizedPnlUsd; + } + + public GetAddressPnLForSpecificTokenResponseData realizedPnlPercent( + @jakarta.annotation.Nullable String realizedPnlPercent) { + this.realizedPnlPercent = realizedPnlPercent; + return this; + } + + /** + * Realized PnL percentage. No percent sign included. + * + * @return realizedPnlPercent + */ + @jakarta.annotation.Nullable + public String getRealizedPnlPercent() { + return realizedPnlPercent; + } + + public void setRealizedPnlPercent(@jakarta.annotation.Nullable String realizedPnlPercent) { + this.realizedPnlPercent = realizedPnlPercent; + } + + public GetAddressPnLForSpecificTokenResponseData buyTxVolume( + @jakarta.annotation.Nullable String buyTxVolume) { + this.buyTxVolume = buyTxVolume; + return this; + } + + /** + * Cumulative buy spend for this token, denominated in USD. + * + * @return buyTxVolume + */ + @jakarta.annotation.Nullable + public String getBuyTxVolume() { + return buyTxVolume; + } + + public void setBuyTxVolume(@jakarta.annotation.Nullable String buyTxVolume) { + this.buyTxVolume = buyTxVolume; + } + + public GetAddressPnLForSpecificTokenResponseData buyAmount( + @jakarta.annotation.Nullable String buyAmount) { + this.buyAmount = buyAmount; + return this; + } + + /** + * Cumulative buy quantity (token units). + * + * @return buyAmount + */ + @jakarta.annotation.Nullable + public String getBuyAmount() { + return buyAmount; + } + + public void setBuyAmount(@jakarta.annotation.Nullable String buyAmount) { + this.buyAmount = buyAmount; + } + + public GetAddressPnLForSpecificTokenResponseData buyTxCount( + @jakarta.annotation.Nullable String buyTxCount) { + this.buyTxCount = buyTxCount; + return this; + } + + /** + * Number of buy transactions. + * + * @return buyTxCount + */ + @jakarta.annotation.Nullable + public String getBuyTxCount() { + return buyTxCount; + } + + public void setBuyTxCount(@jakarta.annotation.Nullable String buyTxCount) { + this.buyTxCount = buyTxCount; + } + + public GetAddressPnLForSpecificTokenResponseData sellTxVolume( + @jakarta.annotation.Nullable String sellTxVolume) { + this.sellTxVolume = sellTxVolume; + return this; + } + + /** + * Cumulative sell proceeds for this token, denominated in USD. + * + * @return sellTxVolume + */ + @jakarta.annotation.Nullable + public String getSellTxVolume() { + return sellTxVolume; + } + + public void setSellTxVolume(@jakarta.annotation.Nullable String sellTxVolume) { + this.sellTxVolume = sellTxVolume; + } + + public GetAddressPnLForSpecificTokenResponseData sellAmount( + @jakarta.annotation.Nullable String sellAmount) { + this.sellAmount = sellAmount; + return this; + } + + /** + * Cumulative sell quantity (token units). + * + * @return sellAmount + */ + @jakarta.annotation.Nullable + public String getSellAmount() { + return sellAmount; + } + + public void setSellAmount(@jakarta.annotation.Nullable String sellAmount) { + this.sellAmount = sellAmount; + } + + public GetAddressPnLForSpecificTokenResponseData sellTxCount( + @jakarta.annotation.Nullable String sellTxCount) { + this.sellTxCount = sellTxCount; + return this; + } + + /** + * Number of sell transactions. + * + * @return sellTxCount + */ + @jakarta.annotation.Nullable + public String getSellTxCount() { + return sellTxCount; + } + + public void setSellTxCount(@jakarta.annotation.Nullable String sellTxCount) { + this.sellTxCount = sellTxCount; + } + + public GetAddressPnLForSpecificTokenResponseData buyAvgPrice( + @jakarta.annotation.Nullable String buyAvgPrice) { + this.buyAvgPrice = buyAvgPrice; + return this; + } + + /** + * Average buy price, denominated in USD. + * + * @return buyAvgPrice + */ + @jakarta.annotation.Nullable + public String getBuyAvgPrice() { + return buyAvgPrice; + } + + public void setBuyAvgPrice(@jakarta.annotation.Nullable String buyAvgPrice) { + this.buyAvgPrice = buyAvgPrice; + } + + public GetAddressPnLForSpecificTokenResponseData sellAvgPrice( + @jakarta.annotation.Nullable String sellAvgPrice) { + this.sellAvgPrice = sellAvgPrice; + return this; + } + + /** + * Average sell price, denominated in USD. + * + * @return sellAvgPrice + */ + @jakarta.annotation.Nullable + public String getSellAvgPrice() { + return sellAvgPrice; + } + + public void setSellAvgPrice(@jakarta.annotation.Nullable String sellAvgPrice) { + this.sellAvgPrice = sellAvgPrice; + } + + public GetAddressPnLForSpecificTokenResponseData tokenBalanceUsd( + @jakarta.annotation.Nullable String tokenBalanceUsd) { + this.tokenBalanceUsd = tokenBalanceUsd; + return this; + } + + /** + * Current market value of the address's holding in this token, denominated in USD. Returns + * \"0\" when fully sold. + * + * @return tokenBalanceUsd + */ + @jakarta.annotation.Nullable + public String getTokenBalanceUsd() { + return tokenBalanceUsd; + } + + public void setTokenBalanceUsd(@jakarta.annotation.Nullable String tokenBalanceUsd) { + this.tokenBalanceUsd = tokenBalanceUsd; + } + + public GetAddressPnLForSpecificTokenResponseData tokenBalanceAmount( + @jakarta.annotation.Nullable String tokenBalanceAmount) { + this.tokenBalanceAmount = tokenBalanceAmount; + return this; + } + + /** + * Current holding amount (token units). Returns \"0\" when fully sold. + * + * @return tokenBalanceAmount + */ + @jakarta.annotation.Nullable + public String getTokenBalanceAmount() { + return tokenBalanceAmount; + } + + public void setTokenBalanceAmount(@jakarta.annotation.Nullable String tokenBalanceAmount) { + this.tokenBalanceAmount = tokenBalanceAmount; + } + + public GetAddressPnLForSpecificTokenResponseData maxBalanceAmount( + @jakarta.annotation.Nullable String maxBalanceAmount) { + this.maxBalanceAmount = maxBalanceAmount; + return this; + } + + /** + * Maximum historical holding amount (token units). + * + * @return maxBalanceAmount + */ + @jakarta.annotation.Nullable + public String getMaxBalanceAmount() { + return maxBalanceAmount; + } + + public void setMaxBalanceAmount(@jakarta.annotation.Nullable String maxBalanceAmount) { + this.maxBalanceAmount = maxBalanceAmount; + } + + public GetAddressPnLForSpecificTokenResponseData holdingDuration( + @jakarta.annotation.Nullable String holdingDuration) { + this.holdingDuration = holdingDuration; + return this; + } + + /** + * Cumulative holding duration in milliseconds. Counts only actual holding periods; gaps between + * sell and re-buy are excluded. If still holding, counts up to the current time. + * + * @return holdingDuration + */ + @jakarta.annotation.Nullable + public String getHoldingDuration() { + return holdingDuration; + } + + public void setHoldingDuration(@jakarta.annotation.Nullable String holdingDuration) { + this.holdingDuration = holdingDuration; + } + + public GetAddressPnLForSpecificTokenResponseData isPnlSupported( + @jakarta.annotation.Nullable Boolean isPnlSupported) { + this.isPnlSupported = isPnlSupported; + return this; + } + + /** + * Whether PnL calculation is meaningful for this token. true=supported; false=not + * supported. Returns false for stablecoins (USDT/USDC/DAI etc.), native tokens (ETH/BNB/SOL + * etc.), and wrapped tokens (WETH/WBNB/WSOL etc.). Returns true for regular trading tokens. + * + * @return isPnlSupported + */ + @jakarta.annotation.Nullable + public Boolean getIsPnlSupported() { + return isPnlSupported; + } + + public void setIsPnlSupported(@jakarta.annotation.Nullable Boolean isPnlSupported) { + this.isPnlSupported = isPnlSupported; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAddressPnLForSpecificTokenResponseData getAddressPnLForSpecificTokenResponseData = + (GetAddressPnLForSpecificTokenResponseData) o; + return Objects.equals( + this.realizedPnlUsd, + getAddressPnLForSpecificTokenResponseData.realizedPnlUsd) + && Objects.equals( + this.realizedPnlPercent, + getAddressPnLForSpecificTokenResponseData.realizedPnlPercent) + && Objects.equals( + this.buyTxVolume, getAddressPnLForSpecificTokenResponseData.buyTxVolume) + && Objects.equals( + this.buyAmount, getAddressPnLForSpecificTokenResponseData.buyAmount) + && Objects.equals( + this.buyTxCount, getAddressPnLForSpecificTokenResponseData.buyTxCount) + && Objects.equals( + this.sellTxVolume, getAddressPnLForSpecificTokenResponseData.sellTxVolume) + && Objects.equals( + this.sellAmount, getAddressPnLForSpecificTokenResponseData.sellAmount) + && Objects.equals( + this.sellTxCount, getAddressPnLForSpecificTokenResponseData.sellTxCount) + && Objects.equals( + this.buyAvgPrice, getAddressPnLForSpecificTokenResponseData.buyAvgPrice) + && Objects.equals( + this.sellAvgPrice, getAddressPnLForSpecificTokenResponseData.sellAvgPrice) + && Objects.equals( + this.tokenBalanceUsd, + getAddressPnLForSpecificTokenResponseData.tokenBalanceUsd) + && Objects.equals( + this.tokenBalanceAmount, + getAddressPnLForSpecificTokenResponseData.tokenBalanceAmount) + && Objects.equals( + this.maxBalanceAmount, + getAddressPnLForSpecificTokenResponseData.maxBalanceAmount) + && Objects.equals( + this.holdingDuration, + getAddressPnLForSpecificTokenResponseData.holdingDuration) + && Objects.equals( + this.isPnlSupported, + getAddressPnLForSpecificTokenResponseData.isPnlSupported); + } + + @Override + public int hashCode() { + return Objects.hash( + realizedPnlUsd, + realizedPnlPercent, + buyTxVolume, + buyAmount, + buyTxCount, + sellTxVolume, + sellAmount, + sellTxCount, + buyAvgPrice, + sellAvgPrice, + tokenBalanceUsd, + tokenBalanceAmount, + maxBalanceAmount, + holdingDuration, + isPnlSupported); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressPnLForSpecificTokenResponseData {\n"); + sb.append(" realizedPnlUsd: ").append(toIndentedString(realizedPnlUsd)).append("\n"); + sb.append(" realizedPnlPercent: ") + .append(toIndentedString(realizedPnlPercent)) + .append("\n"); + sb.append(" buyTxVolume: ").append(toIndentedString(buyTxVolume)).append("\n"); + sb.append(" buyAmount: ").append(toIndentedString(buyAmount)).append("\n"); + sb.append(" buyTxCount: ").append(toIndentedString(buyTxCount)).append("\n"); + sb.append(" sellTxVolume: ").append(toIndentedString(sellTxVolume)).append("\n"); + sb.append(" sellAmount: ").append(toIndentedString(sellAmount)).append("\n"); + sb.append(" sellTxCount: ").append(toIndentedString(sellTxCount)).append("\n"); + sb.append(" buyAvgPrice: ").append(toIndentedString(buyAvgPrice)).append("\n"); + sb.append(" sellAvgPrice: ").append(toIndentedString(sellAvgPrice)).append("\n"); + sb.append(" tokenBalanceUsd: ").append(toIndentedString(tokenBalanceUsd)).append("\n"); + sb.append(" tokenBalanceAmount: ") + .append(toIndentedString(tokenBalanceAmount)) + .append("\n"); + sb.append(" maxBalanceAmount: ").append(toIndentedString(maxBalanceAmount)).append("\n"); + sb.append(" holdingDuration: ").append(toIndentedString(holdingDuration)).append("\n"); + sb.append(" isPnlSupported: ").append(toIndentedString(isPnlSupported)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object realizedPnlUsdValue = getRealizedPnlUsd(); + String realizedPnlUsdValueAsString = ""; + realizedPnlUsdValueAsString = realizedPnlUsdValue.toString(); + sb.append("realizedPnlUsd=").append(urlEncode(realizedPnlUsdValueAsString)).append(""); + Object realizedPnlPercentValue = getRealizedPnlPercent(); + String realizedPnlPercentValueAsString = ""; + realizedPnlPercentValueAsString = realizedPnlPercentValue.toString(); + sb.append("realizedPnlPercent=") + .append(urlEncode(realizedPnlPercentValueAsString)) + .append(""); + Object buyTxVolumeValue = getBuyTxVolume(); + String buyTxVolumeValueAsString = ""; + buyTxVolumeValueAsString = buyTxVolumeValue.toString(); + sb.append("buyTxVolume=").append(urlEncode(buyTxVolumeValueAsString)).append(""); + Object buyAmountValue = getBuyAmount(); + String buyAmountValueAsString = ""; + buyAmountValueAsString = buyAmountValue.toString(); + sb.append("buyAmount=").append(urlEncode(buyAmountValueAsString)).append(""); + Object buyTxCountValue = getBuyTxCount(); + String buyTxCountValueAsString = ""; + buyTxCountValueAsString = buyTxCountValue.toString(); + sb.append("buyTxCount=").append(urlEncode(buyTxCountValueAsString)).append(""); + Object sellTxVolumeValue = getSellTxVolume(); + String sellTxVolumeValueAsString = ""; + sellTxVolumeValueAsString = sellTxVolumeValue.toString(); + sb.append("sellTxVolume=").append(urlEncode(sellTxVolumeValueAsString)).append(""); + Object sellAmountValue = getSellAmount(); + String sellAmountValueAsString = ""; + sellAmountValueAsString = sellAmountValue.toString(); + sb.append("sellAmount=").append(urlEncode(sellAmountValueAsString)).append(""); + Object sellTxCountValue = getSellTxCount(); + String sellTxCountValueAsString = ""; + sellTxCountValueAsString = sellTxCountValue.toString(); + sb.append("sellTxCount=").append(urlEncode(sellTxCountValueAsString)).append(""); + Object buyAvgPriceValue = getBuyAvgPrice(); + String buyAvgPriceValueAsString = ""; + buyAvgPriceValueAsString = buyAvgPriceValue.toString(); + sb.append("buyAvgPrice=").append(urlEncode(buyAvgPriceValueAsString)).append(""); + Object sellAvgPriceValue = getSellAvgPrice(); + String sellAvgPriceValueAsString = ""; + sellAvgPriceValueAsString = sellAvgPriceValue.toString(); + sb.append("sellAvgPrice=").append(urlEncode(sellAvgPriceValueAsString)).append(""); + Object tokenBalanceUsdValue = getTokenBalanceUsd(); + String tokenBalanceUsdValueAsString = ""; + tokenBalanceUsdValueAsString = tokenBalanceUsdValue.toString(); + sb.append("tokenBalanceUsd=").append(urlEncode(tokenBalanceUsdValueAsString)).append(""); + Object tokenBalanceAmountValue = getTokenBalanceAmount(); + String tokenBalanceAmountValueAsString = ""; + tokenBalanceAmountValueAsString = tokenBalanceAmountValue.toString(); + sb.append("tokenBalanceAmount=") + .append(urlEncode(tokenBalanceAmountValueAsString)) + .append(""); + Object maxBalanceAmountValue = getMaxBalanceAmount(); + String maxBalanceAmountValueAsString = ""; + maxBalanceAmountValueAsString = maxBalanceAmountValue.toString(); + sb.append("maxBalanceAmount=").append(urlEncode(maxBalanceAmountValueAsString)).append(""); + Object holdingDurationValue = getHoldingDuration(); + String holdingDurationValueAsString = ""; + holdingDurationValueAsString = holdingDurationValue.toString(); + sb.append("holdingDuration=").append(urlEncode(holdingDurationValueAsString)).append(""); + Object isPnlSupportedValue = getIsPnlSupported(); + String isPnlSupportedValueAsString = ""; + isPnlSupportedValueAsString = isPnlSupportedValue.toString(); + sb.append("isPnlSupported=").append(urlEncode(isPnlSupportedValueAsString)).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("realizedPnlUsd"); + openapiFields.add("realizedPnlPercent"); + openapiFields.add("buyTxVolume"); + openapiFields.add("buyAmount"); + openapiFields.add("buyTxCount"); + openapiFields.add("sellTxVolume"); + openapiFields.add("sellAmount"); + openapiFields.add("sellTxCount"); + openapiFields.add("buyAvgPrice"); + openapiFields.add("sellAvgPrice"); + openapiFields.add("tokenBalanceUsd"); + openapiFields.add("tokenBalanceAmount"); + openapiFields.add("maxBalanceAmount"); + openapiFields.add("holdingDuration"); + openapiFields.add("isPnlSupported"); + + // 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 + * GetAddressPnLForSpecificTokenResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressPnLForSpecificTokenResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAddressPnLForSpecificTokenResponseData is not found in" + + " the empty JSON string", + GetAddressPnLForSpecificTokenResponseData.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("realizedPnlUsd") != null && !jsonObj.get("realizedPnlUsd").isJsonNull()) + && !jsonObj.get("realizedPnlUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `realizedPnlUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("realizedPnlUsd").toString())); + } + if ((jsonObj.get("realizedPnlPercent") != null + && !jsonObj.get("realizedPnlPercent").isJsonNull()) + && !jsonObj.get("realizedPnlPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `realizedPnlPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("realizedPnlPercent").toString())); + } + if ((jsonObj.get("buyTxVolume") != null && !jsonObj.get("buyTxVolume").isJsonNull()) + && !jsonObj.get("buyTxVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyTxVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyTxVolume").toString())); + } + if ((jsonObj.get("buyAmount") != null && !jsonObj.get("buyAmount").isJsonNull()) + && !jsonObj.get("buyAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyAmount").toString())); + } + if ((jsonObj.get("buyTxCount") != null && !jsonObj.get("buyTxCount").isJsonNull()) + && !jsonObj.get("buyTxCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyTxCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyTxCount").toString())); + } + if ((jsonObj.get("sellTxVolume") != null && !jsonObj.get("sellTxVolume").isJsonNull()) + && !jsonObj.get("sellTxVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellTxVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellTxVolume").toString())); + } + if ((jsonObj.get("sellAmount") != null && !jsonObj.get("sellAmount").isJsonNull()) + && !jsonObj.get("sellAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellAmount").toString())); + } + if ((jsonObj.get("sellTxCount") != null && !jsonObj.get("sellTxCount").isJsonNull()) + && !jsonObj.get("sellTxCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellTxCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellTxCount").toString())); + } + if ((jsonObj.get("buyAvgPrice") != null && !jsonObj.get("buyAvgPrice").isJsonNull()) + && !jsonObj.get("buyAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyAvgPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyAvgPrice").toString())); + } + if ((jsonObj.get("sellAvgPrice") != null && !jsonObj.get("sellAvgPrice").isJsonNull()) + && !jsonObj.get("sellAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellAvgPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellAvgPrice").toString())); + } + if ((jsonObj.get("tokenBalanceUsd") != null && !jsonObj.get("tokenBalanceUsd").isJsonNull()) + && !jsonObj.get("tokenBalanceUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenBalanceUsd` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("tokenBalanceUsd").toString())); + } + if ((jsonObj.get("tokenBalanceAmount") != null + && !jsonObj.get("tokenBalanceAmount").isJsonNull()) + && !jsonObj.get("tokenBalanceAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenBalanceAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("tokenBalanceAmount").toString())); + } + if ((jsonObj.get("maxBalanceAmount") != null + && !jsonObj.get("maxBalanceAmount").isJsonNull()) + && !jsonObj.get("maxBalanceAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxBalanceAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("maxBalanceAmount").toString())); + } + if ((jsonObj.get("holdingDuration") != null && !jsonObj.get("holdingDuration").isJsonNull()) + && !jsonObj.get("holdingDuration").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `holdingDuration` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("holdingDuration").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressPnLForSpecificTokenResponseData.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAddressPnLForSpecificTokenResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAddressPnLForSpecificTokenResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetAddressPnLForSpecificTokenResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressPnLForSpecificTokenResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressPnLForSpecificTokenResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressPnLForSpecificTokenResponseData + * @throws IOException if the JSON string is invalid with respect to + * GetAddressPnLForSpecificTokenResponseData + */ + public static GetAddressPnLForSpecificTokenResponseData fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetAddressPnLForSpecificTokenResponseData.class); + } + + /** + * Convert an instance of GetAddressPnLForSpecificTokenResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponse.java new file mode 100644 index 0000000..79f80f5 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponse.java @@ -0,0 +1,355 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetAddressPortfolioOverviewResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressPortfolioOverviewResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetAddressPortfolioOverviewResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetAddressPortfolioOverviewResponse() {} + + public GetAddressPortfolioOverviewResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetAddressPortfolioOverviewResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetAddressPortfolioOverviewResponse data( + @jakarta.annotation.Nullable GetAddressPortfolioOverviewResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetAddressPortfolioOverviewResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetAddressPortfolioOverviewResponseData data) { + this.data = data; + } + + public GetAddressPortfolioOverviewResponse timestamp( + @jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetAddressPortfolioOverviewResponse 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; + } + GetAddressPortfolioOverviewResponse getAddressPortfolioOverviewResponse = + (GetAddressPortfolioOverviewResponse) o; + return Objects.equals(this.code, getAddressPortfolioOverviewResponse.code) + && Objects.equals(this.msg, getAddressPortfolioOverviewResponse.msg) + && Objects.equals(this.data, getAddressPortfolioOverviewResponse.data) + && Objects.equals(this.timestamp, getAddressPortfolioOverviewResponse.timestamp) + && Objects.equals(this.success, getAddressPortfolioOverviewResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressPortfolioOverviewResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * GetAddressPortfolioOverviewResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressPortfolioOverviewResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAddressPortfolioOverviewResponse is" + + " not found in the empty JSON string", + GetAddressPortfolioOverviewResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetAddressPortfolioOverviewResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressPortfolioOverviewResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAddressPortfolioOverviewResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAddressPortfolioOverviewResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAddressPortfolioOverviewResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressPortfolioOverviewResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressPortfolioOverviewResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressPortfolioOverviewResponse + * @throws IOException if the JSON string is invalid with respect to + * GetAddressPortfolioOverviewResponse + */ + public static GetAddressPortfolioOverviewResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetAddressPortfolioOverviewResponse.class); + } + + /** + * Convert an instance of GetAddressPortfolioOverviewResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseData.java new file mode 100644 index 0000000..7e82374 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseData.java @@ -0,0 +1,883 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** Address portfolio overview. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressPortfolioOverviewResponseData { + public static final String SERIALIZED_NAME_REALIZED_PNL_USD = "realizedPnlUsd"; + + @SerializedName(SERIALIZED_NAME_REALIZED_PNL_USD) + @jakarta.annotation.Nullable + private String realizedPnlUsd; + + public static final String SERIALIZED_NAME_REALIZED_PNL_PERCENT = "realizedPnlPercent"; + + @SerializedName(SERIALIZED_NAME_REALIZED_PNL_PERCENT) + @jakarta.annotation.Nullable + private String realizedPnlPercent; + + public static final String SERIALIZED_NAME_DAILY_PNL = "dailyPnl"; + + @SerializedName(SERIALIZED_NAME_DAILY_PNL) + @jakarta.annotation.Nullable + private List<@Valid GetAddressPortfolioOverviewResponseDataDailyPnlInner> dailyPnl; + + public static final String SERIALIZED_NAME_WIN_RATE = "winRate"; + + @SerializedName(SERIALIZED_NAME_WIN_RATE) + @jakarta.annotation.Nullable + private String winRate; + + public static final String SERIALIZED_NAME_TOKEN_COUNT_BY_PNL_PERCENT = + "tokenCountByPnlPercent"; + + @SerializedName(SERIALIZED_NAME_TOKEN_COUNT_BY_PNL_PERCENT) + @jakarta.annotation.Nullable + private GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent tokenCountByPnlPercent; + + public static final String SERIALIZED_NAME_BUY_TX_COUNT = "buyTxCount"; + + @SerializedName(SERIALIZED_NAME_BUY_TX_COUNT) + @jakarta.annotation.Nullable + private String buyTxCount; + + public static final String SERIALIZED_NAME_SELL_TX_COUNT = "sellTxCount"; + + @SerializedName(SERIALIZED_NAME_SELL_TX_COUNT) + @jakarta.annotation.Nullable + private String sellTxCount; + + public static final String SERIALIZED_NAME_TOTAL_TOKEN_COUNT = "totalTokenCount"; + + @SerializedName(SERIALIZED_NAME_TOTAL_TOKEN_COUNT) + @jakarta.annotation.Nullable + private String totalTokenCount; + + public static final String SERIALIZED_NAME_BUY_TX_VOLUME = "buyTxVolume"; + + @SerializedName(SERIALIZED_NAME_BUY_TX_VOLUME) + @jakarta.annotation.Nullable + private String buyTxVolume; + + public static final String SERIALIZED_NAME_SELL_TX_VOLUME = "sellTxVolume"; + + @SerializedName(SERIALIZED_NAME_SELL_TX_VOLUME) + @jakarta.annotation.Nullable + private String sellTxVolume; + + public static final String SERIALIZED_NAME_AVG_BUY_VALUE_USD = "avgBuyValueUsd"; + + @SerializedName(SERIALIZED_NAME_AVG_BUY_VALUE_USD) + @jakarta.annotation.Nullable + private String avgBuyValueUsd; + + public static final String SERIALIZED_NAME_TOP3_PNL_TOKEN_SUM_USD = "top3PnlTokenSumUsd"; + + @SerializedName(SERIALIZED_NAME_TOP3_PNL_TOKEN_SUM_USD) + @jakarta.annotation.Nullable + private String top3PnlTokenSumUsd; + + public static final String SERIALIZED_NAME_TOP3_PNL_TOKEN_PERCENT = "top3PnlTokenPercent"; + + @SerializedName(SERIALIZED_NAME_TOP3_PNL_TOKEN_PERCENT) + @jakarta.annotation.Nullable + private String top3PnlTokenPercent; + + public static final String SERIALIZED_NAME_TOP_PNL_TOKEN_LIST = "topPnlTokenList"; + + @SerializedName(SERIALIZED_NAME_TOP_PNL_TOKEN_LIST) + @jakarta.annotation.Nullable + private List<@Valid GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner> + topPnlTokenList; + + public GetAddressPortfolioOverviewResponseData() {} + + public GetAddressPortfolioOverviewResponseData realizedPnlUsd( + @jakarta.annotation.Nullable String realizedPnlUsd) { + this.realizedPnlUsd = realizedPnlUsd; + return this; + } + + /** + * Total realized PnL within the time frame, denominated in USD. Positive means profit, negative + * means loss. + * + * @return realizedPnlUsd + */ + @jakarta.annotation.Nullable + public String getRealizedPnlUsd() { + return realizedPnlUsd; + } + + public void setRealizedPnlUsd(@jakarta.annotation.Nullable String realizedPnlUsd) { + this.realizedPnlUsd = realizedPnlUsd; + } + + public GetAddressPortfolioOverviewResponseData realizedPnlPercent( + @jakarta.annotation.Nullable String realizedPnlPercent) { + this.realizedPnlPercent = realizedPnlPercent; + return this; + } + + /** + * Realized PnL percentage within the time frame. \"16.44\" means +16.44%. No percent + * sign included. + * + * @return realizedPnlPercent + */ + @jakarta.annotation.Nullable + public String getRealizedPnlPercent() { + return realizedPnlPercent; + } + + public void setRealizedPnlPercent(@jakarta.annotation.Nullable String realizedPnlPercent) { + this.realizedPnlPercent = realizedPnlPercent; + } + + public GetAddressPortfolioOverviewResponseData dailyPnl( + @jakarta.annotation.Nullable + List<@Valid GetAddressPortfolioOverviewResponseDataDailyPnlInner> dailyPnl) { + this.dailyPnl = dailyPnl; + return this; + } + + public GetAddressPortfolioOverviewResponseData addDailyPnlItem( + GetAddressPortfolioOverviewResponseDataDailyPnlInner dailyPnlItem) { + if (this.dailyPnl == null) { + this.dailyPnl = new ArrayList<>(); + } + this.dailyPnl.add(dailyPnlItem); + return this; + } + + /** + * Daily realized PnL breakdown, sorted by date descending (most recent first). Number of + * entries matches the timeFrame. + * + * @return dailyPnl + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetAddressPortfolioOverviewResponseDataDailyPnlInner> getDailyPnl() { + return dailyPnl; + } + + public void setDailyPnl( + @jakarta.annotation.Nullable + List<@Valid GetAddressPortfolioOverviewResponseDataDailyPnlInner> dailyPnl) { + this.dailyPnl = dailyPnl; + } + + public GetAddressPortfolioOverviewResponseData winRate( + @jakarta.annotation.Nullable String winRate) { + this.winRate = winRate; + return this; + } + + /** + * Win rate within the time frame. \"61.11\" means 61.11%. No percent sign included. + * + * @return winRate + */ + @jakarta.annotation.Nullable + public String getWinRate() { + return winRate; + } + + public void setWinRate(@jakarta.annotation.Nullable String winRate) { + this.winRate = winRate; + } + + public GetAddressPortfolioOverviewResponseData tokenCountByPnlPercent( + @jakarta.annotation.Nullable + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + tokenCountByPnlPercent) { + this.tokenCountByPnlPercent = tokenCountByPnlPercent; + return this; + } + + /** + * Get tokenCountByPnlPercent + * + * @return tokenCountByPnlPercent + */ + @jakarta.annotation.Nullable + @Valid + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + getTokenCountByPnlPercent() { + return tokenCountByPnlPercent; + } + + public void setTokenCountByPnlPercent( + @jakarta.annotation.Nullable + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + tokenCountByPnlPercent) { + this.tokenCountByPnlPercent = tokenCountByPnlPercent; + } + + public GetAddressPortfolioOverviewResponseData buyTxCount( + @jakarta.annotation.Nullable String buyTxCount) { + this.buyTxCount = buyTxCount; + return this; + } + + /** + * Number of buy transactions within the time frame. + * + * @return buyTxCount + */ + @jakarta.annotation.Nullable + public String getBuyTxCount() { + return buyTxCount; + } + + public void setBuyTxCount(@jakarta.annotation.Nullable String buyTxCount) { + this.buyTxCount = buyTxCount; + } + + public GetAddressPortfolioOverviewResponseData sellTxCount( + @jakarta.annotation.Nullable String sellTxCount) { + this.sellTxCount = sellTxCount; + return this; + } + + /** + * Number of sell transactions within the time frame. + * + * @return sellTxCount + */ + @jakarta.annotation.Nullable + public String getSellTxCount() { + return sellTxCount; + } + + public void setSellTxCount(@jakarta.annotation.Nullable String sellTxCount) { + this.sellTxCount = sellTxCount; + } + + public GetAddressPortfolioOverviewResponseData totalTokenCount( + @jakarta.annotation.Nullable String totalTokenCount) { + this.totalTokenCount = totalTokenCount; + return this; + } + + /** + * Total number of distinct tokens traded within the time frame. + * + * @return totalTokenCount + */ + @jakarta.annotation.Nullable + public String getTotalTokenCount() { + return totalTokenCount; + } + + public void setTotalTokenCount(@jakarta.annotation.Nullable String totalTokenCount) { + this.totalTokenCount = totalTokenCount; + } + + public GetAddressPortfolioOverviewResponseData buyTxVolume( + @jakarta.annotation.Nullable String buyTxVolume) { + this.buyTxVolume = buyTxVolume; + return this; + } + + /** + * Total buy volume within the time frame, denominated in USD. + * + * @return buyTxVolume + */ + @jakarta.annotation.Nullable + public String getBuyTxVolume() { + return buyTxVolume; + } + + public void setBuyTxVolume(@jakarta.annotation.Nullable String buyTxVolume) { + this.buyTxVolume = buyTxVolume; + } + + public GetAddressPortfolioOverviewResponseData sellTxVolume( + @jakarta.annotation.Nullable String sellTxVolume) { + this.sellTxVolume = sellTxVolume; + return this; + } + + /** + * Total sell volume within the time frame, denominated in USD. + * + * @return sellTxVolume + */ + @jakarta.annotation.Nullable + public String getSellTxVolume() { + return sellTxVolume; + } + + public void setSellTxVolume(@jakarta.annotation.Nullable String sellTxVolume) { + this.sellTxVolume = sellTxVolume; + } + + public GetAddressPortfolioOverviewResponseData avgBuyValueUsd( + @jakarta.annotation.Nullable String avgBuyValueUsd) { + this.avgBuyValueUsd = avgBuyValueUsd; + return this; + } + + /** + * Average buy value per transaction within the time frame, denominated in USD. + * + * @return avgBuyValueUsd + */ + @jakarta.annotation.Nullable + public String getAvgBuyValueUsd() { + return avgBuyValueUsd; + } + + public void setAvgBuyValueUsd(@jakarta.annotation.Nullable String avgBuyValueUsd) { + this.avgBuyValueUsd = avgBuyValueUsd; + } + + public GetAddressPortfolioOverviewResponseData top3PnlTokenSumUsd( + @jakarta.annotation.Nullable String top3PnlTokenSumUsd) { + this.top3PnlTokenSumUsd = top3PnlTokenSumUsd; + return this; + } + + /** + * Total realized PnL of the top 3 profit tokens, denominated in USD. + * + * @return top3PnlTokenSumUsd + */ + @jakarta.annotation.Nullable + public String getTop3PnlTokenSumUsd() { + return top3PnlTokenSumUsd; + } + + public void setTop3PnlTokenSumUsd(@jakarta.annotation.Nullable String top3PnlTokenSumUsd) { + this.top3PnlTokenSumUsd = top3PnlTokenSumUsd; + } + + public GetAddressPortfolioOverviewResponseData top3PnlTokenPercent( + @jakarta.annotation.Nullable String top3PnlTokenPercent) { + this.top3PnlTokenPercent = top3PnlTokenPercent; + return this; + } + + /** + * Percentage of total realized PnL contributed by the top 3 profit tokens. No percent sign + * included. + * + * @return top3PnlTokenPercent + */ + @jakarta.annotation.Nullable + public String getTop3PnlTokenPercent() { + return top3PnlTokenPercent; + } + + public void setTop3PnlTokenPercent(@jakarta.annotation.Nullable String top3PnlTokenPercent) { + this.top3PnlTokenPercent = top3PnlTokenPercent; + } + + public GetAddressPortfolioOverviewResponseData topPnlTokenList( + @jakarta.annotation.Nullable + List<@Valid GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner> + topPnlTokenList) { + this.topPnlTokenList = topPnlTokenList; + return this; + } + + public GetAddressPortfolioOverviewResponseData addTopPnlTokenListItem( + GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner topPnlTokenListItem) { + if (this.topPnlTokenList == null) { + this.topPnlTokenList = new ArrayList<>(); + } + this.topPnlTokenList.add(topPnlTokenListItem); + return this; + } + + /** + * Top 3 tokens by realized PnL. Returns fewer items if fewer than 3 tokens were traded. + * + * @return topPnlTokenList + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner> + getTopPnlTokenList() { + return topPnlTokenList; + } + + public void setTopPnlTokenList( + @jakarta.annotation.Nullable + List<@Valid GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner> + topPnlTokenList) { + this.topPnlTokenList = topPnlTokenList; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAddressPortfolioOverviewResponseData getAddressPortfolioOverviewResponseData = + (GetAddressPortfolioOverviewResponseData) o; + return Objects.equals( + this.realizedPnlUsd, getAddressPortfolioOverviewResponseData.realizedPnlUsd) + && Objects.equals( + this.realizedPnlPercent, + getAddressPortfolioOverviewResponseData.realizedPnlPercent) + && Objects.equals(this.dailyPnl, getAddressPortfolioOverviewResponseData.dailyPnl) + && Objects.equals(this.winRate, getAddressPortfolioOverviewResponseData.winRate) + && Objects.equals( + this.tokenCountByPnlPercent, + getAddressPortfolioOverviewResponseData.tokenCountByPnlPercent) + && Objects.equals( + this.buyTxCount, getAddressPortfolioOverviewResponseData.buyTxCount) + && Objects.equals( + this.sellTxCount, getAddressPortfolioOverviewResponseData.sellTxCount) + && Objects.equals( + this.totalTokenCount, + getAddressPortfolioOverviewResponseData.totalTokenCount) + && Objects.equals( + this.buyTxVolume, getAddressPortfolioOverviewResponseData.buyTxVolume) + && Objects.equals( + this.sellTxVolume, getAddressPortfolioOverviewResponseData.sellTxVolume) + && Objects.equals( + this.avgBuyValueUsd, getAddressPortfolioOverviewResponseData.avgBuyValueUsd) + && Objects.equals( + this.top3PnlTokenSumUsd, + getAddressPortfolioOverviewResponseData.top3PnlTokenSumUsd) + && Objects.equals( + this.top3PnlTokenPercent, + getAddressPortfolioOverviewResponseData.top3PnlTokenPercent) + && Objects.equals( + this.topPnlTokenList, + getAddressPortfolioOverviewResponseData.topPnlTokenList); + } + + @Override + public int hashCode() { + return Objects.hash( + realizedPnlUsd, + realizedPnlPercent, + dailyPnl, + winRate, + tokenCountByPnlPercent, + buyTxCount, + sellTxCount, + totalTokenCount, + buyTxVolume, + sellTxVolume, + avgBuyValueUsd, + top3PnlTokenSumUsd, + top3PnlTokenPercent, + topPnlTokenList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressPortfolioOverviewResponseData {\n"); + sb.append(" realizedPnlUsd: ").append(toIndentedString(realizedPnlUsd)).append("\n"); + sb.append(" realizedPnlPercent: ") + .append(toIndentedString(realizedPnlPercent)) + .append("\n"); + sb.append(" dailyPnl: ").append(toIndentedString(dailyPnl)).append("\n"); + sb.append(" winRate: ").append(toIndentedString(winRate)).append("\n"); + sb.append(" tokenCountByPnlPercent: ") + .append(toIndentedString(tokenCountByPnlPercent)) + .append("\n"); + sb.append(" buyTxCount: ").append(toIndentedString(buyTxCount)).append("\n"); + sb.append(" sellTxCount: ").append(toIndentedString(sellTxCount)).append("\n"); + sb.append(" totalTokenCount: ").append(toIndentedString(totalTokenCount)).append("\n"); + sb.append(" buyTxVolume: ").append(toIndentedString(buyTxVolume)).append("\n"); + sb.append(" sellTxVolume: ").append(toIndentedString(sellTxVolume)).append("\n"); + sb.append(" avgBuyValueUsd: ").append(toIndentedString(avgBuyValueUsd)).append("\n"); + sb.append(" top3PnlTokenSumUsd: ") + .append(toIndentedString(top3PnlTokenSumUsd)) + .append("\n"); + sb.append(" top3PnlTokenPercent: ") + .append(toIndentedString(top3PnlTokenPercent)) + .append("\n"); + sb.append(" topPnlTokenList: ").append(toIndentedString(topPnlTokenList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object realizedPnlUsdValue = getRealizedPnlUsd(); + String realizedPnlUsdValueAsString = ""; + realizedPnlUsdValueAsString = realizedPnlUsdValue.toString(); + sb.append("realizedPnlUsd=").append(urlEncode(realizedPnlUsdValueAsString)).append(""); + Object realizedPnlPercentValue = getRealizedPnlPercent(); + String realizedPnlPercentValueAsString = ""; + realizedPnlPercentValueAsString = realizedPnlPercentValue.toString(); + sb.append("realizedPnlPercent=") + .append(urlEncode(realizedPnlPercentValueAsString)) + .append(""); + Object dailyPnlValue = getDailyPnl(); + String dailyPnlValueAsString = ""; + dailyPnlValueAsString = + (String) + ((Collection) dailyPnlValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("dailyPnl=").append(urlEncode(dailyPnlValueAsString)).append(""); + Object winRateValue = getWinRate(); + String winRateValueAsString = ""; + winRateValueAsString = winRateValue.toString(); + sb.append("winRate=").append(urlEncode(winRateValueAsString)).append(""); + Object tokenCountByPnlPercentValue = getTokenCountByPnlPercent(); + String tokenCountByPnlPercentValueAsString = ""; + tokenCountByPnlPercentValueAsString = tokenCountByPnlPercentValue.toString(); + sb.append("tokenCountByPnlPercent=") + .append(urlEncode(tokenCountByPnlPercentValueAsString)) + .append(""); + Object buyTxCountValue = getBuyTxCount(); + String buyTxCountValueAsString = ""; + buyTxCountValueAsString = buyTxCountValue.toString(); + sb.append("buyTxCount=").append(urlEncode(buyTxCountValueAsString)).append(""); + Object sellTxCountValue = getSellTxCount(); + String sellTxCountValueAsString = ""; + sellTxCountValueAsString = sellTxCountValue.toString(); + sb.append("sellTxCount=").append(urlEncode(sellTxCountValueAsString)).append(""); + Object totalTokenCountValue = getTotalTokenCount(); + String totalTokenCountValueAsString = ""; + totalTokenCountValueAsString = totalTokenCountValue.toString(); + sb.append("totalTokenCount=").append(urlEncode(totalTokenCountValueAsString)).append(""); + Object buyTxVolumeValue = getBuyTxVolume(); + String buyTxVolumeValueAsString = ""; + buyTxVolumeValueAsString = buyTxVolumeValue.toString(); + sb.append("buyTxVolume=").append(urlEncode(buyTxVolumeValueAsString)).append(""); + Object sellTxVolumeValue = getSellTxVolume(); + String sellTxVolumeValueAsString = ""; + sellTxVolumeValueAsString = sellTxVolumeValue.toString(); + sb.append("sellTxVolume=").append(urlEncode(sellTxVolumeValueAsString)).append(""); + Object avgBuyValueUsdValue = getAvgBuyValueUsd(); + String avgBuyValueUsdValueAsString = ""; + avgBuyValueUsdValueAsString = avgBuyValueUsdValue.toString(); + sb.append("avgBuyValueUsd=").append(urlEncode(avgBuyValueUsdValueAsString)).append(""); + Object top3PnlTokenSumUsdValue = getTop3PnlTokenSumUsd(); + String top3PnlTokenSumUsdValueAsString = ""; + top3PnlTokenSumUsdValueAsString = top3PnlTokenSumUsdValue.toString(); + sb.append("top3PnlTokenSumUsd=") + .append(urlEncode(top3PnlTokenSumUsdValueAsString)) + .append(""); + Object top3PnlTokenPercentValue = getTop3PnlTokenPercent(); + String top3PnlTokenPercentValueAsString = ""; + top3PnlTokenPercentValueAsString = top3PnlTokenPercentValue.toString(); + sb.append("top3PnlTokenPercent=") + .append(urlEncode(top3PnlTokenPercentValueAsString)) + .append(""); + Object topPnlTokenListValue = getTopPnlTokenList(); + String topPnlTokenListValueAsString = ""; + topPnlTokenListValueAsString = + (String) + ((Collection) topPnlTokenListValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("topPnlTokenList=").append(urlEncode(topPnlTokenListValueAsString)).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("realizedPnlUsd"); + openapiFields.add("realizedPnlPercent"); + openapiFields.add("dailyPnl"); + openapiFields.add("winRate"); + openapiFields.add("tokenCountByPnlPercent"); + openapiFields.add("buyTxCount"); + openapiFields.add("sellTxCount"); + openapiFields.add("totalTokenCount"); + openapiFields.add("buyTxVolume"); + openapiFields.add("sellTxVolume"); + openapiFields.add("avgBuyValueUsd"); + openapiFields.add("top3PnlTokenSumUsd"); + openapiFields.add("top3PnlTokenPercent"); + openapiFields.add("topPnlTokenList"); + + // 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 + * GetAddressPortfolioOverviewResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressPortfolioOverviewResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAddressPortfolioOverviewResponseData is not found in the" + + " empty JSON string", + GetAddressPortfolioOverviewResponseData.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("realizedPnlUsd") != null && !jsonObj.get("realizedPnlUsd").isJsonNull()) + && !jsonObj.get("realizedPnlUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `realizedPnlUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("realizedPnlUsd").toString())); + } + if ((jsonObj.get("realizedPnlPercent") != null + && !jsonObj.get("realizedPnlPercent").isJsonNull()) + && !jsonObj.get("realizedPnlPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `realizedPnlPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("realizedPnlPercent").toString())); + } + if (jsonObj.get("dailyPnl") != null && !jsonObj.get("dailyPnl").isJsonNull()) { + JsonArray jsonArraydailyPnl = jsonObj.getAsJsonArray("dailyPnl"); + if (jsonArraydailyPnl != null) { + // ensure the json data is an array + if (!jsonObj.get("dailyPnl").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dailyPnl` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("dailyPnl").toString())); + } + + // validate the optional field `dailyPnl` (array) + for (int i = 0; i < jsonArraydailyPnl.size(); i++) { + GetAddressPortfolioOverviewResponseDataDailyPnlInner.validateJsonElement( + jsonArraydailyPnl.get(i)); + } + ; + } + } + if ((jsonObj.get("winRate") != null && !jsonObj.get("winRate").isJsonNull()) + && !jsonObj.get("winRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `winRate` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("winRate").toString())); + } + // validate the optional field `tokenCountByPnlPercent` + if (jsonObj.get("tokenCountByPnlPercent") != null + && !jsonObj.get("tokenCountByPnlPercent").isJsonNull()) { + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.validateJsonElement( + jsonObj.get("tokenCountByPnlPercent")); + } + if ((jsonObj.get("buyTxCount") != null && !jsonObj.get("buyTxCount").isJsonNull()) + && !jsonObj.get("buyTxCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyTxCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyTxCount").toString())); + } + if ((jsonObj.get("sellTxCount") != null && !jsonObj.get("sellTxCount").isJsonNull()) + && !jsonObj.get("sellTxCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellTxCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellTxCount").toString())); + } + if ((jsonObj.get("totalTokenCount") != null && !jsonObj.get("totalTokenCount").isJsonNull()) + && !jsonObj.get("totalTokenCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalTokenCount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("totalTokenCount").toString())); + } + if ((jsonObj.get("buyTxVolume") != null && !jsonObj.get("buyTxVolume").isJsonNull()) + && !jsonObj.get("buyTxVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyTxVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyTxVolume").toString())); + } + if ((jsonObj.get("sellTxVolume") != null && !jsonObj.get("sellTxVolume").isJsonNull()) + && !jsonObj.get("sellTxVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellTxVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellTxVolume").toString())); + } + if ((jsonObj.get("avgBuyValueUsd") != null && !jsonObj.get("avgBuyValueUsd").isJsonNull()) + && !jsonObj.get("avgBuyValueUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `avgBuyValueUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("avgBuyValueUsd").toString())); + } + if ((jsonObj.get("top3PnlTokenSumUsd") != null + && !jsonObj.get("top3PnlTokenSumUsd").isJsonNull()) + && !jsonObj.get("top3PnlTokenSumUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `top3PnlTokenSumUsd` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("top3PnlTokenSumUsd").toString())); + } + if ((jsonObj.get("top3PnlTokenPercent") != null + && !jsonObj.get("top3PnlTokenPercent").isJsonNull()) + && !jsonObj.get("top3PnlTokenPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `top3PnlTokenPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("top3PnlTokenPercent").toString())); + } + if (jsonObj.get("topPnlTokenList") != null + && !jsonObj.get("topPnlTokenList").isJsonNull()) { + JsonArray jsonArraytopPnlTokenList = jsonObj.getAsJsonArray("topPnlTokenList"); + if (jsonArraytopPnlTokenList != null) { + // ensure the json data is an array + if (!jsonObj.get("topPnlTokenList").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `topPnlTokenList` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("topPnlTokenList").toString())); + } + + // validate the optional field `topPnlTokenList` (array) + for (int i = 0; i < jsonArraytopPnlTokenList.size(); i++) { + GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.validateJsonElement( + jsonArraytopPnlTokenList.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressPortfolioOverviewResponseData.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'GetAddressPortfolioOverviewResponseData' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAddressPortfolioOverviewResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetAddressPortfolioOverviewResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressPortfolioOverviewResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressPortfolioOverviewResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressPortfolioOverviewResponseData + * @throws IOException if the JSON string is invalid with respect to + * GetAddressPortfolioOverviewResponseData + */ + public static GetAddressPortfolioOverviewResponseData fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetAddressPortfolioOverviewResponseData.class); + } + + /** + * Convert an instance of GetAddressPortfolioOverviewResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataDailyPnlInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataDailyPnlInner.java new file mode 100644 index 0000000..a1663b2 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataDailyPnlInner.java @@ -0,0 +1,272 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetAddressPortfolioOverviewResponseDataDailyPnlInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressPortfolioOverviewResponseDataDailyPnlInner { + public static final String SERIALIZED_NAME_DATE = "date"; + + @SerializedName(SERIALIZED_NAME_DATE) + @jakarta.annotation.Nullable + private String date; + + public static final String SERIALIZED_NAME_PNL_USD = "pnlUsd"; + + @SerializedName(SERIALIZED_NAME_PNL_USD) + @jakarta.annotation.Nullable + private String pnlUsd; + + public GetAddressPortfolioOverviewResponseDataDailyPnlInner() {} + + public GetAddressPortfolioOverviewResponseDataDailyPnlInner date( + @jakarta.annotation.Nullable String date) { + this.date = date; + return this; + } + + /** + * Date in YYYY-MM-DD format. + * + * @return date + */ + @jakarta.annotation.Nullable + public String getDate() { + return date; + } + + public void setDate(@jakarta.annotation.Nullable String date) { + this.date = date; + } + + public GetAddressPortfolioOverviewResponseDataDailyPnlInner pnlUsd( + @jakarta.annotation.Nullable String pnlUsd) { + this.pnlUsd = pnlUsd; + return this; + } + + /** + * Realized PnL for this day, denominated in USD. Positive means profit, negative means loss. + * + * @return pnlUsd + */ + @jakarta.annotation.Nullable + public String getPnlUsd() { + return pnlUsd; + } + + public void setPnlUsd(@jakarta.annotation.Nullable String pnlUsd) { + this.pnlUsd = pnlUsd; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAddressPortfolioOverviewResponseDataDailyPnlInner + getAddressPortfolioOverviewResponseDataDailyPnlInner = + (GetAddressPortfolioOverviewResponseDataDailyPnlInner) o; + return Objects.equals(this.date, getAddressPortfolioOverviewResponseDataDailyPnlInner.date) + && Objects.equals( + this.pnlUsd, getAddressPortfolioOverviewResponseDataDailyPnlInner.pnlUsd); + } + + @Override + public int hashCode() { + return Objects.hash(date, pnlUsd); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressPortfolioOverviewResponseDataDailyPnlInner {\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" pnlUsd: ").append(toIndentedString(pnlUsd)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object dateValue = getDate(); + String dateValueAsString = ""; + dateValueAsString = dateValue.toString(); + sb.append("date=").append(urlEncode(dateValueAsString)).append(""); + Object pnlUsdValue = getPnlUsd(); + String pnlUsdValueAsString = ""; + pnlUsdValueAsString = pnlUsdValue.toString(); + sb.append("pnlUsd=").append(urlEncode(pnlUsdValueAsString)).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("date"); + openapiFields.add("pnlUsd"); + + // 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 + * GetAddressPortfolioOverviewResponseDataDailyPnlInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressPortfolioOverviewResponseDataDailyPnlInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAddressPortfolioOverviewResponseDataDailyPnlInner is not" + + " found in the empty JSON string", + GetAddressPortfolioOverviewResponseDataDailyPnlInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("date") != null && !jsonObj.get("date").isJsonNull()) + && !jsonObj.get("date").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `date` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("date").toString())); + } + if ((jsonObj.get("pnlUsd") != null && !jsonObj.get("pnlUsd").isJsonNull()) + && !jsonObj.get("pnlUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pnlUsd` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("pnlUsd").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressPortfolioOverviewResponseDataDailyPnlInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAddressPortfolioOverviewResponseDataDailyPnlInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetAddressPortfolioOverviewResponseDataDailyPnlInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetAddressPortfolioOverviewResponseDataDailyPnlInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressPortfolioOverviewResponseDataDailyPnlInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressPortfolioOverviewResponseDataDailyPnlInner given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of GetAddressPortfolioOverviewResponseDataDailyPnlInner + * @throws IOException if the JSON string is invalid with respect to + * GetAddressPortfolioOverviewResponseDataDailyPnlInner + */ + public static GetAddressPortfolioOverviewResponseDataDailyPnlInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetAddressPortfolioOverviewResponseDataDailyPnlInner.class); + } + + /** + * Convert an instance of GetAddressPortfolioOverviewResponseDataDailyPnlInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.java new file mode 100644 index 0000000..2cebe92 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.java @@ -0,0 +1,485 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Token count breakdown by realized PnL percentage range. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent { + public static final String SERIALIZED_NAME_OVER500_PERCENT = "over500Percent"; + + @SerializedName(SERIALIZED_NAME_OVER500_PERCENT) + @jakarta.annotation.Nullable + private String over500Percent; + + public static final String SERIALIZED_NAME_FROM200_TO500_PERCENT = "from200To500Percent"; + + @SerializedName(SERIALIZED_NAME_FROM200_TO500_PERCENT) + @jakarta.annotation.Nullable + private String from200To500Percent; + + public static final String SERIALIZED_NAME_FROM50_TO200_PERCENT = "from50To200Percent"; + + @SerializedName(SERIALIZED_NAME_FROM50_TO200_PERCENT) + @jakarta.annotation.Nullable + private String from50To200Percent; + + public static final String SERIALIZED_NAME_ZERO_TO50_PERCENT = "zeroTo50Percent"; + + @SerializedName(SERIALIZED_NAME_ZERO_TO50_PERCENT) + @jakarta.annotation.Nullable + private String zeroTo50Percent; + + public static final String SERIALIZED_NAME_ZERO_TO_MINUS50_PERCENT = "zeroToMinus50Percent"; + + @SerializedName(SERIALIZED_NAME_ZERO_TO_MINUS50_PERCENT) + @jakarta.annotation.Nullable + private String zeroToMinus50Percent; + + public static final String SERIALIZED_NAME_OVER_MINUS50_PERCENT = "overMinus50Percent"; + + @SerializedName(SERIALIZED_NAME_OVER_MINUS50_PERCENT) + @jakarta.annotation.Nullable + private String overMinus50Percent; + + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent() {} + + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent over500Percent( + @jakarta.annotation.Nullable String over500Percent) { + this.over500Percent = over500Percent; + return this; + } + + /** + * Number of tokens with realized PnL ≥500%. + * + * @return over500Percent + */ + @jakarta.annotation.Nullable + public String getOver500Percent() { + return over500Percent; + } + + public void setOver500Percent(@jakarta.annotation.Nullable String over500Percent) { + this.over500Percent = over500Percent; + } + + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent from200To500Percent( + @jakarta.annotation.Nullable String from200To500Percent) { + this.from200To500Percent = from200To500Percent; + return this; + } + + /** + * Number of tokens with realized PnL in [200%, 500%). + * + * @return from200To500Percent + */ + @jakarta.annotation.Nullable + public String getFrom200To500Percent() { + return from200To500Percent; + } + + public void setFrom200To500Percent(@jakarta.annotation.Nullable String from200To500Percent) { + this.from200To500Percent = from200To500Percent; + } + + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent from50To200Percent( + @jakarta.annotation.Nullable String from50To200Percent) { + this.from50To200Percent = from50To200Percent; + return this; + } + + /** + * Number of tokens with realized PnL in [50%, 200%). + * + * @return from50To200Percent + */ + @jakarta.annotation.Nullable + public String getFrom50To200Percent() { + return from50To200Percent; + } + + public void setFrom50To200Percent(@jakarta.annotation.Nullable String from50To200Percent) { + this.from50To200Percent = from50To200Percent; + } + + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent zeroTo50Percent( + @jakarta.annotation.Nullable String zeroTo50Percent) { + this.zeroTo50Percent = zeroTo50Percent; + return this; + } + + /** + * Number of tokens with realized PnL in [0%, 50%). + * + * @return zeroTo50Percent + */ + @jakarta.annotation.Nullable + public String getZeroTo50Percent() { + return zeroTo50Percent; + } + + public void setZeroTo50Percent(@jakarta.annotation.Nullable String zeroTo50Percent) { + this.zeroTo50Percent = zeroTo50Percent; + } + + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent zeroToMinus50Percent( + @jakarta.annotation.Nullable String zeroToMinus50Percent) { + this.zeroToMinus50Percent = zeroToMinus50Percent; + return this; + } + + /** + * Number of tokens with realized PnL in [-50%, 0%). + * + * @return zeroToMinus50Percent + */ + @jakarta.annotation.Nullable + public String getZeroToMinus50Percent() { + return zeroToMinus50Percent; + } + + public void setZeroToMinus50Percent(@jakarta.annotation.Nullable String zeroToMinus50Percent) { + this.zeroToMinus50Percent = zeroToMinus50Percent; + } + + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent overMinus50Percent( + @jakarta.annotation.Nullable String overMinus50Percent) { + this.overMinus50Percent = overMinus50Percent; + return this; + } + + /** + * Number of tokens with realized PnL < -50%. + * + * @return overMinus50Percent + */ + @jakarta.annotation.Nullable + public String getOverMinus50Percent() { + return overMinus50Percent; + } + + public void setOverMinus50Percent(@jakarta.annotation.Nullable String overMinus50Percent) { + this.overMinus50Percent = overMinus50Percent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + getAddressPortfolioOverviewResponseDataTokenCountByPnlPercent = + (GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent) o; + return Objects.equals( + this.over500Percent, + getAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .over500Percent) + && Objects.equals( + this.from200To500Percent, + getAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .from200To500Percent) + && Objects.equals( + this.from50To200Percent, + getAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .from50To200Percent) + && Objects.equals( + this.zeroTo50Percent, + getAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .zeroTo50Percent) + && Objects.equals( + this.zeroToMinus50Percent, + getAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .zeroToMinus50Percent) + && Objects.equals( + this.overMinus50Percent, + getAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .overMinus50Percent); + } + + @Override + public int hashCode() { + return Objects.hash( + over500Percent, + from200To500Percent, + from50To200Percent, + zeroTo50Percent, + zeroToMinus50Percent, + overMinus50Percent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent {\n"); + sb.append(" over500Percent: ").append(toIndentedString(over500Percent)).append("\n"); + sb.append(" from200To500Percent: ") + .append(toIndentedString(from200To500Percent)) + .append("\n"); + sb.append(" from50To200Percent: ") + .append(toIndentedString(from50To200Percent)) + .append("\n"); + sb.append(" zeroTo50Percent: ").append(toIndentedString(zeroTo50Percent)).append("\n"); + sb.append(" zeroToMinus50Percent: ") + .append(toIndentedString(zeroToMinus50Percent)) + .append("\n"); + sb.append(" overMinus50Percent: ") + .append(toIndentedString(overMinus50Percent)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object over500PercentValue = getOver500Percent(); + String over500PercentValueAsString = ""; + over500PercentValueAsString = over500PercentValue.toString(); + sb.append("over500Percent=").append(urlEncode(over500PercentValueAsString)).append(""); + Object from200To500PercentValue = getFrom200To500Percent(); + String from200To500PercentValueAsString = ""; + from200To500PercentValueAsString = from200To500PercentValue.toString(); + sb.append("from200To500Percent=") + .append(urlEncode(from200To500PercentValueAsString)) + .append(""); + Object from50To200PercentValue = getFrom50To200Percent(); + String from50To200PercentValueAsString = ""; + from50To200PercentValueAsString = from50To200PercentValue.toString(); + sb.append("from50To200Percent=") + .append(urlEncode(from50To200PercentValueAsString)) + .append(""); + Object zeroTo50PercentValue = getZeroTo50Percent(); + String zeroTo50PercentValueAsString = ""; + zeroTo50PercentValueAsString = zeroTo50PercentValue.toString(); + sb.append("zeroTo50Percent=").append(urlEncode(zeroTo50PercentValueAsString)).append(""); + Object zeroToMinus50PercentValue = getZeroToMinus50Percent(); + String zeroToMinus50PercentValueAsString = ""; + zeroToMinus50PercentValueAsString = zeroToMinus50PercentValue.toString(); + sb.append("zeroToMinus50Percent=") + .append(urlEncode(zeroToMinus50PercentValueAsString)) + .append(""); + Object overMinus50PercentValue = getOverMinus50Percent(); + String overMinus50PercentValueAsString = ""; + overMinus50PercentValueAsString = overMinus50PercentValue.toString(); + sb.append("overMinus50Percent=") + .append(urlEncode(overMinus50PercentValueAsString)) + .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("over500Percent"); + openapiFields.add("from200To500Percent"); + openapiFields.add("from50To200Percent"); + openapiFields.add("zeroTo50Percent"); + openapiFields.add("zeroToMinus50Percent"); + openapiFields.add("overMinus50Percent"); + + // 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 + * GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent" + + " is not found in the empty JSON string", + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("over500Percent") != null && !jsonObj.get("over500Percent").isJsonNull()) + && !jsonObj.get("over500Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `over500Percent` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("over500Percent").toString())); + } + if ((jsonObj.get("from200To500Percent") != null + && !jsonObj.get("from200To500Percent").isJsonNull()) + && !jsonObj.get("from200To500Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `from200To500Percent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("from200To500Percent").toString())); + } + if ((jsonObj.get("from50To200Percent") != null + && !jsonObj.get("from50To200Percent").isJsonNull()) + && !jsonObj.get("from50To200Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `from50To200Percent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("from50To200Percent").toString())); + } + if ((jsonObj.get("zeroTo50Percent") != null && !jsonObj.get("zeroTo50Percent").isJsonNull()) + && !jsonObj.get("zeroTo50Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `zeroTo50Percent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("zeroTo50Percent").toString())); + } + if ((jsonObj.get("zeroToMinus50Percent") != null + && !jsonObj.get("zeroToMinus50Percent").isJsonNull()) + && !jsonObj.get("zeroToMinus50Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `zeroToMinus50Percent` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("zeroToMinus50Percent").toString())); + } + if ((jsonObj.get("overMinus50Percent") != null + && !jsonObj.get("overMinus50Percent").isJsonNull()) + && !jsonObj.get("overMinus50Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `overMinus50Percent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("overMinus50Percent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + .class)); + + return (TypeAdapter) + new TypeAdapter< + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent>() { + @Override + public void write( + JsonWriter out, + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + * @throws IOException if the JSON string is invalid with respect to + * GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent + */ + public static GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent.class); + } + + /** + * Convert an instance of GetAddressPortfolioOverviewResponseDataTokenCountByPnlPercent to an + * JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.java new file mode 100644 index 0000000..c6a71c2 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.java @@ -0,0 +1,373 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner { + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_TOKEN_PN_L_USD = "tokenPnLUsd"; + + @SerializedName(SERIALIZED_NAME_TOKEN_PN_L_USD) + @jakarta.annotation.Nullable + private String tokenPnLUsd; + + public static final String SERIALIZED_NAME_TOKEN_PN_L_PERCENT = "tokenPnLPercent"; + + @SerializedName(SERIALIZED_NAME_TOKEN_PN_L_PERCENT) + @jakarta.annotation.Nullable + private String tokenPnLPercent; + + public GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner() {} + + public GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. EVM addresses are lowercase; Solana addresses are case-sensitive. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Token symbol. + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner tokenPnLUsd( + @jakarta.annotation.Nullable String tokenPnLUsd) { + this.tokenPnLUsd = tokenPnLUsd; + return this; + } + + /** + * Realized PnL for this token, denominated in USD. Positive means profit, negative means loss. + * + * @return tokenPnLUsd + */ + @jakarta.annotation.Nullable + public String getTokenPnLUsd() { + return tokenPnLUsd; + } + + public void setTokenPnLUsd(@jakarta.annotation.Nullable String tokenPnLUsd) { + this.tokenPnLUsd = tokenPnLUsd; + } + + public GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner tokenPnLPercent( + @jakarta.annotation.Nullable String tokenPnLPercent) { + this.tokenPnLPercent = tokenPnLPercent; + return this; + } + + /** + * Realized PnL percentage for this token. No percent sign included. + * + * @return tokenPnLPercent + */ + @jakarta.annotation.Nullable + public String getTokenPnLPercent() { + return tokenPnLPercent; + } + + public void setTokenPnLPercent(@jakarta.annotation.Nullable String tokenPnLPercent) { + this.tokenPnLPercent = tokenPnLPercent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner + getAddressPortfolioOverviewResponseDataTopPnlTokenListInner = + (GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner) o; + return Objects.equals( + this.tokenContractAddress, + getAddressPortfolioOverviewResponseDataTopPnlTokenListInner + .tokenContractAddress) + && Objects.equals( + this.tokenSymbol, + getAddressPortfolioOverviewResponseDataTopPnlTokenListInner.tokenSymbol) + && Objects.equals( + this.tokenPnLUsd, + getAddressPortfolioOverviewResponseDataTopPnlTokenListInner.tokenPnLUsd) + && Objects.equals( + this.tokenPnLPercent, + getAddressPortfolioOverviewResponseDataTopPnlTokenListInner + .tokenPnLPercent); + } + + @Override + public int hashCode() { + return Objects.hash(tokenContractAddress, tokenSymbol, tokenPnLUsd, tokenPnLPercent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner {\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" tokenPnLUsd: ").append(toIndentedString(tokenPnLUsd)).append("\n"); + sb.append(" tokenPnLPercent: ").append(toIndentedString(tokenPnLPercent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object tokenPnLUsdValue = getTokenPnLUsd(); + String tokenPnLUsdValueAsString = ""; + tokenPnLUsdValueAsString = tokenPnLUsdValue.toString(); + sb.append("tokenPnLUsd=").append(urlEncode(tokenPnLUsdValueAsString)).append(""); + Object tokenPnLPercentValue = getTokenPnLPercent(); + String tokenPnLPercentValueAsString = ""; + tokenPnLPercentValueAsString = tokenPnLPercentValue.toString(); + sb.append("tokenPnLPercent=").append(urlEncode(tokenPnLPercentValueAsString)).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("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + openapiFields.add("tokenPnLUsd"); + openapiFields.add("tokenPnLPercent"); + + // 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 + * GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner" + + " is not found in the empty JSON string", + GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + if ((jsonObj.get("tokenPnLUsd") != null && !jsonObj.get("tokenPnLUsd").isJsonNull()) + && !jsonObj.get("tokenPnLUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenPnLUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenPnLUsd").toString())); + } + if ((jsonObj.get("tokenPnLPercent") != null && !jsonObj.get("tokenPnLPercent").isJsonNull()) + && !jsonObj.get("tokenPnLPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenPnLPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("tokenPnLPercent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner + .class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner + * @throws IOException if the JSON string is invalid with respect to + * GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner + */ + public static GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner.class); + } + + /** + * Convert an instance of GetAddressPortfolioOverviewResponseDataTopPnlTokenListInner to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponse.java new file mode 100644 index 0000000..2b06b8d --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponse.java @@ -0,0 +1,347 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetAddressRecentPnLResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressRecentPnLResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetAddressRecentPnLResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetAddressRecentPnLResponse() {} + + public GetAddressRecentPnLResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetAddressRecentPnLResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetAddressRecentPnLResponse data( + @jakarta.annotation.Nullable GetAddressRecentPnLResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetAddressRecentPnLResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetAddressRecentPnLResponseData data) { + this.data = data; + } + + public GetAddressRecentPnLResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetAddressRecentPnLResponse 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; + } + GetAddressRecentPnLResponse getAddressRecentPnLResponse = (GetAddressRecentPnLResponse) o; + return Objects.equals(this.code, getAddressRecentPnLResponse.code) + && Objects.equals(this.msg, getAddressRecentPnLResponse.msg) + && Objects.equals(this.data, getAddressRecentPnLResponse.data) + && Objects.equals(this.timestamp, getAddressRecentPnLResponse.timestamp) + && Objects.equals(this.success, getAddressRecentPnLResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressRecentPnLResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * GetAddressRecentPnLResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressRecentPnLResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAddressRecentPnLResponse is not" + + " found in the empty JSON string", + GetAddressRecentPnLResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetAddressRecentPnLResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressRecentPnLResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAddressRecentPnLResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetAddressRecentPnLResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAddressRecentPnLResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressRecentPnLResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressRecentPnLResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressRecentPnLResponse + * @throws IOException if the JSON string is invalid with respect to GetAddressRecentPnLResponse + */ + public static GetAddressRecentPnLResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAddressRecentPnLResponse.class); + } + + /** + * Convert an instance of GetAddressRecentPnLResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseData.java new file mode 100644 index 0000000..981d83e --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseData.java @@ -0,0 +1,291 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** Paginated PnL list. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressRecentPnLResponseData { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + @jakarta.annotation.Nullable + private String cursor; + + public static final String SERIALIZED_NAME_PNL_LIST = "pnlList"; + + @SerializedName(SERIALIZED_NAME_PNL_LIST) + @jakarta.annotation.Nullable + private List<@Valid GetAddressRecentPnLResponseDataPnlListInner> pnlList; + + public GetAddressRecentPnLResponseData() {} + + public GetAddressRecentPnLResponseData cursor(@jakarta.annotation.Nullable String cursor) { + this.cursor = cursor; + return this; + } + + /** + * Pagination cursor for the next page. Empty string when no more data. + * + * @return cursor + */ + @jakarta.annotation.Nullable + public String getCursor() { + return cursor; + } + + public void setCursor(@jakarta.annotation.Nullable String cursor) { + this.cursor = cursor; + } + + public GetAddressRecentPnLResponseData pnlList( + @jakarta.annotation.Nullable + List<@Valid GetAddressRecentPnLResponseDataPnlListInner> pnlList) { + this.pnlList = pnlList; + return this; + } + + public GetAddressRecentPnLResponseData addPnlListItem( + GetAddressRecentPnLResponseDataPnlListInner pnlListItem) { + if (this.pnlList == null) { + this.pnlList = new ArrayList<>(); + } + this.pnlList.add(pnlListItem); + return this; + } + + /** + * PnL records sorted by lastActiveTimestamp descending. + * + * @return pnlList + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetAddressRecentPnLResponseDataPnlListInner> getPnlList() { + return pnlList; + } + + public void setPnlList( + @jakarta.annotation.Nullable + List<@Valid GetAddressRecentPnLResponseDataPnlListInner> pnlList) { + this.pnlList = pnlList; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAddressRecentPnLResponseData getAddressRecentPnLResponseData = + (GetAddressRecentPnLResponseData) o; + return Objects.equals(this.cursor, getAddressRecentPnLResponseData.cursor) + && Objects.equals(this.pnlList, getAddressRecentPnLResponseData.pnlList); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, pnlList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressRecentPnLResponseData {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" pnlList: ").append(toIndentedString(pnlList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object cursorValue = getCursor(); + String cursorValueAsString = ""; + cursorValueAsString = cursorValue.toString(); + sb.append("cursor=").append(urlEncode(cursorValueAsString)).append(""); + Object pnlListValue = getPnlList(); + String pnlListValueAsString = ""; + pnlListValueAsString = + (String) + ((Collection) pnlListValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("pnlList=").append(urlEncode(pnlListValueAsString)).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("cursor"); + openapiFields.add("pnlList"); + + // 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 + * GetAddressRecentPnLResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressRecentPnLResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAddressRecentPnLResponseData is not" + + " found in the empty JSON string", + GetAddressRecentPnLResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + if (jsonObj.get("pnlList") != null && !jsonObj.get("pnlList").isJsonNull()) { + JsonArray jsonArraypnlList = jsonObj.getAsJsonArray("pnlList"); + if (jsonArraypnlList != null) { + // ensure the json data is an array + if (!jsonObj.get("pnlList").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pnlList` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("pnlList").toString())); + } + + // validate the optional field `pnlList` (array) + for (int i = 0; i < jsonArraypnlList.size(); i++) { + GetAddressRecentPnLResponseDataPnlListInner.validateJsonElement( + jsonArraypnlList.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressRecentPnLResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAddressRecentPnLResponseData' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAddressRecentPnLResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAddressRecentPnLResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressRecentPnLResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressRecentPnLResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressRecentPnLResponseData + * @throws IOException if the JSON string is invalid with respect to + * GetAddressRecentPnLResponseData + */ + public static GetAddressRecentPnLResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAddressRecentPnLResponseData.class); + } + + /** + * Convert an instance of GetAddressRecentPnLResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseDataPnlListInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseDataPnlListInner.java new file mode 100644 index 0000000..219f0e5 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseDataPnlListInner.java @@ -0,0 +1,866 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetAddressRecentPnLResponseDataPnlListInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressRecentPnLResponseDataPnlListInner { + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_LAST_ACTIVE_TIMESTAMP = "lastActiveTimestamp"; + + @SerializedName(SERIALIZED_NAME_LAST_ACTIVE_TIMESTAMP) + @jakarta.annotation.Nullable + private String lastActiveTimestamp; + + public static final String SERIALIZED_NAME_REALIZED_PNL_USD = "realizedPnlUsd"; + + @SerializedName(SERIALIZED_NAME_REALIZED_PNL_USD) + @jakarta.annotation.Nullable + private String realizedPnlUsd; + + public static final String SERIALIZED_NAME_REALIZED_PNL_PERCENT = "realizedPnlPercent"; + + @SerializedName(SERIALIZED_NAME_REALIZED_PNL_PERCENT) + @jakarta.annotation.Nullable + private String realizedPnlPercent; + + public static final String SERIALIZED_NAME_TOKEN_BALANCE_USD = "tokenBalanceUsd"; + + @SerializedName(SERIALIZED_NAME_TOKEN_BALANCE_USD) + @jakarta.annotation.Nullable + private String tokenBalanceUsd; + + public static final String SERIALIZED_NAME_TOKEN_BALANCE_AMOUNT = "tokenBalanceAmount"; + + @SerializedName(SERIALIZED_NAME_TOKEN_BALANCE_AMOUNT) + @jakarta.annotation.Nullable + private String tokenBalanceAmount; + + public static final String SERIALIZED_NAME_TOKEN_POSITION_DURATION = "tokenPositionDuration"; + + @SerializedName(SERIALIZED_NAME_TOKEN_POSITION_DURATION) + @jakarta.annotation.Nullable + private GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration tokenPositionDuration; + + public static final String SERIALIZED_NAME_BUY_TX_COUNT = "buyTxCount"; + + @SerializedName(SERIALIZED_NAME_BUY_TX_COUNT) + @jakarta.annotation.Nullable + private String buyTxCount; + + public static final String SERIALIZED_NAME_BUY_TX_VOLUME = "buyTxVolume"; + + @SerializedName(SERIALIZED_NAME_BUY_TX_VOLUME) + @jakarta.annotation.Nullable + private String buyTxVolume; + + public static final String SERIALIZED_NAME_BUY_AVG_PRICE = "buyAvgPrice"; + + @SerializedName(SERIALIZED_NAME_BUY_AVG_PRICE) + @jakarta.annotation.Nullable + private String buyAvgPrice; + + public static final String SERIALIZED_NAME_SELL_TX_COUNT = "sellTxCount"; + + @SerializedName(SERIALIZED_NAME_SELL_TX_COUNT) + @jakarta.annotation.Nullable + private String sellTxCount; + + public static final String SERIALIZED_NAME_SELL_TX_VOLUME = "sellTxVolume"; + + @SerializedName(SERIALIZED_NAME_SELL_TX_VOLUME) + @jakarta.annotation.Nullable + private String sellTxVolume; + + public static final String SERIALIZED_NAME_SELL_AVG_PRICE = "sellAvgPrice"; + + @SerializedName(SERIALIZED_NAME_SELL_AVG_PRICE) + @jakarta.annotation.Nullable + private String sellAvgPrice; + + public GetAddressRecentPnLResponseDataPnlListInner() {} + + public GetAddressRecentPnLResponseDataPnlListInner binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier. + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetAddressRecentPnLResponseDataPnlListInner tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. EVM addresses are lowercase; Solana addresses are case-sensitive. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetAddressRecentPnLResponseDataPnlListInner tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Token symbol. + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public GetAddressRecentPnLResponseDataPnlListInner lastActiveTimestamp( + @jakarta.annotation.Nullable String lastActiveTimestamp) { + this.lastActiveTimestamp = lastActiveTimestamp; + return this; + } + + /** + * Timestamp of the last transaction for this token, Unix millisecond timestamp. + * + * @return lastActiveTimestamp + */ + @jakarta.annotation.Nullable + public String getLastActiveTimestamp() { + return lastActiveTimestamp; + } + + public void setLastActiveTimestamp(@jakarta.annotation.Nullable String lastActiveTimestamp) { + this.lastActiveTimestamp = lastActiveTimestamp; + } + + public GetAddressRecentPnLResponseDataPnlListInner realizedPnlUsd( + @jakarta.annotation.Nullable String realizedPnlUsd) { + this.realizedPnlUsd = realizedPnlUsd; + return this; + } + + /** + * Realized PnL for this token, denominated in USD. Positive means profit, negative means loss. + * + * @return realizedPnlUsd + */ + @jakarta.annotation.Nullable + public String getRealizedPnlUsd() { + return realizedPnlUsd; + } + + public void setRealizedPnlUsd(@jakarta.annotation.Nullable String realizedPnlUsd) { + this.realizedPnlUsd = realizedPnlUsd; + } + + public GetAddressRecentPnLResponseDataPnlListInner realizedPnlPercent( + @jakarta.annotation.Nullable String realizedPnlPercent) { + this.realizedPnlPercent = realizedPnlPercent; + return this; + } + + /** + * Realized PnL percentage for this token. No percent sign included. + * + * @return realizedPnlPercent + */ + @jakarta.annotation.Nullable + public String getRealizedPnlPercent() { + return realizedPnlPercent; + } + + public void setRealizedPnlPercent(@jakarta.annotation.Nullable String realizedPnlPercent) { + this.realizedPnlPercent = realizedPnlPercent; + } + + public GetAddressRecentPnLResponseDataPnlListInner tokenBalanceUsd( + @jakarta.annotation.Nullable String tokenBalanceUsd) { + this.tokenBalanceUsd = tokenBalanceUsd; + return this; + } + + /** + * Current market value of the address's holding in this token, denominated in USD. + * + * @return tokenBalanceUsd + */ + @jakarta.annotation.Nullable + public String getTokenBalanceUsd() { + return tokenBalanceUsd; + } + + public void setTokenBalanceUsd(@jakarta.annotation.Nullable String tokenBalanceUsd) { + this.tokenBalanceUsd = tokenBalanceUsd; + } + + public GetAddressRecentPnLResponseDataPnlListInner tokenBalanceAmount( + @jakarta.annotation.Nullable String tokenBalanceAmount) { + this.tokenBalanceAmount = tokenBalanceAmount; + return this; + } + + /** + * Current holding amount of this token (token units). + * + * @return tokenBalanceAmount + */ + @jakarta.annotation.Nullable + public String getTokenBalanceAmount() { + return tokenBalanceAmount; + } + + public void setTokenBalanceAmount(@jakarta.annotation.Nullable String tokenBalanceAmount) { + this.tokenBalanceAmount = tokenBalanceAmount; + } + + public GetAddressRecentPnLResponseDataPnlListInner tokenPositionDuration( + @jakarta.annotation.Nullable + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + tokenPositionDuration) { + this.tokenPositionDuration = tokenPositionDuration; + return this; + } + + /** + * Get tokenPositionDuration + * + * @return tokenPositionDuration + */ + @jakarta.annotation.Nullable + @Valid + public GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + getTokenPositionDuration() { + return tokenPositionDuration; + } + + public void setTokenPositionDuration( + @jakarta.annotation.Nullable + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + tokenPositionDuration) { + this.tokenPositionDuration = tokenPositionDuration; + } + + public GetAddressRecentPnLResponseDataPnlListInner buyTxCount( + @jakarta.annotation.Nullable String buyTxCount) { + this.buyTxCount = buyTxCount; + return this; + } + + /** + * Number of buy transactions for this token. + * + * @return buyTxCount + */ + @jakarta.annotation.Nullable + public String getBuyTxCount() { + return buyTxCount; + } + + public void setBuyTxCount(@jakarta.annotation.Nullable String buyTxCount) { + this.buyTxCount = buyTxCount; + } + + public GetAddressRecentPnLResponseDataPnlListInner buyTxVolume( + @jakarta.annotation.Nullable String buyTxVolume) { + this.buyTxVolume = buyTxVolume; + return this; + } + + /** + * Total buy spend for this token, denominated in USD. + * + * @return buyTxVolume + */ + @jakarta.annotation.Nullable + public String getBuyTxVolume() { + return buyTxVolume; + } + + public void setBuyTxVolume(@jakarta.annotation.Nullable String buyTxVolume) { + this.buyTxVolume = buyTxVolume; + } + + public GetAddressRecentPnLResponseDataPnlListInner buyAvgPrice( + @jakarta.annotation.Nullable String buyAvgPrice) { + this.buyAvgPrice = buyAvgPrice; + return this; + } + + /** + * Average buy price for this token, denominated in USD. + * + * @return buyAvgPrice + */ + @jakarta.annotation.Nullable + public String getBuyAvgPrice() { + return buyAvgPrice; + } + + public void setBuyAvgPrice(@jakarta.annotation.Nullable String buyAvgPrice) { + this.buyAvgPrice = buyAvgPrice; + } + + public GetAddressRecentPnLResponseDataPnlListInner sellTxCount( + @jakarta.annotation.Nullable String sellTxCount) { + this.sellTxCount = sellTxCount; + return this; + } + + /** + * Number of sell transactions for this token. + * + * @return sellTxCount + */ + @jakarta.annotation.Nullable + public String getSellTxCount() { + return sellTxCount; + } + + public void setSellTxCount(@jakarta.annotation.Nullable String sellTxCount) { + this.sellTxCount = sellTxCount; + } + + public GetAddressRecentPnLResponseDataPnlListInner sellTxVolume( + @jakarta.annotation.Nullable String sellTxVolume) { + this.sellTxVolume = sellTxVolume; + return this; + } + + /** + * Total sell proceeds for this token, denominated in USD. + * + * @return sellTxVolume + */ + @jakarta.annotation.Nullable + public String getSellTxVolume() { + return sellTxVolume; + } + + public void setSellTxVolume(@jakarta.annotation.Nullable String sellTxVolume) { + this.sellTxVolume = sellTxVolume; + } + + public GetAddressRecentPnLResponseDataPnlListInner sellAvgPrice( + @jakarta.annotation.Nullable String sellAvgPrice) { + this.sellAvgPrice = sellAvgPrice; + return this; + } + + /** + * Average sell price for this token, denominated in USD. + * + * @return sellAvgPrice + */ + @jakarta.annotation.Nullable + public String getSellAvgPrice() { + return sellAvgPrice; + } + + public void setSellAvgPrice(@jakarta.annotation.Nullable String sellAvgPrice) { + this.sellAvgPrice = sellAvgPrice; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAddressRecentPnLResponseDataPnlListInner getAddressRecentPnLResponseDataPnlListInner = + (GetAddressRecentPnLResponseDataPnlListInner) o; + return Objects.equals( + this.binanceChainId, + getAddressRecentPnLResponseDataPnlListInner.binanceChainId) + && Objects.equals( + this.tokenContractAddress, + getAddressRecentPnLResponseDataPnlListInner.tokenContractAddress) + && Objects.equals( + this.tokenSymbol, getAddressRecentPnLResponseDataPnlListInner.tokenSymbol) + && Objects.equals( + this.lastActiveTimestamp, + getAddressRecentPnLResponseDataPnlListInner.lastActiveTimestamp) + && Objects.equals( + this.realizedPnlUsd, + getAddressRecentPnLResponseDataPnlListInner.realizedPnlUsd) + && Objects.equals( + this.realizedPnlPercent, + getAddressRecentPnLResponseDataPnlListInner.realizedPnlPercent) + && Objects.equals( + this.tokenBalanceUsd, + getAddressRecentPnLResponseDataPnlListInner.tokenBalanceUsd) + && Objects.equals( + this.tokenBalanceAmount, + getAddressRecentPnLResponseDataPnlListInner.tokenBalanceAmount) + && Objects.equals( + this.tokenPositionDuration, + getAddressRecentPnLResponseDataPnlListInner.tokenPositionDuration) + && Objects.equals( + this.buyTxCount, getAddressRecentPnLResponseDataPnlListInner.buyTxCount) + && Objects.equals( + this.buyTxVolume, getAddressRecentPnLResponseDataPnlListInner.buyTxVolume) + && Objects.equals( + this.buyAvgPrice, getAddressRecentPnLResponseDataPnlListInner.buyAvgPrice) + && Objects.equals( + this.sellTxCount, getAddressRecentPnLResponseDataPnlListInner.sellTxCount) + && Objects.equals( + this.sellTxVolume, getAddressRecentPnLResponseDataPnlListInner.sellTxVolume) + && Objects.equals( + this.sellAvgPrice, + getAddressRecentPnLResponseDataPnlListInner.sellAvgPrice); + } + + @Override + public int hashCode() { + return Objects.hash( + binanceChainId, + tokenContractAddress, + tokenSymbol, + lastActiveTimestamp, + realizedPnlUsd, + realizedPnlPercent, + tokenBalanceUsd, + tokenBalanceAmount, + tokenPositionDuration, + buyTxCount, + buyTxVolume, + buyAvgPrice, + sellTxCount, + sellTxVolume, + sellAvgPrice); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressRecentPnLResponseDataPnlListInner {\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" lastActiveTimestamp: ") + .append(toIndentedString(lastActiveTimestamp)) + .append("\n"); + sb.append(" realizedPnlUsd: ").append(toIndentedString(realizedPnlUsd)).append("\n"); + sb.append(" realizedPnlPercent: ") + .append(toIndentedString(realizedPnlPercent)) + .append("\n"); + sb.append(" tokenBalanceUsd: ").append(toIndentedString(tokenBalanceUsd)).append("\n"); + sb.append(" tokenBalanceAmount: ") + .append(toIndentedString(tokenBalanceAmount)) + .append("\n"); + sb.append(" tokenPositionDuration: ") + .append(toIndentedString(tokenPositionDuration)) + .append("\n"); + sb.append(" buyTxCount: ").append(toIndentedString(buyTxCount)).append("\n"); + sb.append(" buyTxVolume: ").append(toIndentedString(buyTxVolume)).append("\n"); + sb.append(" buyAvgPrice: ").append(toIndentedString(buyAvgPrice)).append("\n"); + sb.append(" sellTxCount: ").append(toIndentedString(sellTxCount)).append("\n"); + sb.append(" sellTxVolume: ").append(toIndentedString(sellTxVolume)).append("\n"); + sb.append(" sellAvgPrice: ").append(toIndentedString(sellAvgPrice)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object lastActiveTimestampValue = getLastActiveTimestamp(); + String lastActiveTimestampValueAsString = ""; + lastActiveTimestampValueAsString = lastActiveTimestampValue.toString(); + sb.append("lastActiveTimestamp=") + .append(urlEncode(lastActiveTimestampValueAsString)) + .append(""); + Object realizedPnlUsdValue = getRealizedPnlUsd(); + String realizedPnlUsdValueAsString = ""; + realizedPnlUsdValueAsString = realizedPnlUsdValue.toString(); + sb.append("realizedPnlUsd=").append(urlEncode(realizedPnlUsdValueAsString)).append(""); + Object realizedPnlPercentValue = getRealizedPnlPercent(); + String realizedPnlPercentValueAsString = ""; + realizedPnlPercentValueAsString = realizedPnlPercentValue.toString(); + sb.append("realizedPnlPercent=") + .append(urlEncode(realizedPnlPercentValueAsString)) + .append(""); + Object tokenBalanceUsdValue = getTokenBalanceUsd(); + String tokenBalanceUsdValueAsString = ""; + tokenBalanceUsdValueAsString = tokenBalanceUsdValue.toString(); + sb.append("tokenBalanceUsd=").append(urlEncode(tokenBalanceUsdValueAsString)).append(""); + Object tokenBalanceAmountValue = getTokenBalanceAmount(); + String tokenBalanceAmountValueAsString = ""; + tokenBalanceAmountValueAsString = tokenBalanceAmountValue.toString(); + sb.append("tokenBalanceAmount=") + .append(urlEncode(tokenBalanceAmountValueAsString)) + .append(""); + Object tokenPositionDurationValue = getTokenPositionDuration(); + String tokenPositionDurationValueAsString = ""; + tokenPositionDurationValueAsString = tokenPositionDurationValue.toString(); + sb.append("tokenPositionDuration=") + .append(urlEncode(tokenPositionDurationValueAsString)) + .append(""); + Object buyTxCountValue = getBuyTxCount(); + String buyTxCountValueAsString = ""; + buyTxCountValueAsString = buyTxCountValue.toString(); + sb.append("buyTxCount=").append(urlEncode(buyTxCountValueAsString)).append(""); + Object buyTxVolumeValue = getBuyTxVolume(); + String buyTxVolumeValueAsString = ""; + buyTxVolumeValueAsString = buyTxVolumeValue.toString(); + sb.append("buyTxVolume=").append(urlEncode(buyTxVolumeValueAsString)).append(""); + Object buyAvgPriceValue = getBuyAvgPrice(); + String buyAvgPriceValueAsString = ""; + buyAvgPriceValueAsString = buyAvgPriceValue.toString(); + sb.append("buyAvgPrice=").append(urlEncode(buyAvgPriceValueAsString)).append(""); + Object sellTxCountValue = getSellTxCount(); + String sellTxCountValueAsString = ""; + sellTxCountValueAsString = sellTxCountValue.toString(); + sb.append("sellTxCount=").append(urlEncode(sellTxCountValueAsString)).append(""); + Object sellTxVolumeValue = getSellTxVolume(); + String sellTxVolumeValueAsString = ""; + sellTxVolumeValueAsString = sellTxVolumeValue.toString(); + sb.append("sellTxVolume=").append(urlEncode(sellTxVolumeValueAsString)).append(""); + Object sellAvgPriceValue = getSellAvgPrice(); + String sellAvgPriceValueAsString = ""; + sellAvgPriceValueAsString = sellAvgPriceValue.toString(); + sb.append("sellAvgPrice=").append(urlEncode(sellAvgPriceValueAsString)).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("binanceChainId"); + openapiFields.add("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + openapiFields.add("lastActiveTimestamp"); + openapiFields.add("realizedPnlUsd"); + openapiFields.add("realizedPnlPercent"); + openapiFields.add("tokenBalanceUsd"); + openapiFields.add("tokenBalanceAmount"); + openapiFields.add("tokenPositionDuration"); + openapiFields.add("buyTxCount"); + openapiFields.add("buyTxVolume"); + openapiFields.add("buyAvgPrice"); + openapiFields.add("sellTxCount"); + openapiFields.add("sellTxVolume"); + openapiFields.add("sellAvgPrice"); + + // 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 + * GetAddressRecentPnLResponseDataPnlListInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressRecentPnLResponseDataPnlListInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAddressRecentPnLResponseDataPnlListInner is not found in" + + " the empty JSON string", + GetAddressRecentPnLResponseDataPnlListInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + if ((jsonObj.get("lastActiveTimestamp") != null + && !jsonObj.get("lastActiveTimestamp").isJsonNull()) + && !jsonObj.get("lastActiveTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `lastActiveTimestamp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("lastActiveTimestamp").toString())); + } + if ((jsonObj.get("realizedPnlUsd") != null && !jsonObj.get("realizedPnlUsd").isJsonNull()) + && !jsonObj.get("realizedPnlUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `realizedPnlUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("realizedPnlUsd").toString())); + } + if ((jsonObj.get("realizedPnlPercent") != null + && !jsonObj.get("realizedPnlPercent").isJsonNull()) + && !jsonObj.get("realizedPnlPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `realizedPnlPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("realizedPnlPercent").toString())); + } + if ((jsonObj.get("tokenBalanceUsd") != null && !jsonObj.get("tokenBalanceUsd").isJsonNull()) + && !jsonObj.get("tokenBalanceUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenBalanceUsd` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("tokenBalanceUsd").toString())); + } + if ((jsonObj.get("tokenBalanceAmount") != null + && !jsonObj.get("tokenBalanceAmount").isJsonNull()) + && !jsonObj.get("tokenBalanceAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenBalanceAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("tokenBalanceAmount").toString())); + } + // validate the optional field `tokenPositionDuration` + if (jsonObj.get("tokenPositionDuration") != null + && !jsonObj.get("tokenPositionDuration").isJsonNull()) { + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.validateJsonElement( + jsonObj.get("tokenPositionDuration")); + } + if ((jsonObj.get("buyTxCount") != null && !jsonObj.get("buyTxCount").isJsonNull()) + && !jsonObj.get("buyTxCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyTxCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyTxCount").toString())); + } + if ((jsonObj.get("buyTxVolume") != null && !jsonObj.get("buyTxVolume").isJsonNull()) + && !jsonObj.get("buyTxVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyTxVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyTxVolume").toString())); + } + if ((jsonObj.get("buyAvgPrice") != null && !jsonObj.get("buyAvgPrice").isJsonNull()) + && !jsonObj.get("buyAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyAvgPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyAvgPrice").toString())); + } + if ((jsonObj.get("sellTxCount") != null && !jsonObj.get("sellTxCount").isJsonNull()) + && !jsonObj.get("sellTxCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellTxCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellTxCount").toString())); + } + if ((jsonObj.get("sellTxVolume") != null && !jsonObj.get("sellTxVolume").isJsonNull()) + && !jsonObj.get("sellTxVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellTxVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellTxVolume").toString())); + } + if ((jsonObj.get("sellAvgPrice") != null && !jsonObj.get("sellAvgPrice").isJsonNull()) + && !jsonObj.get("sellAvgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellAvgPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellAvgPrice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressRecentPnLResponseDataPnlListInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAddressRecentPnLResponseDataPnlListInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAddressRecentPnLResponseDataPnlListInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetAddressRecentPnLResponseDataPnlListInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressRecentPnLResponseDataPnlListInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressRecentPnLResponseDataPnlListInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressRecentPnLResponseDataPnlListInner + * @throws IOException if the JSON string is invalid with respect to + * GetAddressRecentPnLResponseDataPnlListInner + */ + public static GetAddressRecentPnLResponseDataPnlListInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetAddressRecentPnLResponseDataPnlListInner.class); + } + + /** + * Convert an instance of GetAddressRecentPnLResponseDataPnlListInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.java new file mode 100644 index 0000000..38fa625 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.java @@ -0,0 +1,241 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Holding duration information for this token. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration { + public static final String SERIALIZED_NAME_HOLDING_TIMESTAMP = "holdingTimestamp"; + + @SerializedName(SERIALIZED_NAME_HOLDING_TIMESTAMP) + @jakarta.annotation.Nullable + private String holdingTimestamp; + + public GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration() {} + + public GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration holdingTimestamp( + @jakarta.annotation.Nullable String holdingTimestamp) { + this.holdingTimestamp = holdingTimestamp; + return this; + } + + /** + * Timestamp of the first buy for this token, Unix millisecond timestamp. + * + * @return holdingTimestamp + */ + @jakarta.annotation.Nullable + public String getHoldingTimestamp() { + return holdingTimestamp; + } + + public void setHoldingTimestamp(@jakarta.annotation.Nullable String holdingTimestamp) { + this.holdingTimestamp = holdingTimestamp; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + getAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration = + (GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration) o; + return Objects.equals( + this.holdingTimestamp, + getAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.holdingTimestamp); + } + + @Override + public int hashCode() { + return Objects.hash(holdingTimestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration {\n"); + sb.append(" holdingTimestamp: ").append(toIndentedString(holdingTimestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object holdingTimestampValue = getHoldingTimestamp(); + String holdingTimestampValueAsString = ""; + holdingTimestampValueAsString = holdingTimestampValue.toString(); + sb.append("holdingTimestamp=").append(urlEncode(holdingTimestampValueAsString)).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("holdingTimestamp"); + + // 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 + * GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + .openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration" + + " is not found in the empty JSON string", + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("holdingTimestamp") != null + && !jsonObj.get("holdingTimestamp").isJsonNull()) + && !jsonObj.get("holdingTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `holdingTimestamp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("holdingTimestamp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + .class)); + + return (TypeAdapter) + new TypeAdapter< + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration>() { + @Override + public void write( + JsonWriter out, + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration given + * an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + * @throws IOException if the JSON string is invalid with respect to + * GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration + */ + public static GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration.class); + } + + /** + * Convert an instance of GetAddressRecentPnLResponseDataPnlListInnerTokenPositionDuration to an + * JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAggregatedQuoteResponseDataInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAggregatedQuoteResponseDataInner.java index 2a6e23b..92d4e56 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAggregatedQuoteResponseDataInner.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetAggregatedQuoteResponseDataInner.java @@ -116,6 +116,24 @@ public class GetAggregatedQuoteResponseDataInner { @jakarta.annotation.Nullable private List<@Valid GetAggregatedQuoteResponseDataInnerDexRouterListInner> dexRouterList; + public static final String SERIALIZED_NAME_EXECUTION_MODE = "executionMode"; + + @SerializedName(SERIALIZED_NAME_EXECUTION_MODE) + @jakarta.annotation.Nullable + private String executionMode; + + public static final String SERIALIZED_NAME_APPROVE_TARGET = "approveTarget"; + + @SerializedName(SERIALIZED_NAME_APPROVE_TARGET) + @jakarta.annotation.Nullable + private String approveTarget; + + public static final String SERIALIZED_NAME_IS_BEST = "isBest"; + + @SerializedName(SERIALIZED_NAME_IS_BEST) + @jakarta.annotation.Nullable + private Boolean isBest; + public GetAggregatedQuoteResponseDataInner() {} public GetAggregatedQuoteResponseDataInner quoteId( @@ -379,6 +397,76 @@ public void setDexRouterList( this.dexRouterList = dexRouterList; } + public GetAggregatedQuoteResponseDataInner executionMode( + @jakarta.annotation.Nullable String executionMode) { + this.executionMode = executionMode; + return this; + } + + /** + * Execution mode for this route. `SWAP` = standard on-chain swap (sign the + * `tx` object from `/swap` and broadcast). `RFQ` = signed + * order flow (sign `rfq.typedDataToSign` from `/swap` with EIP-712, submit + * via `POST /order/submit`, poll `GET /order/{orderId}`). Equity / RWA + * tokens always return `RFQ`. + * + * @return executionMode + */ + @jakarta.annotation.Nullable + public String getExecutionMode() { + return executionMode; + } + + public void setExecutionMode(@jakarta.annotation.Nullable String executionMode) { + this.executionMode = executionMode; + } + + public GetAggregatedQuoteResponseDataInner approveTarget( + @jakarta.annotation.Nullable String approveTarget) { + this.approveTarget = approveTarget; + return this; + } + + /** + * The spender contract address the backend will encode into the approve calldata for this + * route. To obtain that calldata, call `/approve-transaction` with + * `vendor=<vendorName>` (the string name, e.g. + * `\"PcsXRfq\"`) — the backend resolves the spender address internally from + * the vendor name. This field is provided for informational purposes only (e.g. to call ERC-20 + * `approve()` directly without going through `/approve-transaction`). Null + * when no approval is needed (e.g. native-token swap or already approved). + * + * @return approveTarget + */ + @jakarta.annotation.Nullable + public String getApproveTarget() { + return approveTarget; + } + + public void setApproveTarget(@jakarta.annotation.Nullable String approveTarget) { + this.approveTarget = approveTarget; + } + + public GetAggregatedQuoteResponseDataInner isBest(@jakarta.annotation.Nullable Boolean isBest) { + this.isBest = isBest; + return this; + } + + /** + * Whether this route has the highest `toTokenAmount` among all routes returned in + * this response. At most one route per response has `isBest=true`. + * + * @return isBest + */ + @jakarta.annotation.Nullable + public Boolean getIsBest() { + return isBest; + } + + public void setIsBest(@jakarta.annotation.Nullable Boolean isBest) { + this.isBest = isBest; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -407,7 +495,12 @@ public boolean equals(Object o) { && Objects.equals(this.fromToken, getAggregatedQuoteResponseDataInner.fromToken) && Objects.equals(this.toToken, getAggregatedQuoteResponseDataInner.toToken) && Objects.equals( - this.dexRouterList, getAggregatedQuoteResponseDataInner.dexRouterList); + this.dexRouterList, getAggregatedQuoteResponseDataInner.dexRouterList) + && Objects.equals( + this.executionMode, getAggregatedQuoteResponseDataInner.executionMode) + && Objects.equals( + this.approveTarget, getAggregatedQuoteResponseDataInner.approveTarget) + && Objects.equals(this.isBest, getAggregatedQuoteResponseDataInner.isBest); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -433,7 +526,10 @@ public int hashCode() { router, fromToken, toToken, - dexRouterList); + dexRouterList, + executionMode, + approveTarget, + isBest); } private static int hashCodeNullable(JsonNullable a) { @@ -461,6 +557,9 @@ public String toString() { sb.append(" fromToken: ").append(toIndentedString(fromToken)).append("\n"); sb.append(" toToken: ").append(toIndentedString(toToken)).append("\n"); sb.append(" dexRouterList: ").append(toIndentedString(dexRouterList)).append("\n"); + sb.append(" executionMode: ").append(toIndentedString(executionMode)).append("\n"); + sb.append(" approveTarget: ").append(toIndentedString(approveTarget)).append("\n"); + sb.append(" isBest: ").append(toIndentedString(isBest)).append("\n"); sb.append("}"); return sb.toString(); } @@ -521,6 +620,18 @@ public String toUrlQueryString() { ((Collection) dexRouterListValue) .stream().map(Object::toString).collect(Collectors.joining(",")); sb.append("dexRouterList=").append(urlEncode(dexRouterListValueAsString)).append(""); + Object executionModeValue = getExecutionMode(); + String executionModeValueAsString = ""; + executionModeValueAsString = executionModeValue.toString(); + sb.append("executionMode=").append(urlEncode(executionModeValueAsString)).append(""); + Object approveTargetValue = getApproveTarget(); + String approveTargetValueAsString = ""; + approveTargetValueAsString = approveTargetValue.toString(); + sb.append("approveTarget=").append(urlEncode(approveTargetValueAsString)).append(""); + Object isBestValue = getIsBest(); + String isBestValueAsString = ""; + isBestValueAsString = isBestValue.toString(); + sb.append("isBest=").append(urlEncode(isBestValueAsString)).append(""); return sb.toString(); } @@ -561,6 +672,9 @@ private String toIndentedString(Object o) { openapiFields.add("fromToken"); openapiFields.add("toToken"); openapiFields.add("dexRouterList"); + openapiFields.add("executionMode"); + openapiFields.add("approveTarget"); + openapiFields.add("isBest"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -688,6 +802,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } + if ((jsonObj.get("executionMode") != null && !jsonObj.get("executionMode").isJsonNull()) + && !jsonObj.get("executionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executionMode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executionMode").toString())); + } + if ((jsonObj.get("approveTarget") != null && !jsonObj.get("approveTarget").isJsonNull()) + && !jsonObj.get("approveTarget").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `approveTarget` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("approveTarget").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponse.java new file mode 100644 index 0000000..b75a64b --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponse.java @@ -0,0 +1,346 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetDexTradeHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetDexTradeHistoryResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetDexTradeHistoryResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetDexTradeHistoryResponse() {} + + public GetDexTradeHistoryResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetDexTradeHistoryResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetDexTradeHistoryResponse data( + @jakarta.annotation.Nullable GetDexTradeHistoryResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetDexTradeHistoryResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetDexTradeHistoryResponseData data) { + this.data = data; + } + + public GetDexTradeHistoryResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetDexTradeHistoryResponse 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; + } + GetDexTradeHistoryResponse getDexTradeHistoryResponse = (GetDexTradeHistoryResponse) o; + return Objects.equals(this.code, getDexTradeHistoryResponse.code) + && Objects.equals(this.msg, getDexTradeHistoryResponse.msg) + && Objects.equals(this.data, getDexTradeHistoryResponse.data) + && Objects.equals(this.timestamp, getDexTradeHistoryResponse.timestamp) + && Objects.equals(this.success, getDexTradeHistoryResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDexTradeHistoryResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 GetDexTradeHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetDexTradeHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDexTradeHistoryResponse is not" + + " found in the empty JSON string", + GetDexTradeHistoryResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetDexTradeHistoryResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDexTradeHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDexTradeHistoryResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetDexTradeHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDexTradeHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDexTradeHistoryResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDexTradeHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDexTradeHistoryResponse + * @throws IOException if the JSON string is invalid with respect to GetDexTradeHistoryResponse + */ + public static GetDexTradeHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDexTradeHistoryResponse.class); + } + + /** + * Convert an instance of GetDexTradeHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponseData.java new file mode 100644 index 0000000..b97e26f --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponseData.java @@ -0,0 +1,295 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** Paginated DEX transaction list. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetDexTradeHistoryResponseData { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + @jakarta.annotation.Nullable + private String cursor; + + public static final String SERIALIZED_NAME_TRANSACTION_LIST = "transactionList"; + + @SerializedName(SERIALIZED_NAME_TRANSACTION_LIST) + @jakarta.annotation.Nullable + private List<@Valid GetDexTradeHistoryResponseDataTransactionListInner> transactionList; + + public GetDexTradeHistoryResponseData() {} + + public GetDexTradeHistoryResponseData cursor(@jakarta.annotation.Nullable String cursor) { + this.cursor = cursor; + return this; + } + + /** + * Pagination cursor for the next page. Empty string when no more data. + * + * @return cursor + */ + @jakarta.annotation.Nullable + public String getCursor() { + return cursor; + } + + public void setCursor(@jakarta.annotation.Nullable String cursor) { + this.cursor = cursor; + } + + public GetDexTradeHistoryResponseData transactionList( + @jakarta.annotation.Nullable + List<@Valid GetDexTradeHistoryResponseDataTransactionListInner> + transactionList) { + this.transactionList = transactionList; + return this; + } + + public GetDexTradeHistoryResponseData addTransactionListItem( + GetDexTradeHistoryResponseDataTransactionListInner transactionListItem) { + if (this.transactionList == null) { + this.transactionList = new ArrayList<>(); + } + this.transactionList.add(transactionListItem); + return this; + } + + /** + * DEX transaction records sorted by time descending. + * + * @return transactionList + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetDexTradeHistoryResponseDataTransactionListInner> getTransactionList() { + return transactionList; + } + + public void setTransactionList( + @jakarta.annotation.Nullable + List<@Valid GetDexTradeHistoryResponseDataTransactionListInner> + transactionList) { + this.transactionList = transactionList; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDexTradeHistoryResponseData getDexTradeHistoryResponseData = + (GetDexTradeHistoryResponseData) o; + return Objects.equals(this.cursor, getDexTradeHistoryResponseData.cursor) + && Objects.equals( + this.transactionList, getDexTradeHistoryResponseData.transactionList); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, transactionList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDexTradeHistoryResponseData {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" transactionList: ").append(toIndentedString(transactionList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object cursorValue = getCursor(); + String cursorValueAsString = ""; + cursorValueAsString = cursorValue.toString(); + sb.append("cursor=").append(urlEncode(cursorValueAsString)).append(""); + Object transactionListValue = getTransactionList(); + String transactionListValueAsString = ""; + transactionListValueAsString = + (String) + ((Collection) transactionListValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("transactionList=").append(urlEncode(transactionListValueAsString)).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("cursor"); + openapiFields.add("transactionList"); + + // 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 + * GetDexTradeHistoryResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetDexTradeHistoryResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDexTradeHistoryResponseData is not" + + " found in the empty JSON string", + GetDexTradeHistoryResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + if (jsonObj.get("transactionList") != null + && !jsonObj.get("transactionList").isJsonNull()) { + JsonArray jsonArraytransactionList = jsonObj.getAsJsonArray("transactionList"); + if (jsonArraytransactionList != null) { + // ensure the json data is an array + if (!jsonObj.get("transactionList").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transactionList` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("transactionList").toString())); + } + + // validate the optional field `transactionList` (array) + for (int i = 0; i < jsonArraytransactionList.size(); i++) { + GetDexTradeHistoryResponseDataTransactionListInner.validateJsonElement( + jsonArraytransactionList.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDexTradeHistoryResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDexTradeHistoryResponseData' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDexTradeHistoryResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDexTradeHistoryResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDexTradeHistoryResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDexTradeHistoryResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDexTradeHistoryResponseData + * @throws IOException if the JSON string is invalid with respect to + * GetDexTradeHistoryResponseData + */ + public static GetDexTradeHistoryResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDexTradeHistoryResponseData.class); + } + + /** + * Convert an instance of GetDexTradeHistoryResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponseDataTransactionListInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponseDataTransactionListInner.java new file mode 100644 index 0000000..56540de --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetDexTradeHistoryResponseDataTransactionListInner.java @@ -0,0 +1,670 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetDexTradeHistoryResponseDataTransactionListInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetDexTradeHistoryResponseDataTransactionListInner { + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_VALUE_USD = "valueUsd"; + + @SerializedName(SERIALIZED_NAME_VALUE_USD) + @jakarta.annotation.Nullable + private String valueUsd; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_MARKET_CAP = "marketCap"; + + @SerializedName(SERIALIZED_NAME_MARKET_CAP) + @jakarta.annotation.Nullable + private String marketCap; + + public static final String SERIALIZED_NAME_TX_HASH = "txHash"; + + @SerializedName(SERIALIZED_NAME_TX_HASH) + @jakarta.annotation.Nullable + private String txHash; + + public static final String SERIALIZED_NAME_CHAIN_LOGO_URL = "chainLogoUrl"; + + @SerializedName(SERIALIZED_NAME_CHAIN_LOGO_URL) + @jakarta.annotation.Nullable + private String chainLogoUrl; + + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private String time; + + public GetDexTradeHistoryResponseDataTransactionListInner() {} + + public GetDexTradeHistoryResponseDataTransactionListInner type( + @jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Trade type. 1=Buy, 2=Sell. + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public GetDexTradeHistoryResponseDataTransactionListInner binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier. + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetDexTradeHistoryResponseDataTransactionListInner tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. EVM addresses are lowercase; Solana addresses are case-sensitive. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetDexTradeHistoryResponseDataTransactionListInner tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Token symbol. + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public GetDexTradeHistoryResponseDataTransactionListInner valueUsd( + @jakarta.annotation.Nullable String valueUsd) { + this.valueUsd = valueUsd; + return this; + } + + /** + * Transaction value, denominated in USD. + * + * @return valueUsd + */ + @jakarta.annotation.Nullable + public String getValueUsd() { + return valueUsd; + } + + public void setValueUsd(@jakarta.annotation.Nullable String valueUsd) { + this.valueUsd = valueUsd; + } + + public GetDexTradeHistoryResponseDataTransactionListInner amount( + @jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Token quantity involved in this transaction (token units). + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public GetDexTradeHistoryResponseDataTransactionListInner price( + @jakarta.annotation.Nullable String price) { + this.price = price; + return this; + } + + /** + * Execution price of this transaction, denominated in USD. + * + * @return price + */ + @jakarta.annotation.Nullable + public String getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable String price) { + this.price = price; + } + + public GetDexTradeHistoryResponseDataTransactionListInner marketCap( + @jakarta.annotation.Nullable String marketCap) { + this.marketCap = marketCap; + return this; + } + + /** + * Token market cap at the time of this transaction, denominated in USD. + * + * @return marketCap + */ + @jakarta.annotation.Nullable + public String getMarketCap() { + return marketCap; + } + + public void setMarketCap(@jakarta.annotation.Nullable String marketCap) { + this.marketCap = marketCap; + } + + public GetDexTradeHistoryResponseDataTransactionListInner txHash( + @jakarta.annotation.Nullable String txHash) { + this.txHash = txHash; + return this; + } + + /** + * On-chain transaction hash. + * + * @return txHash + */ + @jakarta.annotation.Nullable + public String getTxHash() { + return txHash; + } + + public void setTxHash(@jakarta.annotation.Nullable String txHash) { + this.txHash = txHash; + } + + public GetDexTradeHistoryResponseDataTransactionListInner chainLogoUrl( + @jakarta.annotation.Nullable String chainLogoUrl) { + this.chainLogoUrl = chainLogoUrl; + return this; + } + + /** + * Chain logo image URL. + * + * @return chainLogoUrl + */ + @jakarta.annotation.Nullable + public String getChainLogoUrl() { + return chainLogoUrl; + } + + public void setChainLogoUrl(@jakarta.annotation.Nullable String chainLogoUrl) { + this.chainLogoUrl = chainLogoUrl; + } + + public GetDexTradeHistoryResponseDataTransactionListInner time( + @jakarta.annotation.Nullable String time) { + this.time = time; + return this; + } + + /** + * Transaction on-chain time, Unix millisecond timestamp. + * + * @return time + */ + @jakarta.annotation.Nullable + public String getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable String time) { + this.time = time; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDexTradeHistoryResponseDataTransactionListInner + getDexTradeHistoryResponseDataTransactionListInner = + (GetDexTradeHistoryResponseDataTransactionListInner) o; + return Objects.equals(this.type, getDexTradeHistoryResponseDataTransactionListInner.type) + && Objects.equals( + this.binanceChainId, + getDexTradeHistoryResponseDataTransactionListInner.binanceChainId) + && Objects.equals( + this.tokenContractAddress, + getDexTradeHistoryResponseDataTransactionListInner.tokenContractAddress) + && Objects.equals( + this.tokenSymbol, + getDexTradeHistoryResponseDataTransactionListInner.tokenSymbol) + && Objects.equals( + this.valueUsd, getDexTradeHistoryResponseDataTransactionListInner.valueUsd) + && Objects.equals( + this.amount, getDexTradeHistoryResponseDataTransactionListInner.amount) + && Objects.equals( + this.price, getDexTradeHistoryResponseDataTransactionListInner.price) + && Objects.equals( + this.marketCap, + getDexTradeHistoryResponseDataTransactionListInner.marketCap) + && Objects.equals( + this.txHash, getDexTradeHistoryResponseDataTransactionListInner.txHash) + && Objects.equals( + this.chainLogoUrl, + getDexTradeHistoryResponseDataTransactionListInner.chainLogoUrl) + && Objects.equals( + this.time, getDexTradeHistoryResponseDataTransactionListInner.time); + } + + @Override + public int hashCode() { + return Objects.hash( + type, + binanceChainId, + tokenContractAddress, + tokenSymbol, + valueUsd, + amount, + price, + marketCap, + txHash, + chainLogoUrl, + time); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDexTradeHistoryResponseDataTransactionListInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" valueUsd: ").append(toIndentedString(valueUsd)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" marketCap: ").append(toIndentedString(marketCap)).append("\n"); + sb.append(" txHash: ").append(toIndentedString(txHash)).append("\n"); + sb.append(" chainLogoUrl: ").append(toIndentedString(chainLogoUrl)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object valueUsdValue = getValueUsd(); + String valueUsdValueAsString = ""; + valueUsdValueAsString = valueUsdValue.toString(); + sb.append("valueUsd=").append(urlEncode(valueUsdValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object marketCapValue = getMarketCap(); + String marketCapValueAsString = ""; + marketCapValueAsString = marketCapValue.toString(); + sb.append("marketCap=").append(urlEncode(marketCapValueAsString)).append(""); + Object txHashValue = getTxHash(); + String txHashValueAsString = ""; + txHashValueAsString = txHashValue.toString(); + sb.append("txHash=").append(urlEncode(txHashValueAsString)).append(""); + Object chainLogoUrlValue = getChainLogoUrl(); + String chainLogoUrlValueAsString = ""; + chainLogoUrlValueAsString = chainLogoUrlValue.toString(); + sb.append("chainLogoUrl=").append(urlEncode(chainLogoUrlValueAsString)).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("type"); + openapiFields.add("binanceChainId"); + openapiFields.add("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + openapiFields.add("valueUsd"); + openapiFields.add("amount"); + openapiFields.add("price"); + openapiFields.add("marketCap"); + openapiFields.add("txHash"); + openapiFields.add("chainLogoUrl"); + 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 + * GetDexTradeHistoryResponseDataTransactionListInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetDexTradeHistoryResponseDataTransactionListInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetDexTradeHistoryResponseDataTransactionListInner is not" + + " found in the empty JSON string", + GetDexTradeHistoryResponseDataTransactionListInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !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())); + } + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + if ((jsonObj.get("valueUsd") != null && !jsonObj.get("valueUsd").isJsonNull()) + && !jsonObj.get("valueUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `valueUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("valueUsd").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("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("marketCap") != null && !jsonObj.get("marketCap").isJsonNull()) + && !jsonObj.get("marketCap").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marketCap` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("marketCap").toString())); + } + if ((jsonObj.get("txHash") != null && !jsonObj.get("txHash").isJsonNull()) + && !jsonObj.get("txHash").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txHash` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("txHash").toString())); + } + if ((jsonObj.get("chainLogoUrl") != null && !jsonObj.get("chainLogoUrl").isJsonNull()) + && !jsonObj.get("chainLogoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `chainLogoUrl` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("chainLogoUrl").toString())); + } + if ((jsonObj.get("time") != null && !jsonObj.get("time").isJsonNull()) + && !jsonObj.get("time").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `time` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("time").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDexTradeHistoryResponseDataTransactionListInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetDexTradeHistoryResponseDataTransactionListInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetDexTradeHistoryResponseDataTransactionListInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetDexTradeHistoryResponseDataTransactionListInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDexTradeHistoryResponseDataTransactionListInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDexTradeHistoryResponseDataTransactionListInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDexTradeHistoryResponseDataTransactionListInner + * @throws IOException if the JSON string is invalid with respect to + * GetDexTradeHistoryResponseDataTransactionListInner + */ + public static GetDexTradeHistoryResponseDataTransactionListInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetDexTradeHistoryResponseDataTransactionListInner.class); + } + + /** + * Convert an instance of GetDexTradeHistoryResponseDataTransactionListInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequest.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequest.java index de39b0d..f73bd7e 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequest.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequest.java @@ -46,15 +46,21 @@ public class GetGasLimitRequest { public static final String SERIALIZED_NAME_EVM_TX = "evmTx"; @SerializedName(SERIALIZED_NAME_EVM_TX) - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull private GetGasLimitRequestEvmTx evmTx; public static final String SERIALIZED_NAME_SOL_TX = "solTx"; @SerializedName(SERIALIZED_NAME_SOL_TX) - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull private GetGasLimitRequestSolTx solTx; + public static final String SERIALIZED_NAME_TRON_TX = "tronTx"; + + @SerializedName(SERIALIZED_NAME_TRON_TX) + @jakarta.annotation.Nonnull + private GetGasLimitRequestTronTx tronTx; + public GetGasLimitRequest() {} public GetGasLimitRequest binanceChainId(@jakarta.annotation.Nonnull String binanceChainId) { @@ -64,7 +70,11 @@ public GetGasLimitRequest binanceChainId(@jakarta.annotation.Nonnull String bina /** * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, - * \"CT_501\"=Solana). + * \"CT_501\"=Solana, \"CT_195\"=Tron). Provide `evmTx` + * for EVM chains, `solTx` for Solana, or `tronTx` for Tron — exactly one + * must be present. Note: `evmTx`, `solTx`, and `tronTx` are + * marked required in this schema for rendering purposes only; in practice supply exactly one + * matching `binanceChainId`. * * @return binanceChainId */ @@ -78,7 +88,7 @@ public void setBinanceChainId(@jakarta.annotation.Nonnull String binanceChainId) this.binanceChainId = binanceChainId; } - public GetGasLimitRequest evmTx(@jakarta.annotation.Nullable GetGasLimitRequestEvmTx evmTx) { + public GetGasLimitRequest evmTx(@jakarta.annotation.Nonnull GetGasLimitRequestEvmTx evmTx) { this.evmTx = evmTx; return this; } @@ -88,17 +98,18 @@ public GetGasLimitRequest evmTx(@jakarta.annotation.Nullable GetGasLimitRequestE * * @return evmTx */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull + @NotNull @Valid public GetGasLimitRequestEvmTx getEvmTx() { return evmTx; } - public void setEvmTx(@jakarta.annotation.Nullable GetGasLimitRequestEvmTx evmTx) { + public void setEvmTx(@jakarta.annotation.Nonnull GetGasLimitRequestEvmTx evmTx) { this.evmTx = evmTx; } - public GetGasLimitRequest solTx(@jakarta.annotation.Nullable GetGasLimitRequestSolTx solTx) { + public GetGasLimitRequest solTx(@jakarta.annotation.Nonnull GetGasLimitRequestSolTx solTx) { this.solTx = solTx; return this; } @@ -108,16 +119,38 @@ public GetGasLimitRequest solTx(@jakarta.annotation.Nullable GetGasLimitRequestS * * @return solTx */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull + @NotNull @Valid public GetGasLimitRequestSolTx getSolTx() { return solTx; } - public void setSolTx(@jakarta.annotation.Nullable GetGasLimitRequestSolTx solTx) { + public void setSolTx(@jakarta.annotation.Nonnull GetGasLimitRequestSolTx solTx) { this.solTx = solTx; } + public GetGasLimitRequest tronTx(@jakarta.annotation.Nonnull GetGasLimitRequestTronTx tronTx) { + this.tronTx = tronTx; + return this; + } + + /** + * Get tronTx + * + * @return tronTx + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public GetGasLimitRequestTronTx getTronTx() { + return tronTx; + } + + public void setTronTx(@jakarta.annotation.Nonnull GetGasLimitRequestTronTx tronTx) { + this.tronTx = tronTx; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -129,12 +162,13 @@ public boolean equals(Object o) { GetGasLimitRequest getGasLimitRequest = (GetGasLimitRequest) o; return Objects.equals(this.binanceChainId, getGasLimitRequest.binanceChainId) && Objects.equals(this.evmTx, getGasLimitRequest.evmTx) - && Objects.equals(this.solTx, getGasLimitRequest.solTx); + && Objects.equals(this.solTx, getGasLimitRequest.solTx) + && Objects.equals(this.tronTx, getGasLimitRequest.tronTx); } @Override public int hashCode() { - return Objects.hash(binanceChainId, evmTx, solTx); + return Objects.hash(binanceChainId, evmTx, solTx, tronTx); } @Override @@ -144,6 +178,7 @@ public String toString() { sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); sb.append(" evmTx: ").append(toIndentedString(evmTx)).append("\n"); sb.append(" solTx: ").append(toIndentedString(solTx)).append("\n"); + sb.append(" tronTx: ").append(toIndentedString(tronTx)).append("\n"); sb.append("}"); return sb.toString(); } @@ -163,6 +198,10 @@ public String toUrlQueryString() { String solTxValueAsString = ""; solTxValueAsString = solTxValue.toString(); sb.append("solTx=").append(urlEncode(solTxValueAsString)).append(""); + Object tronTxValue = getTronTx(); + String tronTxValueAsString = ""; + tronTxValueAsString = tronTxValue.toString(); + sb.append("tronTx=").append(urlEncode(tronTxValueAsString)).append(""); return sb.toString(); } @@ -194,10 +233,14 @@ private String toIndentedString(Object o) { openapiFields.add("binanceChainId"); openapiFields.add("evmTx"); openapiFields.add("solTx"); + openapiFields.add("tronTx"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("binanceChainId"); + openapiRequiredFields.add("evmTx"); + openapiRequiredFields.add("solTx"); + openapiRequiredFields.add("tronTx"); } /** @@ -235,14 +278,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("binanceChainId").toString())); } - // validate the optional field `evmTx` - if (jsonObj.get("evmTx") != null && !jsonObj.get("evmTx").isJsonNull()) { - GetGasLimitRequestEvmTx.validateJsonElement(jsonObj.get("evmTx")); - } - // validate the optional field `solTx` - if (jsonObj.get("solTx") != null && !jsonObj.get("solTx").isJsonNull()) { - GetGasLimitRequestSolTx.validateJsonElement(jsonObj.get("solTx")); - } + // validate the required field `evmTx` + GetGasLimitRequestEvmTx.validateJsonElement(jsonObj.get("evmTx")); + // validate the required field `solTx` + GetGasLimitRequestSolTx.validateJsonElement(jsonObj.get("solTx")); + // validate the required field `tronTx` + GetGasLimitRequestTronTx.validateJsonElement(jsonObj.get("tronTx")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestEvmTx.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestEvmTx.java index ef2770a..a34c479 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestEvmTx.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestEvmTx.java @@ -57,7 +57,7 @@ public class GetGasLimitRequestEvmTx { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull private String data; public GetGasLimitRequestEvmTx() {} @@ -122,7 +122,7 @@ public void setValue(@jakarta.annotation.Nonnull String value) { this.value = value; } - public GetGasLimitRequestEvmTx data(@jakarta.annotation.Nullable String data) { + public GetGasLimitRequestEvmTx data(@jakarta.annotation.Nonnull String data) { this.data = data; return this; } @@ -132,12 +132,13 @@ public GetGasLimitRequestEvmTx data(@jakarta.annotation.Nullable String data) { * * @return data */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull + @NotNull public String getData() { return data; } - public void setData(@jakarta.annotation.Nullable String data) { + public void setData(@jakarta.annotation.Nonnull String data) { this.data = data; } @@ -230,6 +231,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("from"); openapiRequiredFields.add("to"); openapiRequiredFields.add("value"); + openapiRequiredFields.add("data"); } /** @@ -281,8 +283,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("value").toString())); } - if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) - && !jsonObj.get("data").isJsonPrimitive()) { + if (!jsonObj.get("data").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `data` to be a primitive type in the JSON string" diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTx.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTx.java new file mode 100644 index 0000000..10bd7cb --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTx.java @@ -0,0 +1,423 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.JsonAdapter; +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.*; + +/** Tron transaction payload. Required when `binanceChainId=CT_195`. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetGasLimitRequestTronTx { + public static final String SERIALIZED_NAME_FROM = "from"; + + @SerializedName(SERIALIZED_NAME_FROM) + @jakarta.annotation.Nonnull + private String from; + + /** + * Tron contract type. `TRIGGER_SMART_CONTRACT` requires + * `triggerSmartContractParams`; `TRANSFER_CONTRACT` requires + * `transferContractParams`. + */ + @JsonAdapter(TxTypeEnum.Adapter.class) + public enum TxTypeEnum { + TRIGGER_SMART_CONTRACT("TRIGGER_SMART_CONTRACT"), + + TRANSFER_CONTRACT("TRANSFER_CONTRACT"); + + private String value; + + TxTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TxTypeEnum fromValue(String value) { + for (TxTypeEnum b : TxTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TxTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TxTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TxTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TxTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TX_TYPE = "txType"; + + @SerializedName(SERIALIZED_NAME_TX_TYPE) + @jakarta.annotation.Nonnull + private TxTypeEnum txType; + + public static final String SERIALIZED_NAME_TRIGGER_SMART_CONTRACT_PARAMS = + "triggerSmartContractParams"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_SMART_CONTRACT_PARAMS) + @jakarta.annotation.Nullable + private GetGasLimitRequestTronTxTriggerSmartContractParams triggerSmartContractParams; + + public static final String SERIALIZED_NAME_TRANSFER_CONTRACT_PARAMS = "transferContractParams"; + + @SerializedName(SERIALIZED_NAME_TRANSFER_CONTRACT_PARAMS) + @jakarta.annotation.Nullable + private GetGasLimitRequestTronTxTransferContractParams transferContractParams; + + public GetGasLimitRequestTronTx() {} + + public GetGasLimitRequestTronTx from(@jakarta.annotation.Nonnull String from) { + this.from = from; + return this; + } + + /** + * Sender address (base58check). + * + * @return from + */ + @jakarta.annotation.Nonnull + @NotNull + public String getFrom() { + return from; + } + + public void setFrom(@jakarta.annotation.Nonnull String from) { + this.from = from; + } + + public GetGasLimitRequestTronTx txType(@jakarta.annotation.Nonnull TxTypeEnum txType) { + this.txType = txType; + return this; + } + + /** + * Tron contract type. `TRIGGER_SMART_CONTRACT` requires + * `triggerSmartContractParams`; `TRANSFER_CONTRACT` requires + * `transferContractParams`. + * + * @return txType + */ + @jakarta.annotation.Nonnull + @NotNull + public TxTypeEnum getTxType() { + return txType; + } + + public void setTxType(@jakarta.annotation.Nonnull TxTypeEnum txType) { + this.txType = txType; + } + + public GetGasLimitRequestTronTx triggerSmartContractParams( + @jakarta.annotation.Nullable + GetGasLimitRequestTronTxTriggerSmartContractParams triggerSmartContractParams) { + this.triggerSmartContractParams = triggerSmartContractParams; + return this; + } + + /** + * Get triggerSmartContractParams + * + * @return triggerSmartContractParams + */ + @jakarta.annotation.Nullable + @Valid + public GetGasLimitRequestTronTxTriggerSmartContractParams getTriggerSmartContractParams() { + return triggerSmartContractParams; + } + + public void setTriggerSmartContractParams( + @jakarta.annotation.Nullable + GetGasLimitRequestTronTxTriggerSmartContractParams triggerSmartContractParams) { + this.triggerSmartContractParams = triggerSmartContractParams; + } + + public GetGasLimitRequestTronTx transferContractParams( + @jakarta.annotation.Nullable + GetGasLimitRequestTronTxTransferContractParams transferContractParams) { + this.transferContractParams = transferContractParams; + return this; + } + + /** + * Get transferContractParams + * + * @return transferContractParams + */ + @jakarta.annotation.Nullable + @Valid + public GetGasLimitRequestTronTxTransferContractParams getTransferContractParams() { + return transferContractParams; + } + + public void setTransferContractParams( + @jakarta.annotation.Nullable + GetGasLimitRequestTronTxTransferContractParams transferContractParams) { + this.transferContractParams = transferContractParams; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGasLimitRequestTronTx getGasLimitRequestTronTx = (GetGasLimitRequestTronTx) o; + return Objects.equals(this.from, getGasLimitRequestTronTx.from) + && Objects.equals(this.txType, getGasLimitRequestTronTx.txType) + && Objects.equals( + this.triggerSmartContractParams, + getGasLimitRequestTronTx.triggerSmartContractParams) + && Objects.equals( + this.transferContractParams, + getGasLimitRequestTronTx.transferContractParams); + } + + @Override + public int hashCode() { + return Objects.hash(from, txType, triggerSmartContractParams, transferContractParams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetGasLimitRequestTronTx {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" txType: ").append(toIndentedString(txType)).append("\n"); + sb.append(" triggerSmartContractParams: ") + .append(toIndentedString(triggerSmartContractParams)) + .append("\n"); + sb.append(" transferContractParams: ") + .append(toIndentedString(transferContractParams)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object fromValue = getFrom(); + String fromValueAsString = ""; + fromValueAsString = fromValue.toString(); + sb.append("from=").append(urlEncode(fromValueAsString)).append(""); + Object txTypeValue = getTxType(); + String txTypeValueAsString = ""; + txTypeValueAsString = txTypeValue.toString(); + sb.append("txType=").append(urlEncode(txTypeValueAsString)).append(""); + Object triggerSmartContractParamsValue = getTriggerSmartContractParams(); + String triggerSmartContractParamsValueAsString = ""; + triggerSmartContractParamsValueAsString = triggerSmartContractParamsValue.toString(); + sb.append("triggerSmartContractParams=") + .append(urlEncode(triggerSmartContractParamsValueAsString)) + .append(""); + Object transferContractParamsValue = getTransferContractParams(); + String transferContractParamsValueAsString = ""; + transferContractParamsValueAsString = transferContractParamsValue.toString(); + sb.append("transferContractParams=") + .append(urlEncode(transferContractParamsValueAsString)) + .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("from"); + openapiFields.add("txType"); + openapiFields.add("triggerSmartContractParams"); + openapiFields.add("transferContractParams"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("txType"); + } + + /** + * 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 GetGasLimitRequestTronTx + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetGasLimitRequestTronTx.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetGasLimitRequestTronTx is not found" + + " in the empty JSON string", + GetGasLimitRequestTronTx.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetGasLimitRequestTronTx.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("from").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `from` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("from").toString())); + } + if (!jsonObj.get("txType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txType` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("txType").toString())); + } + // validate the required field `txType` + TxTypeEnum.validateJsonElement(jsonObj.get("txType")); + // validate the optional field `triggerSmartContractParams` + if (jsonObj.get("triggerSmartContractParams") != null + && !jsonObj.get("triggerSmartContractParams").isJsonNull()) { + GetGasLimitRequestTronTxTriggerSmartContractParams.validateJsonElement( + jsonObj.get("triggerSmartContractParams")); + } + // validate the optional field `transferContractParams` + if (jsonObj.get("transferContractParams") != null + && !jsonObj.get("transferContractParams").isJsonNull()) { + GetGasLimitRequestTronTxTransferContractParams.validateJsonElement( + jsonObj.get("transferContractParams")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetGasLimitRequestTronTx.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetGasLimitRequestTronTx' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetGasLimitRequestTronTx.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetGasLimitRequestTronTx value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetGasLimitRequestTronTx read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetGasLimitRequestTronTx given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetGasLimitRequestTronTx + * @throws IOException if the JSON string is invalid with respect to GetGasLimitRequestTronTx + */ + public static GetGasLimitRequestTronTx fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetGasLimitRequestTronTx.class); + } + + /** + * Convert an instance of GetGasLimitRequestTronTx to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTxTransferContractParams.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTxTransferContractParams.java new file mode 100644 index 0000000..ba94ed5 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTxTransferContractParams.java @@ -0,0 +1,276 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Required when `txType=TRANSFER_CONTRACT`. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetGasLimitRequestTronTxTransferContractParams { + public static final String SERIALIZED_NAME_TO_ADDRESS = "toAddress"; + + @SerializedName(SERIALIZED_NAME_TO_ADDRESS) + @jakarta.annotation.Nonnull + private String toAddress; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nonnull + private Long amount; + + public GetGasLimitRequestTronTxTransferContractParams() {} + + public GetGasLimitRequestTronTxTransferContractParams toAddress( + @jakarta.annotation.Nonnull String toAddress) { + this.toAddress = toAddress; + return this; + } + + /** + * Recipient address (base58check). + * + * @return toAddress + */ + @jakarta.annotation.Nonnull + @NotNull + public String getToAddress() { + return toAddress; + } + + public void setToAddress(@jakarta.annotation.Nonnull String toAddress) { + this.toAddress = toAddress; + } + + public GetGasLimitRequestTronTxTransferContractParams amount( + @jakarta.annotation.Nonnull Long amount) { + this.amount = amount; + return this; + } + + /** + * TRX amount in sun (1 TRX = 1_000_000 sun). minimum: 1 + * + * @return amount + */ + @jakarta.annotation.Nonnull + @NotNull + @Min(1L) + public Long getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nonnull Long amount) { + this.amount = amount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGasLimitRequestTronTxTransferContractParams + getGasLimitRequestTronTxTransferContractParams = + (GetGasLimitRequestTronTxTransferContractParams) o; + return Objects.equals( + this.toAddress, getGasLimitRequestTronTxTransferContractParams.toAddress) + && Objects.equals( + this.amount, getGasLimitRequestTronTxTransferContractParams.amount); + } + + @Override + public int hashCode() { + return Objects.hash(toAddress, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetGasLimitRequestTronTxTransferContractParams {\n"); + sb.append(" toAddress: ").append(toIndentedString(toAddress)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object toAddressValue = getToAddress(); + String toAddressValueAsString = ""; + toAddressValueAsString = toAddressValue.toString(); + sb.append("toAddress=").append(urlEncode(toAddressValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).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("toAddress"); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("toAddress"); + 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 + * GetGasLimitRequestTronTxTransferContractParams + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetGasLimitRequestTronTxTransferContractParams.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetGasLimitRequestTronTxTransferContractParams is not found" + + " in the empty JSON string", + GetGasLimitRequestTronTxTransferContractParams.openapiRequiredFields + .toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + GetGasLimitRequestTronTxTransferContractParams.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("toAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `toAddress` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("toAddress").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetGasLimitRequestTronTxTransferContractParams.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetGasLimitRequestTronTxTransferContractParams' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetGasLimitRequestTronTxTransferContractParams.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetGasLimitRequestTronTxTransferContractParams value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetGasLimitRequestTronTxTransferContractParams read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetGasLimitRequestTronTxTransferContractParams given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetGasLimitRequestTronTxTransferContractParams + * @throws IOException if the JSON string is invalid with respect to + * GetGasLimitRequestTronTxTransferContractParams + */ + public static GetGasLimitRequestTronTxTransferContractParams fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetGasLimitRequestTronTxTransferContractParams.class); + } + + /** + * Convert an instance of GetGasLimitRequestTronTxTransferContractParams to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTxTriggerSmartContractParams.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTxTriggerSmartContractParams.java new file mode 100644 index 0000000..a4b6ff0 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitRequestTronTxTriggerSmartContractParams.java @@ -0,0 +1,376 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.Arrays; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Required when `txType=TRIGGER_SMART_CONTRACT`. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetGasLimitRequestTronTxTriggerSmartContractParams { + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + @jakarta.annotation.Nonnull + private String contractAddress; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nonnull + private String data; + + public static final String SERIALIZED_NAME_CALL_VALUE = "callValue"; + + @SerializedName(SERIALIZED_NAME_CALL_VALUE) + @jakarta.annotation.Nonnull + private Long callValue; + + public static final String SERIALIZED_NAME_FEE_LIMIT_SUN = "feeLimitSun"; + + @SerializedName(SERIALIZED_NAME_FEE_LIMIT_SUN) + @jakarta.annotation.Nullable + private Long feeLimitSun; + + public GetGasLimitRequestTronTxTriggerSmartContractParams() {} + + public GetGasLimitRequestTronTxTriggerSmartContractParams contractAddress( + @jakarta.annotation.Nonnull String contractAddress) { + this.contractAddress = contractAddress; + return this; + } + + /** + * Smart-contract address (base58check). + * + * @return contractAddress + */ + @jakarta.annotation.Nonnull + @NotNull + public String getContractAddress() { + return contractAddress; + } + + public void setContractAddress(@jakarta.annotation.Nonnull String contractAddress) { + this.contractAddress = contractAddress; + } + + public GetGasLimitRequestTronTxTriggerSmartContractParams data( + @jakarta.annotation.Nonnull String data) { + this.data = data; + return this; + } + + /** + * ABI-encoded calldata (hex, no `0x` prefix). + * + * @return data + */ + @jakarta.annotation.Nonnull + @NotNull + public String getData() { + return data; + } + + public void setData(@jakarta.annotation.Nonnull String data) { + this.data = data; + } + + public GetGasLimitRequestTronTxTriggerSmartContractParams callValue( + @jakarta.annotation.Nonnull Long callValue) { + this.callValue = callValue; + return this; + } + + /** + * Amount of TRX (in sun) to attach as `call_value`. + * + * @return callValue + */ + @jakarta.annotation.Nonnull + @NotNull + public Long getCallValue() { + return callValue; + } + + public void setCallValue(@jakarta.annotation.Nonnull Long callValue) { + this.callValue = callValue; + } + + public GetGasLimitRequestTronTxTriggerSmartContractParams feeLimitSun( + @jakarta.annotation.Nullable Long feeLimitSun) { + this.feeLimitSun = feeLimitSun; + return this; + } + + /** + * Optional max fee the caller is willing to pay (in sun). If omitted, server default applies. + * + * @return feeLimitSun + */ + @jakarta.annotation.Nullable + public Long getFeeLimitSun() { + return feeLimitSun; + } + + public void setFeeLimitSun(@jakarta.annotation.Nullable Long feeLimitSun) { + this.feeLimitSun = feeLimitSun; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGasLimitRequestTronTxTriggerSmartContractParams + getGasLimitRequestTronTxTriggerSmartContractParams = + (GetGasLimitRequestTronTxTriggerSmartContractParams) o; + return Objects.equals( + this.contractAddress, + getGasLimitRequestTronTxTriggerSmartContractParams.contractAddress) + && Objects.equals( + this.data, getGasLimitRequestTronTxTriggerSmartContractParams.data) + && Objects.equals( + this.callValue, + getGasLimitRequestTronTxTriggerSmartContractParams.callValue) + && Objects.equals( + this.feeLimitSun, + getGasLimitRequestTronTxTriggerSmartContractParams.feeLimitSun); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(contractAddress, data, callValue, feeLimitSun); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetGasLimitRequestTronTxTriggerSmartContractParams {\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" callValue: ").append(toIndentedString(callValue)).append("\n"); + sb.append(" feeLimitSun: ").append(toIndentedString(feeLimitSun)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object contractAddressValue = getContractAddress(); + String contractAddressValueAsString = ""; + contractAddressValueAsString = contractAddressValue.toString(); + sb.append("contractAddress=").append(urlEncode(contractAddressValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object callValueValue = getCallValue(); + String callValueValueAsString = ""; + callValueValueAsString = callValueValue.toString(); + sb.append("callValue=").append(urlEncode(callValueValueAsString)).append(""); + Object feeLimitSunValue = getFeeLimitSun(); + String feeLimitSunValueAsString = ""; + feeLimitSunValueAsString = feeLimitSunValue.toString(); + sb.append("feeLimitSun=").append(urlEncode(feeLimitSunValueAsString)).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("contractAddress"); + openapiFields.add("data"); + openapiFields.add("callValue"); + openapiFields.add("feeLimitSun"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("callValue"); + } + + /** + * 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 + * GetGasLimitRequestTronTxTriggerSmartContractParams + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetGasLimitRequestTronTxTriggerSmartContractParams.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetGasLimitRequestTronTxTriggerSmartContractParams is not" + + " found in the empty JSON string", + GetGasLimitRequestTronTxTriggerSmartContractParams + .openapiRequiredFields + .toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + GetGasLimitRequestTronTxTriggerSmartContractParams.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("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())); + } + if (!jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `data` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("data").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetGasLimitRequestTronTxTriggerSmartContractParams.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetGasLimitRequestTronTxTriggerSmartContractParams' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetGasLimitRequestTronTxTriggerSmartContractParams.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetGasLimitRequestTronTxTriggerSmartContractParams value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetGasLimitRequestTronTxTriggerSmartContractParams read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetGasLimitRequestTronTxTriggerSmartContractParams given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetGasLimitRequestTronTxTriggerSmartContractParams + * @throws IOException if the JSON string is invalid with respect to + * GetGasLimitRequestTronTxTriggerSmartContractParams + */ + public static GetGasLimitRequestTronTxTriggerSmartContractParams fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetGasLimitRequestTronTxTriggerSmartContractParams.class); + } + + /** + * Convert an instance of GetGasLimitRequestTronTxTriggerSmartContractParams to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitResponseData.java index ea7e63b..49982c3 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitResponseData.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetGasLimitResponseData.java @@ -27,11 +27,16 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.HashSet; import java.util.Objects; import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; -/** GetGasLimitResponseData */ +/** + * Estimated gas limit. On Tron, the response additionally carries energy/bandwidth fields; + * non-applicable fields are returned as `null`. + */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0") @@ -42,6 +47,42 @@ public class GetGasLimitResponseData { @jakarta.annotation.Nullable private String gasLimit; + public static final String SERIALIZED_NAME_ENERGY_REQUIRED = "energyRequired"; + + @SerializedName(SERIALIZED_NAME_ENERGY_REQUIRED) + @jakarta.annotation.Nullable + private String energyRequired; + + public static final String SERIALIZED_NAME_BANDWIDTH_REQUIRED = "bandwidthRequired"; + + @SerializedName(SERIALIZED_NAME_BANDWIDTH_REQUIRED) + @jakarta.annotation.Nullable + private String bandwidthRequired; + + public static final String SERIALIZED_NAME_FREE_ENERGY = "freeEnergy"; + + @SerializedName(SERIALIZED_NAME_FREE_ENERGY) + @jakarta.annotation.Nullable + private String freeEnergy; + + public static final String SERIALIZED_NAME_FREE_BANDWIDTH = "freeBandwidth"; + + @SerializedName(SERIALIZED_NAME_FREE_BANDWIDTH) + @jakarta.annotation.Nullable + private String freeBandwidth; + + public static final String SERIALIZED_NAME_ENERGY_FEE = "energyFee"; + + @SerializedName(SERIALIZED_NAME_ENERGY_FEE) + @jakarta.annotation.Nullable + private String energyFee; + + public static final String SERIALIZED_NAME_BANDWIDTH_FEE = "bandwidthFee"; + + @SerializedName(SERIALIZED_NAME_BANDWIDTH_FEE) + @jakarta.annotation.Nullable + private String bandwidthFee; + public GetGasLimitResponseData() {} public GetGasLimitResponseData gasLimit(@jakarta.annotation.Nullable String gasLimit) { @@ -50,7 +91,8 @@ public GetGasLimitResponseData gasLimit(@jakarta.annotation.Nullable String gasL } /** - * Estimated gas limit (EVM) or compute-unit ceiling (Solana), as an integer string. + * Estimated gas limit (EVM), compute-unit ceiling (Solana), or fee limit in sun (Tron), as an + * integer string. * * @return gasLimit */ @@ -63,6 +105,123 @@ public void setGasLimit(@jakarta.annotation.Nullable String gasLimit) { this.gasLimit = gasLimit; } + public GetGasLimitResponseData energyRequired( + @jakarta.annotation.Nullable String energyRequired) { + this.energyRequired = energyRequired; + return this; + } + + /** + * Energy consumed by the Tron transaction (integer string). Null on non-Tron chains. + * + * @return energyRequired + */ + @jakarta.annotation.Nullable + public String getEnergyRequired() { + return energyRequired; + } + + public void setEnergyRequired(@jakarta.annotation.Nullable String energyRequired) { + this.energyRequired = energyRequired; + } + + public GetGasLimitResponseData bandwidthRequired( + @jakarta.annotation.Nullable String bandwidthRequired) { + this.bandwidthRequired = bandwidthRequired; + return this; + } + + /** + * Bandwidth consumed by the Tron transaction (integer string). Null on non-Tron chains. + * + * @return bandwidthRequired + */ + @jakarta.annotation.Nullable + public String getBandwidthRequired() { + return bandwidthRequired; + } + + public void setBandwidthRequired(@jakarta.annotation.Nullable String bandwidthRequired) { + this.bandwidthRequired = bandwidthRequired; + } + + public GetGasLimitResponseData freeEnergy(@jakarta.annotation.Nullable String freeEnergy) { + this.freeEnergy = freeEnergy; + return this; + } + + /** + * Free energy available to the account on Tron (integer string). Null on non-Tron chains. + * + * @return freeEnergy + */ + @jakarta.annotation.Nullable + public String getFreeEnergy() { + return freeEnergy; + } + + public void setFreeEnergy(@jakarta.annotation.Nullable String freeEnergy) { + this.freeEnergy = freeEnergy; + } + + public GetGasLimitResponseData freeBandwidth( + @jakarta.annotation.Nullable String freeBandwidth) { + this.freeBandwidth = freeBandwidth; + return this; + } + + /** + * Free bandwidth available to the account on Tron (integer string). Null on non-Tron chains. + * + * @return freeBandwidth + */ + @jakarta.annotation.Nullable + public String getFreeBandwidth() { + return freeBandwidth; + } + + public void setFreeBandwidth(@jakarta.annotation.Nullable String freeBandwidth) { + this.freeBandwidth = freeBandwidth; + } + + public GetGasLimitResponseData energyFee(@jakarta.annotation.Nullable String energyFee) { + this.energyFee = energyFee; + return this; + } + + /** + * Unit price of energy on Tron (sun per energy, integer string). Null on non-Tron chains. + * + * @return energyFee + */ + @jakarta.annotation.Nullable + public String getEnergyFee() { + return energyFee; + } + + public void setEnergyFee(@jakarta.annotation.Nullable String energyFee) { + this.energyFee = energyFee; + } + + public GetGasLimitResponseData bandwidthFee(@jakarta.annotation.Nullable String bandwidthFee) { + this.bandwidthFee = bandwidthFee; + return this; + } + + /** + * Unit price of bandwidth on Tron (sun per byte, integer string). Null on non-Tron chains. + * + * @return bandwidthFee + */ + @jakarta.annotation.Nullable + public String getBandwidthFee() { + return bandwidthFee; + } + + public void setBandwidthFee(@jakarta.annotation.Nullable String bandwidthFee) { + this.bandwidthFee = bandwidthFee; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -72,12 +231,41 @@ public boolean equals(Object o) { return false; } GetGasLimitResponseData getGasLimitResponseData = (GetGasLimitResponseData) o; - return Objects.equals(this.gasLimit, getGasLimitResponseData.gasLimit); + return Objects.equals(this.gasLimit, getGasLimitResponseData.gasLimit) + && Objects.equals(this.energyRequired, getGasLimitResponseData.energyRequired) + && Objects.equals(this.bandwidthRequired, getGasLimitResponseData.bandwidthRequired) + && Objects.equals(this.freeEnergy, getGasLimitResponseData.freeEnergy) + && Objects.equals(this.freeBandwidth, getGasLimitResponseData.freeBandwidth) + && Objects.equals(this.energyFee, getGasLimitResponseData.energyFee) + && Objects.equals(this.bandwidthFee, getGasLimitResponseData.bandwidthFee); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(gasLimit); + return Objects.hash( + gasLimit, + energyRequired, + bandwidthRequired, + freeEnergy, + freeBandwidth, + energyFee, + bandwidthFee); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } @Override @@ -85,6 +273,12 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetGasLimitResponseData {\n"); sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" energyRequired: ").append(toIndentedString(energyRequired)).append("\n"); + sb.append(" bandwidthRequired: ").append(toIndentedString(bandwidthRequired)).append("\n"); + sb.append(" freeEnergy: ").append(toIndentedString(freeEnergy)).append("\n"); + sb.append(" freeBandwidth: ").append(toIndentedString(freeBandwidth)).append("\n"); + sb.append(" energyFee: ").append(toIndentedString(energyFee)).append("\n"); + sb.append(" bandwidthFee: ").append(toIndentedString(bandwidthFee)).append("\n"); sb.append("}"); return sb.toString(); } @@ -96,6 +290,32 @@ public String toUrlQueryString() { String gasLimitValueAsString = ""; gasLimitValueAsString = gasLimitValue.toString(); sb.append("gasLimit=").append(urlEncode(gasLimitValueAsString)).append(""); + Object energyRequiredValue = getEnergyRequired(); + String energyRequiredValueAsString = ""; + energyRequiredValueAsString = energyRequiredValue.toString(); + sb.append("energyRequired=").append(urlEncode(energyRequiredValueAsString)).append(""); + Object bandwidthRequiredValue = getBandwidthRequired(); + String bandwidthRequiredValueAsString = ""; + bandwidthRequiredValueAsString = bandwidthRequiredValue.toString(); + sb.append("bandwidthRequired=") + .append(urlEncode(bandwidthRequiredValueAsString)) + .append(""); + Object freeEnergyValue = getFreeEnergy(); + String freeEnergyValueAsString = ""; + freeEnergyValueAsString = freeEnergyValue.toString(); + sb.append("freeEnergy=").append(urlEncode(freeEnergyValueAsString)).append(""); + Object freeBandwidthValue = getFreeBandwidth(); + String freeBandwidthValueAsString = ""; + freeBandwidthValueAsString = freeBandwidthValue.toString(); + sb.append("freeBandwidth=").append(urlEncode(freeBandwidthValueAsString)).append(""); + Object energyFeeValue = getEnergyFee(); + String energyFeeValueAsString = ""; + energyFeeValueAsString = energyFeeValue.toString(); + sb.append("energyFee=").append(urlEncode(energyFeeValueAsString)).append(""); + Object bandwidthFeeValue = getBandwidthFee(); + String bandwidthFeeValueAsString = ""; + bandwidthFeeValueAsString = bandwidthFeeValue.toString(); + sb.append("bandwidthFee=").append(urlEncode(bandwidthFeeValueAsString)).append(""); return sb.toString(); } @@ -125,6 +345,12 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("gasLimit"); + openapiFields.add("energyRequired"); + openapiFields.add("bandwidthRequired"); + openapiFields.add("freeEnergy"); + openapiFields.add("freeBandwidth"); + openapiFields.add("energyFee"); + openapiFields.add("bandwidthFee"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -156,6 +382,55 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("gasLimit").toString())); } + if ((jsonObj.get("energyRequired") != null && !jsonObj.get("energyRequired").isJsonNull()) + && !jsonObj.get("energyRequired").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `energyRequired` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("energyRequired").toString())); + } + if ((jsonObj.get("bandwidthRequired") != null + && !jsonObj.get("bandwidthRequired").isJsonNull()) + && !jsonObj.get("bandwidthRequired").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bandwidthRequired` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bandwidthRequired").toString())); + } + if ((jsonObj.get("freeEnergy") != null && !jsonObj.get("freeEnergy").isJsonNull()) + && !jsonObj.get("freeEnergy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `freeEnergy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("freeEnergy").toString())); + } + if ((jsonObj.get("freeBandwidth") != null && !jsonObj.get("freeBandwidth").isJsonNull()) + && !jsonObj.get("freeBandwidth").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `freeBandwidth` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("freeBandwidth").toString())); + } + if ((jsonObj.get("energyFee") != null && !jsonObj.get("energyFee").isJsonNull()) + && !jsonObj.get("energyFee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `energyFee` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("energyFee").toString())); + } + if ((jsonObj.get("bandwidthFee") != null && !jsonObj.get("bandwidthFee").isJsonNull()) + && !jsonObj.get("bandwidthFee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bandwidthFee` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("bandwidthFee").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponse.java new file mode 100644 index 0000000..ab68584 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponse.java @@ -0,0 +1,345 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetLeaderboardResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetLeaderboardResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetLeaderboardResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetLeaderboardResponse() {} + + public GetLeaderboardResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetLeaderboardResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetLeaderboardResponse data( + @jakarta.annotation.Nullable GetLeaderboardResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetLeaderboardResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetLeaderboardResponseData data) { + this.data = data; + } + + public GetLeaderboardResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetLeaderboardResponse 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; + } + GetLeaderboardResponse getLeaderboardResponse = (GetLeaderboardResponse) o; + return Objects.equals(this.code, getLeaderboardResponse.code) + && Objects.equals(this.msg, getLeaderboardResponse.msg) + && Objects.equals(this.data, getLeaderboardResponse.data) + && Objects.equals(this.timestamp, getLeaderboardResponse.timestamp) + && Objects.equals(this.success, getLeaderboardResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLeaderboardResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 GetLeaderboardResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetLeaderboardResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetLeaderboardResponse is not found in" + + " the empty JSON string", + GetLeaderboardResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetLeaderboardResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLeaderboardResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetLeaderboardResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetLeaderboardResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetLeaderboardResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLeaderboardResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLeaderboardResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetLeaderboardResponse + * @throws IOException if the JSON string is invalid with respect to GetLeaderboardResponse + */ + public static GetLeaderboardResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetLeaderboardResponse.class); + } + + /** + * Convert an instance of GetLeaderboardResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseData.java new file mode 100644 index 0000000..0b0a3a3 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseData.java @@ -0,0 +1,282 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** Paginated leaderboard data. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetLeaderboardResponseData { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + @jakarta.annotation.Nullable + private String cursor; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @jakarta.annotation.Nullable + private List<@Valid GetLeaderboardResponseDataItemsInner> items; + + public GetLeaderboardResponseData() {} + + public GetLeaderboardResponseData cursor(@jakarta.annotation.Nullable String cursor) { + this.cursor = cursor; + return this; + } + + /** + * Pagination cursor for the next page. Empty string when no more data. + * + * @return cursor + */ + @jakarta.annotation.Nullable + public String getCursor() { + return cursor; + } + + public void setCursor(@jakarta.annotation.Nullable String cursor) { + this.cursor = cursor; + } + + public GetLeaderboardResponseData items( + @jakarta.annotation.Nullable List<@Valid GetLeaderboardResponseDataItemsInner> items) { + this.items = items; + return this; + } + + public GetLeaderboardResponseData addItemsItem(GetLeaderboardResponseDataItemsInner itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * List of leaderboard wallet entries. + * + * @return items + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetLeaderboardResponseDataItemsInner> getItems() { + return items; + } + + public void setItems( + @jakarta.annotation.Nullable List<@Valid GetLeaderboardResponseDataItemsInner> items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLeaderboardResponseData getLeaderboardResponseData = (GetLeaderboardResponseData) o; + return Objects.equals(this.cursor, getLeaderboardResponseData.cursor) + && Objects.equals(this.items, getLeaderboardResponseData.items); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLeaderboardResponseData {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object cursorValue = getCursor(); + String cursorValueAsString = ""; + cursorValueAsString = cursorValue.toString(); + sb.append("cursor=").append(urlEncode(cursorValueAsString)).append(""); + Object itemsValue = getItems(); + String itemsValueAsString = ""; + itemsValueAsString = + (String) + ((Collection) itemsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("items=").append(urlEncode(itemsValueAsString)).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("cursor"); + openapiFields.add("items"); + + // 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 GetLeaderboardResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetLeaderboardResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetLeaderboardResponseData is not" + + " found in the empty JSON string", + GetLeaderboardResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + if (jsonObj.get("items") != null && !jsonObj.get("items").isJsonNull()) { + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + if (jsonArrayitems != null) { + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `items` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("items").toString())); + } + + // validate the optional field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + GetLeaderboardResponseDataItemsInner.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLeaderboardResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetLeaderboardResponseData' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetLeaderboardResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetLeaderboardResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLeaderboardResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLeaderboardResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetLeaderboardResponseData + * @throws IOException if the JSON string is invalid with respect to GetLeaderboardResponseData + */ + public static GetLeaderboardResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetLeaderboardResponseData.class); + } + + /** + * Convert an instance of GetLeaderboardResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInner.java new file mode 100644 index 0000000..59fa15f --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInner.java @@ -0,0 +1,1182 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** GetLeaderboardResponseDataItemsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetLeaderboardResponseDataItemsInner { + public static final String SERIALIZED_NAME_WALLET_ADDRESS = "walletAddress"; + + @SerializedName(SERIALIZED_NAME_WALLET_ADDRESS) + @jakarta.annotation.Nullable + private String walletAddress; + + public static final String SERIALIZED_NAME_WALLET_NAME = "walletName"; + + @SerializedName(SERIALIZED_NAME_WALLET_NAME) + @jakarta.annotation.Nullable + private String walletName; + + public static final String SERIALIZED_NAME_WALLET_LOGO_URL = "walletLogoUrl"; + + @SerializedName(SERIALIZED_NAME_WALLET_LOGO_URL) + @jakarta.annotation.Nullable + private String walletLogoUrl; + + public static final String SERIALIZED_NAME_WALLET_TWITTER_URL = "walletTwitterUrl"; + + @SerializedName(SERIALIZED_NAME_WALLET_TWITTER_URL) + @jakarta.annotation.Nullable + private String walletTwitterUrl; + + public static final String SERIALIZED_NAME_WALLET_TYPE = "walletType"; + + @SerializedName(SERIALIZED_NAME_WALLET_TYPE) + @jakarta.annotation.Nullable + private String walletType; + + public static final String SERIALIZED_NAME_NATIVE_TOKEN_BALANCE = "nativeTokenBalance"; + + @SerializedName(SERIALIZED_NAME_NATIVE_TOKEN_BALANCE) + @jakarta.annotation.Nullable + private String nativeTokenBalance; + + public static final String SERIALIZED_NAME_NATIVE_TOKEN_BALANCE_USD = "nativeTokenBalanceUsd"; + + @SerializedName(SERIALIZED_NAME_NATIVE_TOKEN_BALANCE_USD) + @jakarta.annotation.Nullable + private String nativeTokenBalanceUsd; + + public static final String SERIALIZED_NAME_REALIZED_PNL_USD = "realizedPnlUsd"; + + @SerializedName(SERIALIZED_NAME_REALIZED_PNL_USD) + @jakarta.annotation.Nullable + private String realizedPnlUsd; + + public static final String SERIALIZED_NAME_REALIZED_PNL_PERCENT = "realizedPnlPercent"; + + @SerializedName(SERIALIZED_NAME_REALIZED_PNL_PERCENT) + @jakarta.annotation.Nullable + private String realizedPnlPercent; + + public static final String SERIALIZED_NAME_DAILY_PNL = "dailyPnl"; + + @SerializedName(SERIALIZED_NAME_DAILY_PNL) + @jakarta.annotation.Nullable + private List<@Valid GetLeaderboardResponseDataItemsInnerDailyPnlInner> dailyPnl; + + public static final String SERIALIZED_NAME_WIN_RATE_PERCENT = "winRatePercent"; + + @SerializedName(SERIALIZED_NAME_WIN_RATE_PERCENT) + @jakarta.annotation.Nullable + private String winRatePercent; + + public static final String SERIALIZED_NAME_TX_VOLUME = "txVolume"; + + @SerializedName(SERIALIZED_NAME_TX_VOLUME) + @jakarta.annotation.Nullable + private String txVolume; + + public static final String SERIALIZED_NAME_BUY_TX_VOLUME = "buyTxVolume"; + + @SerializedName(SERIALIZED_NAME_BUY_TX_VOLUME) + @jakarta.annotation.Nullable + private String buyTxVolume; + + public static final String SERIALIZED_NAME_SELL_TX_VOLUME = "sellTxVolume"; + + @SerializedName(SERIALIZED_NAME_SELL_TX_VOLUME) + @jakarta.annotation.Nullable + private String sellTxVolume; + + public static final String SERIALIZED_NAME_AVG_BUY_VALUE_USD = "avgBuyValueUsd"; + + @SerializedName(SERIALIZED_NAME_AVG_BUY_VALUE_USD) + @jakarta.annotation.Nullable + private String avgBuyValueUsd; + + public static final String SERIALIZED_NAME_TXS = "txs"; + + @SerializedName(SERIALIZED_NAME_TXS) + @jakarta.annotation.Nullable + private String txs; + + public static final String SERIALIZED_NAME_BUY_TX_COUNT = "buyTxCount"; + + @SerializedName(SERIALIZED_NAME_BUY_TX_COUNT) + @jakarta.annotation.Nullable + private String buyTxCount; + + public static final String SERIALIZED_NAME_SELL_TX_COUNT = "sellTxCount"; + + @SerializedName(SERIALIZED_NAME_SELL_TX_COUNT) + @jakarta.annotation.Nullable + private String sellTxCount; + + public static final String SERIALIZED_NAME_TOP_PNL_TOKEN_LIST = "topPnlTokenList"; + + @SerializedName(SERIALIZED_NAME_TOP_PNL_TOKEN_LIST) + @jakarta.annotation.Nullable + private List<@Valid GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner> topPnlTokenList; + + public static final String SERIALIZED_NAME_TOKEN_COUNT_BY_PNL_PERCENT = + "tokenCountByPnlPercent"; + + @SerializedName(SERIALIZED_NAME_TOKEN_COUNT_BY_PNL_PERCENT) + @jakarta.annotation.Nullable + private GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent tokenCountByPnlPercent; + + public static final String SERIALIZED_NAME_LAST_ACTIVE_TIMESTAMP = "lastActiveTimestamp"; + + @SerializedName(SERIALIZED_NAME_LAST_ACTIVE_TIMESTAMP) + @jakarta.annotation.Nullable + private String lastActiveTimestamp; + + public GetLeaderboardResponseDataItemsInner() {} + + public GetLeaderboardResponseDataItemsInner walletAddress( + @jakarta.annotation.Nullable String walletAddress) { + this.walletAddress = walletAddress; + return this; + } + + /** + * Wallet address. + * + * @return walletAddress + */ + @jakarta.annotation.Nullable + public String getWalletAddress() { + return walletAddress; + } + + public void setWalletAddress(@jakarta.annotation.Nullable String walletAddress) { + this.walletAddress = walletAddress; + } + + public GetLeaderboardResponseDataItemsInner walletName( + @jakarta.annotation.Nullable String walletName) { + this.walletName = walletName; + return this; + } + + /** + * Wallet display name. Empty string when unavailable. + * + * @return walletName + */ + @jakarta.annotation.Nullable + public String getWalletName() { + return walletName; + } + + public void setWalletName(@jakarta.annotation.Nullable String walletName) { + this.walletName = walletName; + } + + public GetLeaderboardResponseDataItemsInner walletLogoUrl( + @jakarta.annotation.Nullable String walletLogoUrl) { + this.walletLogoUrl = walletLogoUrl; + return this; + } + + /** + * Wallet avatar URL. Empty string when unavailable. + * + * @return walletLogoUrl + */ + @jakarta.annotation.Nullable + public String getWalletLogoUrl() { + return walletLogoUrl; + } + + public void setWalletLogoUrl(@jakarta.annotation.Nullable String walletLogoUrl) { + this.walletLogoUrl = walletLogoUrl; + } + + public GetLeaderboardResponseDataItemsInner walletTwitterUrl( + @jakarta.annotation.Nullable String walletTwitterUrl) { + this.walletTwitterUrl = walletTwitterUrl; + return this; + } + + /** + * Associated Twitter/X profile URL. Empty string when unavailable. + * + * @return walletTwitterUrl + */ + @jakarta.annotation.Nullable + public String getWalletTwitterUrl() { + return walletTwitterUrl; + } + + public void setWalletTwitterUrl(@jakarta.annotation.Nullable String walletTwitterUrl) { + this.walletTwitterUrl = walletTwitterUrl; + } + + public GetLeaderboardResponseDataItemsInner walletType( + @jakarta.annotation.Nullable String walletType) { + this.walletType = walletType; + return this; + } + + /** + * Wallet type tags, comma-separated if multiple. 1=Smart Money, 2=KOL, 3=Hot + * List. Empty string when no tag applies. + * + * @return walletType + */ + @jakarta.annotation.Nullable + public String getWalletType() { + return walletType; + } + + public void setWalletType(@jakarta.annotation.Nullable String walletType) { + this.walletType = walletType; + } + + public GetLeaderboardResponseDataItemsInner nativeTokenBalance( + @jakarta.annotation.Nullable String nativeTokenBalance) { + this.nativeTokenBalance = nativeTokenBalance; + return this; + } + + /** + * Native token balance of this address on the queried chain. + * + * @return nativeTokenBalance + */ + @jakarta.annotation.Nullable + public String getNativeTokenBalance() { + return nativeTokenBalance; + } + + public void setNativeTokenBalance(@jakarta.annotation.Nullable String nativeTokenBalance) { + this.nativeTokenBalance = nativeTokenBalance; + } + + public GetLeaderboardResponseDataItemsInner nativeTokenBalanceUsd( + @jakarta.annotation.Nullable String nativeTokenBalanceUsd) { + this.nativeTokenBalanceUsd = nativeTokenBalanceUsd; + return this; + } + + /** + * Native token balance of this address, denominated in USD. + * + * @return nativeTokenBalanceUsd + */ + @jakarta.annotation.Nullable + public String getNativeTokenBalanceUsd() { + return nativeTokenBalanceUsd; + } + + public void setNativeTokenBalanceUsd( + @jakarta.annotation.Nullable String nativeTokenBalanceUsd) { + this.nativeTokenBalanceUsd = nativeTokenBalanceUsd; + } + + public GetLeaderboardResponseDataItemsInner realizedPnlUsd( + @jakarta.annotation.Nullable String realizedPnlUsd) { + this.realizedPnlUsd = realizedPnlUsd; + return this; + } + + /** + * Cumulative realized PnL within the time frame, denominated in USD. Positive means profit, + * negative means loss. + * + * @return realizedPnlUsd + */ + @jakarta.annotation.Nullable + public String getRealizedPnlUsd() { + return realizedPnlUsd; + } + + public void setRealizedPnlUsd(@jakarta.annotation.Nullable String realizedPnlUsd) { + this.realizedPnlUsd = realizedPnlUsd; + } + + public GetLeaderboardResponseDataItemsInner realizedPnlPercent( + @jakarta.annotation.Nullable String realizedPnlPercent) { + this.realizedPnlPercent = realizedPnlPercent; + return this; + } + + /** + * Realized PnL percentage within the time frame. No percent sign included. + * + * @return realizedPnlPercent + */ + @jakarta.annotation.Nullable + public String getRealizedPnlPercent() { + return realizedPnlPercent; + } + + public void setRealizedPnlPercent(@jakarta.annotation.Nullable String realizedPnlPercent) { + this.realizedPnlPercent = realizedPnlPercent; + } + + public GetLeaderboardResponseDataItemsInner dailyPnl( + @jakarta.annotation.Nullable + List<@Valid GetLeaderboardResponseDataItemsInnerDailyPnlInner> dailyPnl) { + this.dailyPnl = dailyPnl; + return this; + } + + public GetLeaderboardResponseDataItemsInner addDailyPnlItem( + GetLeaderboardResponseDataItemsInnerDailyPnlInner dailyPnlItem) { + if (this.dailyPnl == null) { + this.dailyPnl = new ArrayList<>(); + } + this.dailyPnl.add(dailyPnlItem); + return this; + } + + /** + * Daily realized PnL within the selected time frame, sorted by date descending. + * + * @return dailyPnl + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetLeaderboardResponseDataItemsInnerDailyPnlInner> getDailyPnl() { + return dailyPnl; + } + + public void setDailyPnl( + @jakarta.annotation.Nullable + List<@Valid GetLeaderboardResponseDataItemsInnerDailyPnlInner> dailyPnl) { + this.dailyPnl = dailyPnl; + } + + public GetLeaderboardResponseDataItemsInner winRatePercent( + @jakarta.annotation.Nullable String winRatePercent) { + this.winRatePercent = winRatePercent; + return this; + } + + /** + * Win rate within the time frame. No percent sign included. + * + * @return winRatePercent + */ + @jakarta.annotation.Nullable + public String getWinRatePercent() { + return winRatePercent; + } + + public void setWinRatePercent(@jakarta.annotation.Nullable String winRatePercent) { + this.winRatePercent = winRatePercent; + } + + public GetLeaderboardResponseDataItemsInner txVolume( + @jakarta.annotation.Nullable String txVolume) { + this.txVolume = txVolume; + return this; + } + + /** + * Total transaction volume within the time frame, denominated in USD. Equals buyTxVolume + + * sellTxVolume. + * + * @return txVolume + */ + @jakarta.annotation.Nullable + public String getTxVolume() { + return txVolume; + } + + public void setTxVolume(@jakarta.annotation.Nullable String txVolume) { + this.txVolume = txVolume; + } + + public GetLeaderboardResponseDataItemsInner buyTxVolume( + @jakarta.annotation.Nullable String buyTxVolume) { + this.buyTxVolume = buyTxVolume; + return this; + } + + /** + * Total buy volume within the time frame, denominated in USD. + * + * @return buyTxVolume + */ + @jakarta.annotation.Nullable + public String getBuyTxVolume() { + return buyTxVolume; + } + + public void setBuyTxVolume(@jakarta.annotation.Nullable String buyTxVolume) { + this.buyTxVolume = buyTxVolume; + } + + public GetLeaderboardResponseDataItemsInner sellTxVolume( + @jakarta.annotation.Nullable String sellTxVolume) { + this.sellTxVolume = sellTxVolume; + return this; + } + + /** + * Total sell volume within the time frame, denominated in USD. + * + * @return sellTxVolume + */ + @jakarta.annotation.Nullable + public String getSellTxVolume() { + return sellTxVolume; + } + + public void setSellTxVolume(@jakarta.annotation.Nullable String sellTxVolume) { + this.sellTxVolume = sellTxVolume; + } + + public GetLeaderboardResponseDataItemsInner avgBuyValueUsd( + @jakarta.annotation.Nullable String avgBuyValueUsd) { + this.avgBuyValueUsd = avgBuyValueUsd; + return this; + } + + /** + * Average buy value per transaction within the time frame, denominated in USD. Returns + * \"0\" when no buy transactions. + * + * @return avgBuyValueUsd + */ + @jakarta.annotation.Nullable + public String getAvgBuyValueUsd() { + return avgBuyValueUsd; + } + + public void setAvgBuyValueUsd(@jakarta.annotation.Nullable String avgBuyValueUsd) { + this.avgBuyValueUsd = avgBuyValueUsd; + } + + public GetLeaderboardResponseDataItemsInner txs(@jakarta.annotation.Nullable String txs) { + this.txs = txs; + return this; + } + + /** + * Total transaction count within the time frame. Equals buyTxCount + sellTxCount. + * + * @return txs + */ + @jakarta.annotation.Nullable + public String getTxs() { + return txs; + } + + public void setTxs(@jakarta.annotation.Nullable String txs) { + this.txs = txs; + } + + public GetLeaderboardResponseDataItemsInner buyTxCount( + @jakarta.annotation.Nullable String buyTxCount) { + this.buyTxCount = buyTxCount; + return this; + } + + /** + * Buy transaction count within the time frame. + * + * @return buyTxCount + */ + @jakarta.annotation.Nullable + public String getBuyTxCount() { + return buyTxCount; + } + + public void setBuyTxCount(@jakarta.annotation.Nullable String buyTxCount) { + this.buyTxCount = buyTxCount; + } + + public GetLeaderboardResponseDataItemsInner sellTxCount( + @jakarta.annotation.Nullable String sellTxCount) { + this.sellTxCount = sellTxCount; + return this; + } + + /** + * Sell transaction count within the time frame. + * + * @return sellTxCount + */ + @jakarta.annotation.Nullable + public String getSellTxCount() { + return sellTxCount; + } + + public void setSellTxCount(@jakarta.annotation.Nullable String sellTxCount) { + this.sellTxCount = sellTxCount; + } + + public GetLeaderboardResponseDataItemsInner topPnlTokenList( + @jakarta.annotation.Nullable + List<@Valid GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner> + topPnlTokenList) { + this.topPnlTokenList = topPnlTokenList; + return this; + } + + public GetLeaderboardResponseDataItemsInner addTopPnlTokenListItem( + GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner topPnlTokenListItem) { + if (this.topPnlTokenList == null) { + this.topPnlTokenList = new ArrayList<>(); + } + this.topPnlTokenList.add(topPnlTokenListItem); + return this; + } + + /** + * Top 3 tokens by realized PnL. Returns fewer items if fewer than 3 tokens were traded. + * + * @return topPnlTokenList + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner> + getTopPnlTokenList() { + return topPnlTokenList; + } + + public void setTopPnlTokenList( + @jakarta.annotation.Nullable + List<@Valid GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner> + topPnlTokenList) { + this.topPnlTokenList = topPnlTokenList; + } + + public GetLeaderboardResponseDataItemsInner tokenCountByPnlPercent( + @jakarta.annotation.Nullable + GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + tokenCountByPnlPercent) { + this.tokenCountByPnlPercent = tokenCountByPnlPercent; + return this; + } + + /** + * Get tokenCountByPnlPercent + * + * @return tokenCountByPnlPercent + */ + @jakarta.annotation.Nullable + @Valid + public GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent getTokenCountByPnlPercent() { + return tokenCountByPnlPercent; + } + + public void setTokenCountByPnlPercent( + @jakarta.annotation.Nullable + GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + tokenCountByPnlPercent) { + this.tokenCountByPnlPercent = tokenCountByPnlPercent; + } + + public GetLeaderboardResponseDataItemsInner lastActiveTimestamp( + @jakarta.annotation.Nullable String lastActiveTimestamp) { + this.lastActiveTimestamp = lastActiveTimestamp; + return this; + } + + /** + * Timestamp of the address's last trade, Unix millisecond timestamp. + * + * @return lastActiveTimestamp + */ + @jakarta.annotation.Nullable + public String getLastActiveTimestamp() { + return lastActiveTimestamp; + } + + public void setLastActiveTimestamp(@jakarta.annotation.Nullable String lastActiveTimestamp) { + this.lastActiveTimestamp = lastActiveTimestamp; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLeaderboardResponseDataItemsInner getLeaderboardResponseDataItemsInner = + (GetLeaderboardResponseDataItemsInner) o; + return Objects.equals( + this.walletAddress, getLeaderboardResponseDataItemsInner.walletAddress) + && Objects.equals(this.walletName, getLeaderboardResponseDataItemsInner.walletName) + && Objects.equals( + this.walletLogoUrl, getLeaderboardResponseDataItemsInner.walletLogoUrl) + && Objects.equals( + this.walletTwitterUrl, + getLeaderboardResponseDataItemsInner.walletTwitterUrl) + && Objects.equals(this.walletType, getLeaderboardResponseDataItemsInner.walletType) + && Objects.equals( + this.nativeTokenBalance, + getLeaderboardResponseDataItemsInner.nativeTokenBalance) + && Objects.equals( + this.nativeTokenBalanceUsd, + getLeaderboardResponseDataItemsInner.nativeTokenBalanceUsd) + && Objects.equals( + this.realizedPnlUsd, getLeaderboardResponseDataItemsInner.realizedPnlUsd) + && Objects.equals( + this.realizedPnlPercent, + getLeaderboardResponseDataItemsInner.realizedPnlPercent) + && Objects.equals(this.dailyPnl, getLeaderboardResponseDataItemsInner.dailyPnl) + && Objects.equals( + this.winRatePercent, getLeaderboardResponseDataItemsInner.winRatePercent) + && Objects.equals(this.txVolume, getLeaderboardResponseDataItemsInner.txVolume) + && Objects.equals( + this.buyTxVolume, getLeaderboardResponseDataItemsInner.buyTxVolume) + && Objects.equals( + this.sellTxVolume, getLeaderboardResponseDataItemsInner.sellTxVolume) + && Objects.equals( + this.avgBuyValueUsd, getLeaderboardResponseDataItemsInner.avgBuyValueUsd) + && Objects.equals(this.txs, getLeaderboardResponseDataItemsInner.txs) + && Objects.equals(this.buyTxCount, getLeaderboardResponseDataItemsInner.buyTxCount) + && Objects.equals( + this.sellTxCount, getLeaderboardResponseDataItemsInner.sellTxCount) + && Objects.equals( + this.topPnlTokenList, getLeaderboardResponseDataItemsInner.topPnlTokenList) + && Objects.equals( + this.tokenCountByPnlPercent, + getLeaderboardResponseDataItemsInner.tokenCountByPnlPercent) + && Objects.equals( + this.lastActiveTimestamp, + getLeaderboardResponseDataItemsInner.lastActiveTimestamp); + } + + @Override + public int hashCode() { + return Objects.hash( + walletAddress, + walletName, + walletLogoUrl, + walletTwitterUrl, + walletType, + nativeTokenBalance, + nativeTokenBalanceUsd, + realizedPnlUsd, + realizedPnlPercent, + dailyPnl, + winRatePercent, + txVolume, + buyTxVolume, + sellTxVolume, + avgBuyValueUsd, + txs, + buyTxCount, + sellTxCount, + topPnlTokenList, + tokenCountByPnlPercent, + lastActiveTimestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLeaderboardResponseDataItemsInner {\n"); + sb.append(" walletAddress: ").append(toIndentedString(walletAddress)).append("\n"); + sb.append(" walletName: ").append(toIndentedString(walletName)).append("\n"); + sb.append(" walletLogoUrl: ").append(toIndentedString(walletLogoUrl)).append("\n"); + sb.append(" walletTwitterUrl: ").append(toIndentedString(walletTwitterUrl)).append("\n"); + sb.append(" walletType: ").append(toIndentedString(walletType)).append("\n"); + sb.append(" nativeTokenBalance: ") + .append(toIndentedString(nativeTokenBalance)) + .append("\n"); + sb.append(" nativeTokenBalanceUsd: ") + .append(toIndentedString(nativeTokenBalanceUsd)) + .append("\n"); + sb.append(" realizedPnlUsd: ").append(toIndentedString(realizedPnlUsd)).append("\n"); + sb.append(" realizedPnlPercent: ") + .append(toIndentedString(realizedPnlPercent)) + .append("\n"); + sb.append(" dailyPnl: ").append(toIndentedString(dailyPnl)).append("\n"); + sb.append(" winRatePercent: ").append(toIndentedString(winRatePercent)).append("\n"); + sb.append(" txVolume: ").append(toIndentedString(txVolume)).append("\n"); + sb.append(" buyTxVolume: ").append(toIndentedString(buyTxVolume)).append("\n"); + sb.append(" sellTxVolume: ").append(toIndentedString(sellTxVolume)).append("\n"); + sb.append(" avgBuyValueUsd: ").append(toIndentedString(avgBuyValueUsd)).append("\n"); + sb.append(" txs: ").append(toIndentedString(txs)).append("\n"); + sb.append(" buyTxCount: ").append(toIndentedString(buyTxCount)).append("\n"); + sb.append(" sellTxCount: ").append(toIndentedString(sellTxCount)).append("\n"); + sb.append(" topPnlTokenList: ").append(toIndentedString(topPnlTokenList)).append("\n"); + sb.append(" tokenCountByPnlPercent: ") + .append(toIndentedString(tokenCountByPnlPercent)) + .append("\n"); + sb.append(" lastActiveTimestamp: ") + .append(toIndentedString(lastActiveTimestamp)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object walletAddressValue = getWalletAddress(); + String walletAddressValueAsString = ""; + walletAddressValueAsString = walletAddressValue.toString(); + sb.append("walletAddress=").append(urlEncode(walletAddressValueAsString)).append(""); + Object walletNameValue = getWalletName(); + String walletNameValueAsString = ""; + walletNameValueAsString = walletNameValue.toString(); + sb.append("walletName=").append(urlEncode(walletNameValueAsString)).append(""); + Object walletLogoUrlValue = getWalletLogoUrl(); + String walletLogoUrlValueAsString = ""; + walletLogoUrlValueAsString = walletLogoUrlValue.toString(); + sb.append("walletLogoUrl=").append(urlEncode(walletLogoUrlValueAsString)).append(""); + Object walletTwitterUrlValue = getWalletTwitterUrl(); + String walletTwitterUrlValueAsString = ""; + walletTwitterUrlValueAsString = walletTwitterUrlValue.toString(); + sb.append("walletTwitterUrl=").append(urlEncode(walletTwitterUrlValueAsString)).append(""); + Object walletTypeValue = getWalletType(); + String walletTypeValueAsString = ""; + walletTypeValueAsString = walletTypeValue.toString(); + sb.append("walletType=").append(urlEncode(walletTypeValueAsString)).append(""); + Object nativeTokenBalanceValue = getNativeTokenBalance(); + String nativeTokenBalanceValueAsString = ""; + nativeTokenBalanceValueAsString = nativeTokenBalanceValue.toString(); + sb.append("nativeTokenBalance=") + .append(urlEncode(nativeTokenBalanceValueAsString)) + .append(""); + Object nativeTokenBalanceUsdValue = getNativeTokenBalanceUsd(); + String nativeTokenBalanceUsdValueAsString = ""; + nativeTokenBalanceUsdValueAsString = nativeTokenBalanceUsdValue.toString(); + sb.append("nativeTokenBalanceUsd=") + .append(urlEncode(nativeTokenBalanceUsdValueAsString)) + .append(""); + Object realizedPnlUsdValue = getRealizedPnlUsd(); + String realizedPnlUsdValueAsString = ""; + realizedPnlUsdValueAsString = realizedPnlUsdValue.toString(); + sb.append("realizedPnlUsd=").append(urlEncode(realizedPnlUsdValueAsString)).append(""); + Object realizedPnlPercentValue = getRealizedPnlPercent(); + String realizedPnlPercentValueAsString = ""; + realizedPnlPercentValueAsString = realizedPnlPercentValue.toString(); + sb.append("realizedPnlPercent=") + .append(urlEncode(realizedPnlPercentValueAsString)) + .append(""); + Object dailyPnlValue = getDailyPnl(); + String dailyPnlValueAsString = ""; + dailyPnlValueAsString = + (String) + ((Collection) dailyPnlValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("dailyPnl=").append(urlEncode(dailyPnlValueAsString)).append(""); + Object winRatePercentValue = getWinRatePercent(); + String winRatePercentValueAsString = ""; + winRatePercentValueAsString = winRatePercentValue.toString(); + sb.append("winRatePercent=").append(urlEncode(winRatePercentValueAsString)).append(""); + Object txVolumeValue = getTxVolume(); + String txVolumeValueAsString = ""; + txVolumeValueAsString = txVolumeValue.toString(); + sb.append("txVolume=").append(urlEncode(txVolumeValueAsString)).append(""); + Object buyTxVolumeValue = getBuyTxVolume(); + String buyTxVolumeValueAsString = ""; + buyTxVolumeValueAsString = buyTxVolumeValue.toString(); + sb.append("buyTxVolume=").append(urlEncode(buyTxVolumeValueAsString)).append(""); + Object sellTxVolumeValue = getSellTxVolume(); + String sellTxVolumeValueAsString = ""; + sellTxVolumeValueAsString = sellTxVolumeValue.toString(); + sb.append("sellTxVolume=").append(urlEncode(sellTxVolumeValueAsString)).append(""); + Object avgBuyValueUsdValue = getAvgBuyValueUsd(); + String avgBuyValueUsdValueAsString = ""; + avgBuyValueUsdValueAsString = avgBuyValueUsdValue.toString(); + sb.append("avgBuyValueUsd=").append(urlEncode(avgBuyValueUsdValueAsString)).append(""); + Object txsValue = getTxs(); + String txsValueAsString = ""; + txsValueAsString = txsValue.toString(); + sb.append("txs=").append(urlEncode(txsValueAsString)).append(""); + Object buyTxCountValue = getBuyTxCount(); + String buyTxCountValueAsString = ""; + buyTxCountValueAsString = buyTxCountValue.toString(); + sb.append("buyTxCount=").append(urlEncode(buyTxCountValueAsString)).append(""); + Object sellTxCountValue = getSellTxCount(); + String sellTxCountValueAsString = ""; + sellTxCountValueAsString = sellTxCountValue.toString(); + sb.append("sellTxCount=").append(urlEncode(sellTxCountValueAsString)).append(""); + Object topPnlTokenListValue = getTopPnlTokenList(); + String topPnlTokenListValueAsString = ""; + topPnlTokenListValueAsString = + (String) + ((Collection) topPnlTokenListValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("topPnlTokenList=").append(urlEncode(topPnlTokenListValueAsString)).append(""); + Object tokenCountByPnlPercentValue = getTokenCountByPnlPercent(); + String tokenCountByPnlPercentValueAsString = ""; + tokenCountByPnlPercentValueAsString = tokenCountByPnlPercentValue.toString(); + sb.append("tokenCountByPnlPercent=") + .append(urlEncode(tokenCountByPnlPercentValueAsString)) + .append(""); + Object lastActiveTimestampValue = getLastActiveTimestamp(); + String lastActiveTimestampValueAsString = ""; + lastActiveTimestampValueAsString = lastActiveTimestampValue.toString(); + sb.append("lastActiveTimestamp=") + .append(urlEncode(lastActiveTimestampValueAsString)) + .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("walletAddress"); + openapiFields.add("walletName"); + openapiFields.add("walletLogoUrl"); + openapiFields.add("walletTwitterUrl"); + openapiFields.add("walletType"); + openapiFields.add("nativeTokenBalance"); + openapiFields.add("nativeTokenBalanceUsd"); + openapiFields.add("realizedPnlUsd"); + openapiFields.add("realizedPnlPercent"); + openapiFields.add("dailyPnl"); + openapiFields.add("winRatePercent"); + openapiFields.add("txVolume"); + openapiFields.add("buyTxVolume"); + openapiFields.add("sellTxVolume"); + openapiFields.add("avgBuyValueUsd"); + openapiFields.add("txs"); + openapiFields.add("buyTxCount"); + openapiFields.add("sellTxCount"); + openapiFields.add("topPnlTokenList"); + openapiFields.add("tokenCountByPnlPercent"); + openapiFields.add("lastActiveTimestamp"); + + // 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 + * GetLeaderboardResponseDataItemsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetLeaderboardResponseDataItemsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetLeaderboardResponseDataItemsInner" + + " is not found in the empty JSON string", + GetLeaderboardResponseDataItemsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("walletAddress") != null && !jsonObj.get("walletAddress").isJsonNull()) + && !jsonObj.get("walletAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `walletAddress` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("walletAddress").toString())); + } + if ((jsonObj.get("walletName") != null && !jsonObj.get("walletName").isJsonNull()) + && !jsonObj.get("walletName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `walletName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("walletName").toString())); + } + if ((jsonObj.get("walletLogoUrl") != null && !jsonObj.get("walletLogoUrl").isJsonNull()) + && !jsonObj.get("walletLogoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `walletLogoUrl` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("walletLogoUrl").toString())); + } + if ((jsonObj.get("walletTwitterUrl") != null + && !jsonObj.get("walletTwitterUrl").isJsonNull()) + && !jsonObj.get("walletTwitterUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `walletTwitterUrl` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("walletTwitterUrl").toString())); + } + if ((jsonObj.get("walletType") != null && !jsonObj.get("walletType").isJsonNull()) + && !jsonObj.get("walletType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `walletType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("walletType").toString())); + } + if ((jsonObj.get("nativeTokenBalance") != null + && !jsonObj.get("nativeTokenBalance").isJsonNull()) + && !jsonObj.get("nativeTokenBalance").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nativeTokenBalance` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("nativeTokenBalance").toString())); + } + if ((jsonObj.get("nativeTokenBalanceUsd") != null + && !jsonObj.get("nativeTokenBalanceUsd").isJsonNull()) + && !jsonObj.get("nativeTokenBalanceUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nativeTokenBalanceUsd` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("nativeTokenBalanceUsd").toString())); + } + if ((jsonObj.get("realizedPnlUsd") != null && !jsonObj.get("realizedPnlUsd").isJsonNull()) + && !jsonObj.get("realizedPnlUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `realizedPnlUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("realizedPnlUsd").toString())); + } + if ((jsonObj.get("realizedPnlPercent") != null + && !jsonObj.get("realizedPnlPercent").isJsonNull()) + && !jsonObj.get("realizedPnlPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `realizedPnlPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("realizedPnlPercent").toString())); + } + if (jsonObj.get("dailyPnl") != null && !jsonObj.get("dailyPnl").isJsonNull()) { + JsonArray jsonArraydailyPnl = jsonObj.getAsJsonArray("dailyPnl"); + if (jsonArraydailyPnl != null) { + // ensure the json data is an array + if (!jsonObj.get("dailyPnl").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dailyPnl` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("dailyPnl").toString())); + } + + // validate the optional field `dailyPnl` (array) + for (int i = 0; i < jsonArraydailyPnl.size(); i++) { + GetLeaderboardResponseDataItemsInnerDailyPnlInner.validateJsonElement( + jsonArraydailyPnl.get(i)); + } + ; + } + } + if ((jsonObj.get("winRatePercent") != null && !jsonObj.get("winRatePercent").isJsonNull()) + && !jsonObj.get("winRatePercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `winRatePercent` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("winRatePercent").toString())); + } + if ((jsonObj.get("txVolume") != null && !jsonObj.get("txVolume").isJsonNull()) + && !jsonObj.get("txVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("txVolume").toString())); + } + if ((jsonObj.get("buyTxVolume") != null && !jsonObj.get("buyTxVolume").isJsonNull()) + && !jsonObj.get("buyTxVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyTxVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyTxVolume").toString())); + } + if ((jsonObj.get("sellTxVolume") != null && !jsonObj.get("sellTxVolume").isJsonNull()) + && !jsonObj.get("sellTxVolume").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellTxVolume` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellTxVolume").toString())); + } + if ((jsonObj.get("avgBuyValueUsd") != null && !jsonObj.get("avgBuyValueUsd").isJsonNull()) + && !jsonObj.get("avgBuyValueUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `avgBuyValueUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("avgBuyValueUsd").toString())); + } + if ((jsonObj.get("txs") != null && !jsonObj.get("txs").isJsonNull()) + && !jsonObj.get("txs").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txs` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("txs").toString())); + } + if ((jsonObj.get("buyTxCount") != null && !jsonObj.get("buyTxCount").isJsonNull()) + && !jsonObj.get("buyTxCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `buyTxCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("buyTxCount").toString())); + } + if ((jsonObj.get("sellTxCount") != null && !jsonObj.get("sellTxCount").isJsonNull()) + && !jsonObj.get("sellTxCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sellTxCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sellTxCount").toString())); + } + if (jsonObj.get("topPnlTokenList") != null + && !jsonObj.get("topPnlTokenList").isJsonNull()) { + JsonArray jsonArraytopPnlTokenList = jsonObj.getAsJsonArray("topPnlTokenList"); + if (jsonArraytopPnlTokenList != null) { + // ensure the json data is an array + if (!jsonObj.get("topPnlTokenList").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `topPnlTokenList` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("topPnlTokenList").toString())); + } + + // validate the optional field `topPnlTokenList` (array) + for (int i = 0; i < jsonArraytopPnlTokenList.size(); i++) { + GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.validateJsonElement( + jsonArraytopPnlTokenList.get(i)); + } + ; + } + } + // validate the optional field `tokenCountByPnlPercent` + if (jsonObj.get("tokenCountByPnlPercent") != null + && !jsonObj.get("tokenCountByPnlPercent").isJsonNull()) { + GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.validateJsonElement( + jsonObj.get("tokenCountByPnlPercent")); + } + if ((jsonObj.get("lastActiveTimestamp") != null + && !jsonObj.get("lastActiveTimestamp").isJsonNull()) + && !jsonObj.get("lastActiveTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `lastActiveTimestamp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("lastActiveTimestamp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLeaderboardResponseDataItemsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetLeaderboardResponseDataItemsInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetLeaderboardResponseDataItemsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetLeaderboardResponseDataItemsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLeaderboardResponseDataItemsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLeaderboardResponseDataItemsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetLeaderboardResponseDataItemsInner + * @throws IOException if the JSON string is invalid with respect to + * GetLeaderboardResponseDataItemsInner + */ + public static GetLeaderboardResponseDataItemsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetLeaderboardResponseDataItemsInner.class); + } + + /** + * Convert an instance of GetLeaderboardResponseDataItemsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerDailyPnlInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerDailyPnlInner.java new file mode 100644 index 0000000..061b8c4 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerDailyPnlInner.java @@ -0,0 +1,269 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetLeaderboardResponseDataItemsInnerDailyPnlInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetLeaderboardResponseDataItemsInnerDailyPnlInner { + public static final String SERIALIZED_NAME_DATE = "date"; + + @SerializedName(SERIALIZED_NAME_DATE) + @jakarta.annotation.Nullable + private String date; + + public static final String SERIALIZED_NAME_PNL_USD = "pnlUsd"; + + @SerializedName(SERIALIZED_NAME_PNL_USD) + @jakarta.annotation.Nullable + private String pnlUsd; + + public GetLeaderboardResponseDataItemsInnerDailyPnlInner() {} + + public GetLeaderboardResponseDataItemsInnerDailyPnlInner date( + @jakarta.annotation.Nullable String date) { + this.date = date; + return this; + } + + /** + * Date in YYYY-MM-DD format. + * + * @return date + */ + @jakarta.annotation.Nullable + public String getDate() { + return date; + } + + public void setDate(@jakarta.annotation.Nullable String date) { + this.date = date; + } + + public GetLeaderboardResponseDataItemsInnerDailyPnlInner pnlUsd( + @jakarta.annotation.Nullable String pnlUsd) { + this.pnlUsd = pnlUsd; + return this; + } + + /** + * Realized PnL for this day, denominated in USD. + * + * @return pnlUsd + */ + @jakarta.annotation.Nullable + public String getPnlUsd() { + return pnlUsd; + } + + public void setPnlUsd(@jakarta.annotation.Nullable String pnlUsd) { + this.pnlUsd = pnlUsd; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLeaderboardResponseDataItemsInnerDailyPnlInner + getLeaderboardResponseDataItemsInnerDailyPnlInner = + (GetLeaderboardResponseDataItemsInnerDailyPnlInner) o; + return Objects.equals(this.date, getLeaderboardResponseDataItemsInnerDailyPnlInner.date) + && Objects.equals( + this.pnlUsd, getLeaderboardResponseDataItemsInnerDailyPnlInner.pnlUsd); + } + + @Override + public int hashCode() { + return Objects.hash(date, pnlUsd); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLeaderboardResponseDataItemsInnerDailyPnlInner {\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" pnlUsd: ").append(toIndentedString(pnlUsd)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object dateValue = getDate(); + String dateValueAsString = ""; + dateValueAsString = dateValue.toString(); + sb.append("date=").append(urlEncode(dateValueAsString)).append(""); + Object pnlUsdValue = getPnlUsd(); + String pnlUsdValueAsString = ""; + pnlUsdValueAsString = pnlUsdValue.toString(); + sb.append("pnlUsd=").append(urlEncode(pnlUsdValueAsString)).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("date"); + openapiFields.add("pnlUsd"); + + // 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 + * GetLeaderboardResponseDataItemsInnerDailyPnlInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetLeaderboardResponseDataItemsInnerDailyPnlInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetLeaderboardResponseDataItemsInnerDailyPnlInner is not" + + " found in the empty JSON string", + GetLeaderboardResponseDataItemsInnerDailyPnlInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("date") != null && !jsonObj.get("date").isJsonNull()) + && !jsonObj.get("date").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `date` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("date").toString())); + } + if ((jsonObj.get("pnlUsd") != null && !jsonObj.get("pnlUsd").isJsonNull()) + && !jsonObj.get("pnlUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pnlUsd` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("pnlUsd").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLeaderboardResponseDataItemsInnerDailyPnlInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetLeaderboardResponseDataItemsInnerDailyPnlInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetLeaderboardResponseDataItemsInnerDailyPnlInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetLeaderboardResponseDataItemsInnerDailyPnlInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLeaderboardResponseDataItemsInnerDailyPnlInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLeaderboardResponseDataItemsInnerDailyPnlInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetLeaderboardResponseDataItemsInnerDailyPnlInner + * @throws IOException if the JSON string is invalid with respect to + * GetLeaderboardResponseDataItemsInnerDailyPnlInner + */ + public static GetLeaderboardResponseDataItemsInnerDailyPnlInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetLeaderboardResponseDataItemsInnerDailyPnlInner.class); + } + + /** + * Convert an instance of GetLeaderboardResponseDataItemsInnerDailyPnlInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.java new file mode 100644 index 0000000..b6278c8 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.java @@ -0,0 +1,386 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Token count breakdown by realized PnL percentage range within the time frame. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent { + public static final String SERIALIZED_NAME_ABOVE500_PERCENT = "above500Percent"; + + @SerializedName(SERIALIZED_NAME_ABOVE500_PERCENT) + @jakarta.annotation.Nullable + private String above500Percent; + + public static final String SERIALIZED_NAME_BETWEEN0_AND500_PERCENT = "between0And500Percent"; + + @SerializedName(SERIALIZED_NAME_BETWEEN0_AND500_PERCENT) + @jakarta.annotation.Nullable + private String between0And500Percent; + + public static final String SERIALIZED_NAME_BETWEEN_NEG50_AND0_PERCENT = + "betweenNeg50And0Percent"; + + @SerializedName(SERIALIZED_NAME_BETWEEN_NEG50_AND0_PERCENT) + @jakarta.annotation.Nullable + private String betweenNeg50And0Percent; + + public static final String SERIALIZED_NAME_BELOW_NEG50_PERCENT = "belowNeg50Percent"; + + @SerializedName(SERIALIZED_NAME_BELOW_NEG50_PERCENT) + @jakarta.annotation.Nullable + private String belowNeg50Percent; + + public GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent() {} + + public GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent above500Percent( + @jakarta.annotation.Nullable String above500Percent) { + this.above500Percent = above500Percent; + return this; + } + + /** + * Number of tokens with realized PnL >500%. + * + * @return above500Percent + */ + @jakarta.annotation.Nullable + public String getAbove500Percent() { + return above500Percent; + } + + public void setAbove500Percent(@jakarta.annotation.Nullable String above500Percent) { + this.above500Percent = above500Percent; + } + + public GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent between0And500Percent( + @jakarta.annotation.Nullable String between0And500Percent) { + this.between0And500Percent = between0And500Percent; + return this; + } + + /** + * Number of tokens with realized PnL in [0%, 500%]. + * + * @return between0And500Percent + */ + @jakarta.annotation.Nullable + public String getBetween0And500Percent() { + return between0And500Percent; + } + + public void setBetween0And500Percent( + @jakarta.annotation.Nullable String between0And500Percent) { + this.between0And500Percent = between0And500Percent; + } + + public GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent betweenNeg50And0Percent( + @jakarta.annotation.Nullable String betweenNeg50And0Percent) { + this.betweenNeg50And0Percent = betweenNeg50And0Percent; + return this; + } + + /** + * Number of tokens with realized PnL in [-50%, 0%]. + * + * @return betweenNeg50And0Percent + */ + @jakarta.annotation.Nullable + public String getBetweenNeg50And0Percent() { + return betweenNeg50And0Percent; + } + + public void setBetweenNeg50And0Percent( + @jakarta.annotation.Nullable String betweenNeg50And0Percent) { + this.betweenNeg50And0Percent = betweenNeg50And0Percent; + } + + public GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent belowNeg50Percent( + @jakarta.annotation.Nullable String belowNeg50Percent) { + this.belowNeg50Percent = belowNeg50Percent; + return this; + } + + /** + * Number of tokens with realized PnL < -50%. + * + * @return belowNeg50Percent + */ + @jakarta.annotation.Nullable + public String getBelowNeg50Percent() { + return belowNeg50Percent; + } + + public void setBelowNeg50Percent(@jakarta.annotation.Nullable String belowNeg50Percent) { + this.belowNeg50Percent = belowNeg50Percent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + getLeaderboardResponseDataItemsInnerTokenCountByPnlPercent = + (GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent) o; + return Objects.equals( + this.above500Percent, + getLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.above500Percent) + && Objects.equals( + this.between0And500Percent, + getLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + .between0And500Percent) + && Objects.equals( + this.betweenNeg50And0Percent, + getLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + .betweenNeg50And0Percent) + && Objects.equals( + this.belowNeg50Percent, + getLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + .belowNeg50Percent); + } + + @Override + public int hashCode() { + return Objects.hash( + above500Percent, between0And500Percent, betweenNeg50And0Percent, belowNeg50Percent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent {\n"); + sb.append(" above500Percent: ").append(toIndentedString(above500Percent)).append("\n"); + sb.append(" between0And500Percent: ") + .append(toIndentedString(between0And500Percent)) + .append("\n"); + sb.append(" betweenNeg50And0Percent: ") + .append(toIndentedString(betweenNeg50And0Percent)) + .append("\n"); + sb.append(" belowNeg50Percent: ").append(toIndentedString(belowNeg50Percent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object above500PercentValue = getAbove500Percent(); + String above500PercentValueAsString = ""; + above500PercentValueAsString = above500PercentValue.toString(); + sb.append("above500Percent=").append(urlEncode(above500PercentValueAsString)).append(""); + Object between0And500PercentValue = getBetween0And500Percent(); + String between0And500PercentValueAsString = ""; + between0And500PercentValueAsString = between0And500PercentValue.toString(); + sb.append("between0And500Percent=") + .append(urlEncode(between0And500PercentValueAsString)) + .append(""); + Object betweenNeg50And0PercentValue = getBetweenNeg50And0Percent(); + String betweenNeg50And0PercentValueAsString = ""; + betweenNeg50And0PercentValueAsString = betweenNeg50And0PercentValue.toString(); + sb.append("betweenNeg50And0Percent=") + .append(urlEncode(betweenNeg50And0PercentValueAsString)) + .append(""); + Object belowNeg50PercentValue = getBelowNeg50Percent(); + String belowNeg50PercentValueAsString = ""; + belowNeg50PercentValueAsString = belowNeg50PercentValue.toString(); + sb.append("belowNeg50Percent=") + .append(urlEncode(belowNeg50PercentValueAsString)) + .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("above500Percent"); + openapiFields.add("between0And500Percent"); + openapiFields.add("betweenNeg50And0Percent"); + openapiFields.add("belowNeg50Percent"); + + // 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 + * GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent" + + " is not found in the empty JSON string", + GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("above500Percent") != null && !jsonObj.get("above500Percent").isJsonNull()) + && !jsonObj.get("above500Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `above500Percent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("above500Percent").toString())); + } + if ((jsonObj.get("between0And500Percent") != null + && !jsonObj.get("between0And500Percent").isJsonNull()) + && !jsonObj.get("between0And500Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `between0And500Percent` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("between0And500Percent").toString())); + } + if ((jsonObj.get("betweenNeg50And0Percent") != null + && !jsonObj.get("betweenNeg50And0Percent").isJsonNull()) + && !jsonObj.get("betweenNeg50And0Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `betweenNeg50And0Percent` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("betweenNeg50And0Percent").toString())); + } + if ((jsonObj.get("belowNeg50Percent") != null + && !jsonObj.get("belowNeg50Percent").isJsonNull()) + && !jsonObj.get("belowNeg50Percent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `belowNeg50Percent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("belowNeg50Percent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + .class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + * @throws IOException if the JSON string is invalid with respect to + * GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent + */ + public static GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent.class); + } + + /** + * Convert an instance of GetLeaderboardResponseDataItemsInnerTokenCountByPnlPercent to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.java new file mode 100644 index 0000000..ea1f739 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.java @@ -0,0 +1,415 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner { + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_TOKEN_LOGO_URL = "tokenLogoUrl"; + + @SerializedName(SERIALIZED_NAME_TOKEN_LOGO_URL) + @jakarta.annotation.Nullable + private String tokenLogoUrl; + + public static final String SERIALIZED_NAME_TOKEN_PN_L_USD = "tokenPnLUsd"; + + @SerializedName(SERIALIZED_NAME_TOKEN_PN_L_USD) + @jakarta.annotation.Nullable + private String tokenPnLUsd; + + public static final String SERIALIZED_NAME_TOKEN_PN_L_PERCENT = "tokenPnLPercent"; + + @SerializedName(SERIALIZED_NAME_TOKEN_PN_L_PERCENT) + @jakarta.annotation.Nullable + private String tokenPnLPercent; + + public GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner() {} + + public GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. EVM addresses are lowercase; Solana addresses are case-sensitive. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Token symbol. + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner tokenLogoUrl( + @jakarta.annotation.Nullable String tokenLogoUrl) { + this.tokenLogoUrl = tokenLogoUrl; + return this; + } + + /** + * Token logo URL. + * + * @return tokenLogoUrl + */ + @jakarta.annotation.Nullable + public String getTokenLogoUrl() { + return tokenLogoUrl; + } + + public void setTokenLogoUrl(@jakarta.annotation.Nullable String tokenLogoUrl) { + this.tokenLogoUrl = tokenLogoUrl; + } + + public GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner tokenPnLUsd( + @jakarta.annotation.Nullable String tokenPnLUsd) { + this.tokenPnLUsd = tokenPnLUsd; + return this; + } + + /** + * Realized PnL for this token, denominated in USD. Positive means profit, negative means loss. + * + * @return tokenPnLUsd + */ + @jakarta.annotation.Nullable + public String getTokenPnLUsd() { + return tokenPnLUsd; + } + + public void setTokenPnLUsd(@jakarta.annotation.Nullable String tokenPnLUsd) { + this.tokenPnLUsd = tokenPnLUsd; + } + + public GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner tokenPnLPercent( + @jakarta.annotation.Nullable String tokenPnLPercent) { + this.tokenPnLPercent = tokenPnLPercent; + return this; + } + + /** + * Realized PnL percentage for this token. No percent sign included. + * + * @return tokenPnLPercent + */ + @jakarta.annotation.Nullable + public String getTokenPnLPercent() { + return tokenPnLPercent; + } + + public void setTokenPnLPercent(@jakarta.annotation.Nullable String tokenPnLPercent) { + this.tokenPnLPercent = tokenPnLPercent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner + getLeaderboardResponseDataItemsInnerTopPnlTokenListInner = + (GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner) o; + return Objects.equals( + this.tokenContractAddress, + getLeaderboardResponseDataItemsInnerTopPnlTokenListInner + .tokenContractAddress) + && Objects.equals( + this.tokenSymbol, + getLeaderboardResponseDataItemsInnerTopPnlTokenListInner.tokenSymbol) + && Objects.equals( + this.tokenLogoUrl, + getLeaderboardResponseDataItemsInnerTopPnlTokenListInner.tokenLogoUrl) + && Objects.equals( + this.tokenPnLUsd, + getLeaderboardResponseDataItemsInnerTopPnlTokenListInner.tokenPnLUsd) + && Objects.equals( + this.tokenPnLPercent, + getLeaderboardResponseDataItemsInnerTopPnlTokenListInner.tokenPnLPercent); + } + + @Override + public int hashCode() { + return Objects.hash( + tokenContractAddress, tokenSymbol, tokenLogoUrl, tokenPnLUsd, tokenPnLPercent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner {\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" tokenLogoUrl: ").append(toIndentedString(tokenLogoUrl)).append("\n"); + sb.append(" tokenPnLUsd: ").append(toIndentedString(tokenPnLUsd)).append("\n"); + sb.append(" tokenPnLPercent: ").append(toIndentedString(tokenPnLPercent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object tokenLogoUrlValue = getTokenLogoUrl(); + String tokenLogoUrlValueAsString = ""; + tokenLogoUrlValueAsString = tokenLogoUrlValue.toString(); + sb.append("tokenLogoUrl=").append(urlEncode(tokenLogoUrlValueAsString)).append(""); + Object tokenPnLUsdValue = getTokenPnLUsd(); + String tokenPnLUsdValueAsString = ""; + tokenPnLUsdValueAsString = tokenPnLUsdValue.toString(); + sb.append("tokenPnLUsd=").append(urlEncode(tokenPnLUsdValueAsString)).append(""); + Object tokenPnLPercentValue = getTokenPnLPercent(); + String tokenPnLPercentValueAsString = ""; + tokenPnLPercentValueAsString = tokenPnLPercentValue.toString(); + sb.append("tokenPnLPercent=").append(urlEncode(tokenPnLPercentValueAsString)).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("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + openapiFields.add("tokenLogoUrl"); + openapiFields.add("tokenPnLUsd"); + openapiFields.add("tokenPnLPercent"); + + // 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 + * GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner is" + + " not found in the empty JSON string", + GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + if ((jsonObj.get("tokenLogoUrl") != null && !jsonObj.get("tokenLogoUrl").isJsonNull()) + && !jsonObj.get("tokenLogoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenLogoUrl` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenLogoUrl").toString())); + } + if ((jsonObj.get("tokenPnLUsd") != null && !jsonObj.get("tokenPnLUsd").isJsonNull()) + && !jsonObj.get("tokenPnLUsd").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenPnLUsd` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenPnLUsd").toString())); + } + if ((jsonObj.get("tokenPnLPercent") != null && !jsonObj.get("tokenPnLPercent").isJsonNull()) + && !jsonObj.get("tokenPnLPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenPnLPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("tokenPnLPercent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner + .class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner + * @throws IOException if the JSON string is invalid with respect to + * GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner + */ + public static GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner.class); + } + + /** + * Convert an instance of GetLeaderboardResponseDataItemsInnerTopPnlTokenListInner to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetPortfolioSupportedChainsResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetPortfolioSupportedChainsResponse.java new file mode 100644 index 0000000..ff09cbf --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetPortfolioSupportedChainsResponse.java @@ -0,0 +1,391 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** GetPortfolioSupportedChainsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetPortfolioSupportedChainsResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private List<@Valid GetPortfolioSupportedChainsResponseDataInner> data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetPortfolioSupportedChainsResponse() {} + + public GetPortfolioSupportedChainsResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetPortfolioSupportedChainsResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetPortfolioSupportedChainsResponse data( + @jakarta.annotation.Nullable + List<@Valid GetPortfolioSupportedChainsResponseDataInner> data) { + this.data = data; + return this; + } + + public GetPortfolioSupportedChainsResponse addDataItem( + GetPortfolioSupportedChainsResponseDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of supported blockchain networks. + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetPortfolioSupportedChainsResponseDataInner> getData() { + return data; + } + + public void setData( + @jakarta.annotation.Nullable + List<@Valid GetPortfolioSupportedChainsResponseDataInner> data) { + this.data = data; + } + + public GetPortfolioSupportedChainsResponse timestamp( + @jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetPortfolioSupportedChainsResponse 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; + } + GetPortfolioSupportedChainsResponse getPortfolioSupportedChainsResponse = + (GetPortfolioSupportedChainsResponse) o; + return Objects.equals(this.code, getPortfolioSupportedChainsResponse.code) + && Objects.equals(this.msg, getPortfolioSupportedChainsResponse.msg) + && Objects.equals(this.data, getPortfolioSupportedChainsResponse.data) + && Objects.equals(this.timestamp, getPortfolioSupportedChainsResponse.timestamp) + && Objects.equals(this.success, getPortfolioSupportedChainsResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPortfolioSupportedChainsResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = + (String) + ((Collection) dataValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * GetPortfolioSupportedChainsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetPortfolioSupportedChainsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetPortfolioSupportedChainsResponse is" + + " not found in the empty JSON string", + GetPortfolioSupportedChainsResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `data` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + GetPortfolioSupportedChainsResponseDataInner.validateJsonElement( + jsonArraydata.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPortfolioSupportedChainsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPortfolioSupportedChainsResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetPortfolioSupportedChainsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPortfolioSupportedChainsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPortfolioSupportedChainsResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetPortfolioSupportedChainsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPortfolioSupportedChainsResponse + * @throws IOException if the JSON string is invalid with respect to + * GetPortfolioSupportedChainsResponse + */ + public static GetPortfolioSupportedChainsResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetPortfolioSupportedChainsResponse.class); + } + + /** + * Convert an instance of GetPortfolioSupportedChainsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetPortfolioSupportedChainsResponseDataInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetPortfolioSupportedChainsResponseDataInner.java new file mode 100644 index 0000000..a83936f --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetPortfolioSupportedChainsResponseDataInner.java @@ -0,0 +1,480 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetPortfolioSupportedChainsResponseDataInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetPortfolioSupportedChainsResponseDataInner { + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @jakarta.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SHORT_NAME = "shortName"; + + @SerializedName(SERIALIZED_NAME_SHORT_NAME) + @jakarta.annotation.Nullable + private String shortName; + + public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; + + @SerializedName(SERIALIZED_NAME_LOGO_URL) + @jakarta.annotation.Nullable + private String logoUrl; + + public static final String SERIALIZED_NAME_CASE_SENSITIVE = "caseSensitive"; + + @SerializedName(SERIALIZED_NAME_CASE_SENSITIVE) + @jakarta.annotation.Nullable + private Boolean caseSensitive; + + public static final String SERIALIZED_NAME_NATIVE_TOKEN_SYMBOL = "nativeTokenSymbol"; + + @SerializedName(SERIALIZED_NAME_NATIVE_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String nativeTokenSymbol; + + public static final String SERIALIZED_NAME_NATIVE_TOKEN_DECIMALS = "nativeTokenDecimals"; + + @SerializedName(SERIALIZED_NAME_NATIVE_TOKEN_DECIMALS) + @jakarta.annotation.Nullable + private Integer nativeTokenDecimals; + + public GetPortfolioSupportedChainsResponseDataInner() {} + + public GetPortfolioSupportedChainsResponseDataInner binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, + * \"CT_501\"=Solana). + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetPortfolioSupportedChainsResponseDataInner name( + @jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Full chain name. + * + * @return name + */ + @jakarta.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + public GetPortfolioSupportedChainsResponseDataInner shortName( + @jakarta.annotation.Nullable String shortName) { + this.shortName = shortName; + return this; + } + + /** + * Short chain name (uppercase). + * + * @return shortName + */ + @jakarta.annotation.Nullable + public String getShortName() { + return shortName; + } + + public void setShortName(@jakarta.annotation.Nullable String shortName) { + this.shortName = shortName; + } + + public GetPortfolioSupportedChainsResponseDataInner logoUrl( + @jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + /** + * Chain logo image URL. + * + * @return logoUrl + */ + @jakarta.annotation.Nullable + public String getLogoUrl() { + return logoUrl; + } + + public void setLogoUrl(@jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + } + + public GetPortfolioSupportedChainsResponseDataInner caseSensitive( + @jakarta.annotation.Nullable Boolean caseSensitive) { + this.caseSensitive = caseSensitive; + return this; + } + + /** + * Whether addresses on this chain are case-sensitive. true=case-sensitive (e.g. Solana), + * false=case-insensitive (e.g. EVM chains). + * + * @return caseSensitive + */ + @jakarta.annotation.Nullable + public Boolean getCaseSensitive() { + return caseSensitive; + } + + public void setCaseSensitive(@jakarta.annotation.Nullable Boolean caseSensitive) { + this.caseSensitive = caseSensitive; + } + + public GetPortfolioSupportedChainsResponseDataInner nativeTokenSymbol( + @jakarta.annotation.Nullable String nativeTokenSymbol) { + this.nativeTokenSymbol = nativeTokenSymbol; + return this; + } + + /** + * Symbol of the chain's native asset (uppercase). + * + * @return nativeTokenSymbol + */ + @jakarta.annotation.Nullable + public String getNativeTokenSymbol() { + return nativeTokenSymbol; + } + + public void setNativeTokenSymbol(@jakarta.annotation.Nullable String nativeTokenSymbol) { + this.nativeTokenSymbol = nativeTokenSymbol; + } + + public GetPortfolioSupportedChainsResponseDataInner nativeTokenDecimals( + @jakarta.annotation.Nullable Integer nativeTokenDecimals) { + this.nativeTokenDecimals = nativeTokenDecimals; + return this; + } + + /** + * Native token decimals. Display value = raw value / 10^nativeTokenDecimals. + * + * @return nativeTokenDecimals + */ + @jakarta.annotation.Nullable + public Integer getNativeTokenDecimals() { + return nativeTokenDecimals; + } + + public void setNativeTokenDecimals(@jakarta.annotation.Nullable Integer nativeTokenDecimals) { + this.nativeTokenDecimals = nativeTokenDecimals; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPortfolioSupportedChainsResponseDataInner getPortfolioSupportedChainsResponseDataInner = + (GetPortfolioSupportedChainsResponseDataInner) o; + return Objects.equals( + this.binanceChainId, + getPortfolioSupportedChainsResponseDataInner.binanceChainId) + && Objects.equals(this.name, getPortfolioSupportedChainsResponseDataInner.name) + && Objects.equals( + this.shortName, getPortfolioSupportedChainsResponseDataInner.shortName) + && Objects.equals( + this.logoUrl, getPortfolioSupportedChainsResponseDataInner.logoUrl) + && Objects.equals( + this.caseSensitive, + getPortfolioSupportedChainsResponseDataInner.caseSensitive) + && Objects.equals( + this.nativeTokenSymbol, + getPortfolioSupportedChainsResponseDataInner.nativeTokenSymbol) + && Objects.equals( + this.nativeTokenDecimals, + getPortfolioSupportedChainsResponseDataInner.nativeTokenDecimals); + } + + @Override + public int hashCode() { + return Objects.hash( + binanceChainId, + name, + shortName, + logoUrl, + caseSensitive, + nativeTokenSymbol, + nativeTokenDecimals); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPortfolioSupportedChainsResponseDataInner {\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" shortName: ").append(toIndentedString(shortName)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" caseSensitive: ").append(toIndentedString(caseSensitive)).append("\n"); + sb.append(" nativeTokenSymbol: ").append(toIndentedString(nativeTokenSymbol)).append("\n"); + sb.append(" nativeTokenDecimals: ") + .append(toIndentedString(nativeTokenDecimals)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object nameValue = getName(); + String nameValueAsString = ""; + nameValueAsString = nameValue.toString(); + sb.append("name=").append(urlEncode(nameValueAsString)).append(""); + Object shortNameValue = getShortName(); + String shortNameValueAsString = ""; + shortNameValueAsString = shortNameValue.toString(); + sb.append("shortName=").append(urlEncode(shortNameValueAsString)).append(""); + Object logoUrlValue = getLogoUrl(); + String logoUrlValueAsString = ""; + logoUrlValueAsString = logoUrlValue.toString(); + sb.append("logoUrl=").append(urlEncode(logoUrlValueAsString)).append(""); + Object caseSensitiveValue = getCaseSensitive(); + String caseSensitiveValueAsString = ""; + caseSensitiveValueAsString = caseSensitiveValue.toString(); + sb.append("caseSensitive=").append(urlEncode(caseSensitiveValueAsString)).append(""); + Object nativeTokenSymbolValue = getNativeTokenSymbol(); + String nativeTokenSymbolValueAsString = ""; + nativeTokenSymbolValueAsString = nativeTokenSymbolValue.toString(); + sb.append("nativeTokenSymbol=") + .append(urlEncode(nativeTokenSymbolValueAsString)) + .append(""); + Object nativeTokenDecimalsValue = getNativeTokenDecimals(); + String nativeTokenDecimalsValueAsString = ""; + nativeTokenDecimalsValueAsString = nativeTokenDecimalsValue.toString(); + sb.append("nativeTokenDecimals=") + .append(urlEncode(nativeTokenDecimalsValueAsString)) + .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("binanceChainId"); + openapiFields.add("name"); + openapiFields.add("shortName"); + openapiFields.add("logoUrl"); + openapiFields.add("caseSensitive"); + openapiFields.add("nativeTokenSymbol"); + openapiFields.add("nativeTokenDecimals"); + + // 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 + * GetPortfolioSupportedChainsResponseDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetPortfolioSupportedChainsResponseDataInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetPortfolioSupportedChainsResponseDataInner is not found" + + " in the empty JSON string", + GetPortfolioSupportedChainsResponseDataInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").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("shortName") != null && !jsonObj.get("shortName").isJsonNull()) + && !jsonObj.get("shortName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `shortName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("shortName").toString())); + } + if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) + && !jsonObj.get("logoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `logoUrl` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("logoUrl").toString())); + } + if ((jsonObj.get("nativeTokenSymbol") != null + && !jsonObj.get("nativeTokenSymbol").isJsonNull()) + && !jsonObj.get("nativeTokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nativeTokenSymbol` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("nativeTokenSymbol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPortfolioSupportedChainsResponseDataInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetPortfolioSupportedChainsResponseDataInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetPortfolioSupportedChainsResponseDataInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetPortfolioSupportedChainsResponseDataInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPortfolioSupportedChainsResponseDataInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetPortfolioSupportedChainsResponseDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPortfolioSupportedChainsResponseDataInner + * @throws IOException if the JSON string is invalid with respect to + * GetPortfolioSupportedChainsResponseDataInner + */ + public static GetPortfolioSupportedChainsResponseDataInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetPortfolioSupportedChainsResponseDataInner.class); + } + + /** + * Convert an instance of GetPortfolioSupportedChainsResponseDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRfqOrderStatusResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRfqOrderStatusResponse.java new file mode 100644 index 0000000..d8b5dde --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRfqOrderStatusResponse.java @@ -0,0 +1,346 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetRfqOrderStatusResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRfqOrderStatusResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetRfqOrderStatusResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetRfqOrderStatusResponse() {} + + public GetRfqOrderStatusResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetRfqOrderStatusResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetRfqOrderStatusResponse data( + @jakarta.annotation.Nullable GetRfqOrderStatusResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetRfqOrderStatusResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetRfqOrderStatusResponseData data) { + this.data = data; + } + + public GetRfqOrderStatusResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetRfqOrderStatusResponse 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; + } + GetRfqOrderStatusResponse getRfqOrderStatusResponse = (GetRfqOrderStatusResponse) o; + return Objects.equals(this.code, getRfqOrderStatusResponse.code) + && Objects.equals(this.msg, getRfqOrderStatusResponse.msg) + && Objects.equals(this.data, getRfqOrderStatusResponse.data) + && Objects.equals(this.timestamp, getRfqOrderStatusResponse.timestamp) + && Objects.equals(this.success, getRfqOrderStatusResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRfqOrderStatusResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 GetRfqOrderStatusResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRfqOrderStatusResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRfqOrderStatusResponse is not found" + + " in the empty JSON string", + GetRfqOrderStatusResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetRfqOrderStatusResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRfqOrderStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRfqOrderStatusResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetRfqOrderStatusResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRfqOrderStatusResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRfqOrderStatusResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRfqOrderStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRfqOrderStatusResponse + * @throws IOException if the JSON string is invalid with respect to GetRfqOrderStatusResponse + */ + public static GetRfqOrderStatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRfqOrderStatusResponse.class); + } + + /** + * Convert an instance of GetRfqOrderStatusResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRfqOrderStatusResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRfqOrderStatusResponseData.java new file mode 100644 index 0000000..fb6597a --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRfqOrderStatusResponseData.java @@ -0,0 +1,464 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.Arrays; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Order status details. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRfqOrderStatusResponseData { + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private String orderId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_TX_HASH = "txHash"; + + @SerializedName(SERIALIZED_NAME_TX_HASH) + @jakarta.annotation.Nullable + private String txHash; + + public static final String SERIALIZED_NAME_FROM_AMOUNT = "fromAmount"; + + @SerializedName(SERIALIZED_NAME_FROM_AMOUNT) + @jakarta.annotation.Nullable + private String fromAmount; + + public static final String SERIALIZED_NAME_TO_AMOUNT = "toAmount"; + + @SerializedName(SERIALIZED_NAME_TO_AMOUNT) + @jakarta.annotation.Nullable + private String toAmount; + + public static final String SERIALIZED_NAME_FILLED_AT = "filledAt"; + + @SerializedName(SERIALIZED_NAME_FILLED_AT) + @jakarta.annotation.Nullable + private Long filledAt; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @jakarta.annotation.Nullable + private Long createdAt; + + public GetRfqOrderStatusResponseData() {} + + public GetRfqOrderStatusResponseData orderId(@jakarta.annotation.Nullable String orderId) { + this.orderId = orderId; + return this; + } + + /** + * Platform order ID. + * + * @return orderId + */ + @jakarta.annotation.Nullable + public String getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable String orderId) { + this.orderId = orderId; + } + + public GetRfqOrderStatusResponseData status(@jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Current order status. - **Terminal**: `FILLED` (settled on-chain), + * `FAILED` (settlement failed), `EXPIRED` (vendor could not settle before + * the order deadline), `CANCELLED` (cancelled by the user or vendor). - + * **Intermediate**: `PENDING_VENDOR` (forwarded to vendor, awaiting settlement), + * `PENDING_ONCHAIN` (vendor has broadcast the on-chain transaction, awaiting block + * confirmation). + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + public GetRfqOrderStatusResponseData txHash(@jakarta.annotation.Nullable String txHash) { + this.txHash = txHash; + return this; + } + + /** + * On-chain transaction hash. Present only when `status=FILLED`. + * + * @return txHash + */ + @jakarta.annotation.Nullable + public String getTxHash() { + return txHash; + } + + public void setTxHash(@jakarta.annotation.Nullable String txHash) { + this.txHash = txHash; + } + + public GetRfqOrderStatusResponseData fromAmount( + @jakarta.annotation.Nullable String fromAmount) { + this.fromAmount = fromAmount; + return this; + } + + /** + * Actual sell-token amount settled (smallest unit, integer string). Present when filled. + * + * @return fromAmount + */ + @jakarta.annotation.Nullable + public String getFromAmount() { + return fromAmount; + } + + public void setFromAmount(@jakarta.annotation.Nullable String fromAmount) { + this.fromAmount = fromAmount; + } + + public GetRfqOrderStatusResponseData toAmount(@jakarta.annotation.Nullable String toAmount) { + this.toAmount = toAmount; + return this; + } + + /** + * Actual buy-token amount received (smallest unit, integer string). Present when filled. + * + * @return toAmount + */ + @jakarta.annotation.Nullable + public String getToAmount() { + return toAmount; + } + + public void setToAmount(@jakarta.annotation.Nullable String toAmount) { + this.toAmount = toAmount; + } + + public GetRfqOrderStatusResponseData filledAt(@jakarta.annotation.Nullable Long filledAt) { + this.filledAt = filledAt; + return this; + } + + /** + * Settlement timestamp (Unix epoch milliseconds). Present when filled. + * + * @return filledAt + */ + @jakarta.annotation.Nullable + public Long getFilledAt() { + return filledAt; + } + + public void setFilledAt(@jakarta.annotation.Nullable Long filledAt) { + this.filledAt = filledAt; + } + + public GetRfqOrderStatusResponseData createdAt(@jakarta.annotation.Nullable Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Order creation timestamp (Unix epoch milliseconds). + * + * @return createdAt + */ + @jakarta.annotation.Nullable + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@jakarta.annotation.Nullable Long createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRfqOrderStatusResponseData getRfqOrderStatusResponseData = + (GetRfqOrderStatusResponseData) o; + return Objects.equals(this.orderId, getRfqOrderStatusResponseData.orderId) + && Objects.equals(this.status, getRfqOrderStatusResponseData.status) + && Objects.equals(this.txHash, getRfqOrderStatusResponseData.txHash) + && Objects.equals(this.fromAmount, getRfqOrderStatusResponseData.fromAmount) + && Objects.equals(this.toAmount, getRfqOrderStatusResponseData.toAmount) + && Objects.equals(this.filledAt, getRfqOrderStatusResponseData.filledAt) + && Objects.equals(this.createdAt, getRfqOrderStatusResponseData.createdAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, status, txHash, fromAmount, toAmount, filledAt, createdAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRfqOrderStatusResponseData {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" txHash: ").append(toIndentedString(txHash)).append("\n"); + sb.append(" fromAmount: ").append(toIndentedString(fromAmount)).append("\n"); + sb.append(" toAmount: ").append(toIndentedString(toAmount)).append("\n"); + sb.append(" filledAt: ").append(toIndentedString(filledAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object txHashValue = getTxHash(); + String txHashValueAsString = ""; + txHashValueAsString = txHashValue.toString(); + sb.append("txHash=").append(urlEncode(txHashValueAsString)).append(""); + Object fromAmountValue = getFromAmount(); + String fromAmountValueAsString = ""; + fromAmountValueAsString = fromAmountValue.toString(); + sb.append("fromAmount=").append(urlEncode(fromAmountValueAsString)).append(""); + Object toAmountValue = getToAmount(); + String toAmountValueAsString = ""; + toAmountValueAsString = toAmountValue.toString(); + sb.append("toAmount=").append(urlEncode(toAmountValueAsString)).append(""); + Object filledAtValue = getFilledAt(); + String filledAtValueAsString = ""; + filledAtValueAsString = filledAtValue.toString(); + sb.append("filledAt=").append(urlEncode(filledAtValueAsString)).append(""); + Object createdAtValue = getCreatedAt(); + String createdAtValueAsString = ""; + createdAtValueAsString = createdAtValue.toString(); + sb.append("createdAt=").append(urlEncode(createdAtValueAsString)).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("orderId"); + openapiFields.add("status"); + openapiFields.add("txHash"); + openapiFields.add("fromAmount"); + openapiFields.add("toAmount"); + openapiFields.add("filledAt"); + openapiFields.add("createdAt"); + + // 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 + * GetRfqOrderStatusResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRfqOrderStatusResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRfqOrderStatusResponseData is not" + + " found in the empty JSON string", + GetRfqOrderStatusResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("orderId") != null && !jsonObj.get("orderId").isJsonNull()) + && !jsonObj.get("orderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("orderId").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())); + } + if ((jsonObj.get("txHash") != null && !jsonObj.get("txHash").isJsonNull()) + && !jsonObj.get("txHash").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txHash` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("txHash").toString())); + } + if ((jsonObj.get("fromAmount") != null && !jsonObj.get("fromAmount").isJsonNull()) + && !jsonObj.get("fromAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fromAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("fromAmount").toString())); + } + if ((jsonObj.get("toAmount") != null && !jsonObj.get("toAmount").isJsonNull()) + && !jsonObj.get("toAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `toAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("toAmount").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRfqOrderStatusResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRfqOrderStatusResponseData' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRfqOrderStatusResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRfqOrderStatusResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRfqOrderStatusResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRfqOrderStatusResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRfqOrderStatusResponseData + * @throws IOException if the JSON string is invalid with respect to + * GetRfqOrderStatusResponseData + */ + public static GetRfqOrderStatusResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRfqOrderStatusResponseData.class); + } + + /** + * Convert an instance of GetRfqOrderStatusResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponse.java new file mode 100644 index 0000000..a243432 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponse.java @@ -0,0 +1,392 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** GetRwaTokenIssuancePlatformsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaTokenIssuancePlatformsResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private List<@Valid GetRwaTokenIssuancePlatformsResponseDataInner> data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetRwaTokenIssuancePlatformsResponse() {} + + public GetRwaTokenIssuancePlatformsResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetRwaTokenIssuancePlatformsResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Status message. + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetRwaTokenIssuancePlatformsResponse data( + @jakarta.annotation.Nullable + List<@Valid GetRwaTokenIssuancePlatformsResponseDataInner> data) { + this.data = data; + return this; + } + + public GetRwaTokenIssuancePlatformsResponse addDataItem( + GetRwaTokenIssuancePlatformsResponseDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of RWA token issuance platforms. + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetRwaTokenIssuancePlatformsResponseDataInner> getData() { + return data; + } + + public void setData( + @jakarta.annotation.Nullable + List<@Valid GetRwaTokenIssuancePlatformsResponseDataInner> data) { + this.data = data; + } + + public GetRwaTokenIssuancePlatformsResponse timestamp( + @jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Server response time, Unix millisecond timestamp. + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetRwaTokenIssuancePlatformsResponse success( + @jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Whether the request was successful. + * + * @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; + } + GetRwaTokenIssuancePlatformsResponse getRwaTokenIssuancePlatformsResponse = + (GetRwaTokenIssuancePlatformsResponse) o; + return Objects.equals(this.code, getRwaTokenIssuancePlatformsResponse.code) + && Objects.equals(this.msg, getRwaTokenIssuancePlatformsResponse.msg) + && Objects.equals(this.data, getRwaTokenIssuancePlatformsResponse.data) + && Objects.equals(this.timestamp, getRwaTokenIssuancePlatformsResponse.timestamp) + && Objects.equals(this.success, getRwaTokenIssuancePlatformsResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaTokenIssuancePlatformsResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = + (String) + ((Collection) dataValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * GetRwaTokenIssuancePlatformsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaTokenIssuancePlatformsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaTokenIssuancePlatformsResponse" + + " is not found in the empty JSON string", + GetRwaTokenIssuancePlatformsResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `data` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + GetRwaTokenIssuancePlatformsResponseDataInner.validateJsonElement( + jsonArraydata.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaTokenIssuancePlatformsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaTokenIssuancePlatformsResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaTokenIssuancePlatformsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwaTokenIssuancePlatformsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaTokenIssuancePlatformsResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaTokenIssuancePlatformsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaTokenIssuancePlatformsResponse + * @throws IOException if the JSON string is invalid with respect to + * GetRwaTokenIssuancePlatformsResponse + */ + public static GetRwaTokenIssuancePlatformsResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaTokenIssuancePlatformsResponse.class); + } + + /** + * Convert an instance of GetRwaTokenIssuancePlatformsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponseDataInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponseDataInner.java new file mode 100644 index 0000000..9d14e1e --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponseDataInner.java @@ -0,0 +1,447 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.Arrays; +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.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** GetRwaTokenIssuancePlatformsResponseDataInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaTokenIssuancePlatformsResponseDataInner { + public static final String SERIALIZED_NAME_PLATFORM_ID = "platformId"; + + @SerializedName(SERIALIZED_NAME_PLATFORM_ID) + @jakarta.annotation.Nullable + private String platformId; + + public static final String SERIALIZED_NAME_TICKER_COUNT = "tickerCount"; + + @SerializedName(SERIALIZED_NAME_TICKER_COUNT) + @jakarta.annotation.Nullable + private Integer tickerCount; + + public static final String SERIALIZED_NAME_CHAIN_DISTRIBUTION = "chainDistribution"; + + @SerializedName(SERIALIZED_NAME_CHAIN_DISTRIBUTION) + @jakarta.annotation.Nullable + private List<@Valid GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner> + chainDistribution; + + public static final String SERIALIZED_NAME_WEBSITE = "website"; + + @SerializedName(SERIALIZED_NAME_WEBSITE) + @jakarta.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; + + @SerializedName(SERIALIZED_NAME_LOGO_URL) + @jakarta.annotation.Nullable + private String logoUrl; + + public GetRwaTokenIssuancePlatformsResponseDataInner() {} + + public GetRwaTokenIssuancePlatformsResponseDataInner platformId( + @jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + return this; + } + + /** + * Unique platform identifier. Examples: ondo=Ondo Finance, bstock=bStocks. + * + * @return platformId + */ + @jakarta.annotation.Nullable + public String getPlatformId() { + return platformId; + } + + public void setPlatformId(@jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + } + + public GetRwaTokenIssuancePlatformsResponseDataInner tickerCount( + @jakarta.annotation.Nullable Integer tickerCount) { + this.tickerCount = tickerCount; + return this; + } + + /** + * Number of underlying assets corresponding to the RWA tokens. + * + * @return tickerCount + */ + @jakarta.annotation.Nullable + public Integer getTickerCount() { + return tickerCount; + } + + public void setTickerCount(@jakarta.annotation.Nullable Integer tickerCount) { + this.tickerCount = tickerCount; + } + + public GetRwaTokenIssuancePlatformsResponseDataInner chainDistribution( + @jakarta.annotation.Nullable + List<@Valid GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner> + chainDistribution) { + this.chainDistribution = chainDistribution; + return this; + } + + public GetRwaTokenIssuancePlatformsResponseDataInner addChainDistributionItem( + GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + chainDistributionItem) { + if (this.chainDistribution == null) { + this.chainDistribution = new ArrayList<>(); + } + this.chainDistribution.add(chainDistributionItem); + return this; + } + + /** + * RWA token distribution across chains. + * + * @return chainDistribution + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner> + getChainDistribution() { + return chainDistribution; + } + + public void setChainDistribution( + @jakarta.annotation.Nullable + List<@Valid GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner> + chainDistribution) { + this.chainDistribution = chainDistribution; + } + + public GetRwaTokenIssuancePlatformsResponseDataInner website( + @jakarta.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Platform official website. Null when unavailable. + * + * @return website + */ + @jakarta.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@jakarta.annotation.Nullable String website) { + this.website = website; + } + + public GetRwaTokenIssuancePlatformsResponseDataInner logoUrl( + @jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + /** + * Platform logo URL. Null when unavailable. + * + * @return logoUrl + */ + @jakarta.annotation.Nullable + public String getLogoUrl() { + return logoUrl; + } + + public void setLogoUrl(@jakarta.annotation.Nullable String logoUrl) { + this.logoUrl = logoUrl; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaTokenIssuancePlatformsResponseDataInner + getRwaTokenIssuancePlatformsResponseDataInner = + (GetRwaTokenIssuancePlatformsResponseDataInner) o; + return Objects.equals( + this.platformId, getRwaTokenIssuancePlatformsResponseDataInner.platformId) + && Objects.equals( + this.tickerCount, getRwaTokenIssuancePlatformsResponseDataInner.tickerCount) + && Objects.equals( + this.chainDistribution, + getRwaTokenIssuancePlatformsResponseDataInner.chainDistribution) + && Objects.equals( + this.website, getRwaTokenIssuancePlatformsResponseDataInner.website) + && Objects.equals( + this.logoUrl, getRwaTokenIssuancePlatformsResponseDataInner.logoUrl); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(platformId, tickerCount, chainDistribution, website, logoUrl); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaTokenIssuancePlatformsResponseDataInner {\n"); + sb.append(" platformId: ").append(toIndentedString(platformId)).append("\n"); + sb.append(" tickerCount: ").append(toIndentedString(tickerCount)).append("\n"); + sb.append(" chainDistribution: ").append(toIndentedString(chainDistribution)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object platformIdValue = getPlatformId(); + String platformIdValueAsString = ""; + platformIdValueAsString = platformIdValue.toString(); + sb.append("platformId=").append(urlEncode(platformIdValueAsString)).append(""); + Object tickerCountValue = getTickerCount(); + String tickerCountValueAsString = ""; + tickerCountValueAsString = tickerCountValue.toString(); + sb.append("tickerCount=").append(urlEncode(tickerCountValueAsString)).append(""); + Object chainDistributionValue = getChainDistribution(); + String chainDistributionValueAsString = ""; + chainDistributionValueAsString = + (String) + ((Collection) chainDistributionValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("chainDistribution=") + .append(urlEncode(chainDistributionValueAsString)) + .append(""); + Object websiteValue = getWebsite(); + String websiteValueAsString = ""; + websiteValueAsString = websiteValue.toString(); + sb.append("website=").append(urlEncode(websiteValueAsString)).append(""); + Object logoUrlValue = getLogoUrl(); + String logoUrlValueAsString = ""; + logoUrlValueAsString = logoUrlValue.toString(); + sb.append("logoUrl=").append(urlEncode(logoUrlValueAsString)).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("platformId"); + openapiFields.add("tickerCount"); + openapiFields.add("chainDistribution"); + openapiFields.add("website"); + openapiFields.add("logoUrl"); + + // 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 + * GetRwaTokenIssuancePlatformsResponseDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaTokenIssuancePlatformsResponseDataInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwaTokenIssuancePlatformsResponseDataInner is not found" + + " in the empty JSON string", + GetRwaTokenIssuancePlatformsResponseDataInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("platformId") != null && !jsonObj.get("platformId").isJsonNull()) + && !jsonObj.get("platformId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `platformId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("platformId").toString())); + } + if (jsonObj.get("chainDistribution") != null + && !jsonObj.get("chainDistribution").isJsonNull()) { + JsonArray jsonArraychainDistribution = jsonObj.getAsJsonArray("chainDistribution"); + if (jsonArraychainDistribution != null) { + // ensure the json data is an array + if (!jsonObj.get("chainDistribution").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `chainDistribution` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("chainDistribution").toString())); + } + + // validate the optional field `chainDistribution` (array) + for (int i = 0; i < jsonArraychainDistribution.size(); i++) { + GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + .validateJsonElement(jsonArraychainDistribution.get(i)); + } + ; + } + } + if ((jsonObj.get("website") != null && !jsonObj.get("website").isJsonNull()) + && !jsonObj.get("website").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `website` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("website").toString())); + } + if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) + && !jsonObj.get("logoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `logoUrl` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("logoUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaTokenIssuancePlatformsResponseDataInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwaTokenIssuancePlatformsResponseDataInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetRwaTokenIssuancePlatformsResponseDataInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwaTokenIssuancePlatformsResponseDataInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaTokenIssuancePlatformsResponseDataInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaTokenIssuancePlatformsResponseDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaTokenIssuancePlatformsResponseDataInner + * @throws IOException if the JSON string is invalid with respect to + * GetRwaTokenIssuancePlatformsResponseDataInner + */ + public static GetRwaTokenIssuancePlatformsResponseDataInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwaTokenIssuancePlatformsResponseDataInner.class); + } + + /** + * Convert an instance of GetRwaTokenIssuancePlatformsResponseDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.java new file mode 100644 index 0000000..07f15a7 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.java @@ -0,0 +1,279 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner { + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_COUNT = "tokenCount"; + + @SerializedName(SERIALIZED_NAME_TOKEN_COUNT) + @jakarta.annotation.Nullable + private Integer tokenCount; + + public GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner() {} + + public GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, + * \"CT_501\"=Solana). + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner tokenCount( + @jakarta.annotation.Nullable Integer tokenCount) { + this.tokenCount = tokenCount; + return this; + } + + /** + * Number of RWA tokens on this chain (the same underlying asset deployed on different chains is + * counted separately). + * + * @return tokenCount + */ + @jakarta.annotation.Nullable + public Integer getTokenCount() { + return tokenCount; + } + + public void setTokenCount(@jakarta.annotation.Nullable Integer tokenCount) { + this.tokenCount = tokenCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + getRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner = + (GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner) o; + return Objects.equals( + this.binanceChainId, + getRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + .binanceChainId) + && Objects.equals( + this.tokenCount, + getRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + .tokenCount); + } + + @Override + public int hashCode() { + return Objects.hash(binanceChainId, tokenCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner {\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenCount: ").append(toIndentedString(tokenCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenCountValue = getTokenCount(); + String tokenCountValueAsString = ""; + tokenCountValueAsString = tokenCountValue.toString(); + sb.append("tokenCount=").append(urlEncode(tokenCountValueAsString)).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("binanceChainId"); + openapiFields.add("tokenCount"); + + // 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 + * GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + .openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner" + + " is not found in the empty JSON string", + GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + .class)); + + return (TypeAdapter) + new TypeAdapter< + GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner>() { + @Override + public void write( + JsonWriter out, + GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + * given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + * @throws IOException if the JSON string is invalid with respect to + * GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner + */ + public static GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner.class); + } + + /** + * Convert an instance of GetRwaTokenIssuancePlatformsResponseDataInnerChainDistributionInner to + * an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponse.java new file mode 100644 index 0000000..33f9cc8 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponse.java @@ -0,0 +1,378 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** GetRwaTokenListResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaTokenListResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private List<@Valid GetRwaTokenListResponseDataInner> data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetRwaTokenListResponse() {} + + public GetRwaTokenListResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetRwaTokenListResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Status message. + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetRwaTokenListResponse data( + @jakarta.annotation.Nullable List<@Valid GetRwaTokenListResponseDataInner> data) { + this.data = data; + return this; + } + + public GetRwaTokenListResponse addDataItem(GetRwaTokenListResponseDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of RWA tokenized assets. + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetRwaTokenListResponseDataInner> getData() { + return data; + } + + public void setData( + @jakarta.annotation.Nullable List<@Valid GetRwaTokenListResponseDataInner> data) { + this.data = data; + } + + public GetRwaTokenListResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Server response time, Unix millisecond timestamp. + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetRwaTokenListResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Whether the request was successful. + * + * @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; + } + GetRwaTokenListResponse getRwaTokenListResponse = (GetRwaTokenListResponse) o; + return Objects.equals(this.code, getRwaTokenListResponse.code) + && Objects.equals(this.msg, getRwaTokenListResponse.msg) + && Objects.equals(this.data, getRwaTokenListResponse.data) + && Objects.equals(this.timestamp, getRwaTokenListResponse.timestamp) + && Objects.equals(this.success, getRwaTokenListResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaTokenListResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = + (String) + ((Collection) dataValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 GetRwaTokenListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaTokenListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaTokenListResponse is not found" + + " in the empty JSON string", + GetRwaTokenListResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `data` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + GetRwaTokenListResponseDataInner.validateJsonElement(jsonArraydata.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaTokenListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaTokenListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetRwaTokenListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwaTokenListResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaTokenListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaTokenListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaTokenListResponse + * @throws IOException if the JSON string is invalid with respect to GetRwaTokenListResponse + */ + public static GetRwaTokenListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaTokenListResponse.class); + } + + /** + * Convert an instance of GetRwaTokenListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponseDataInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponseDataInner.java new file mode 100644 index 0000000..77fed78 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponseDataInner.java @@ -0,0 +1,1019 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.ArrayList; +import java.util.Arrays; +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.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** GetRwaTokenListResponseDataInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaTokenListResponseDataInner { + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_PLATFORM_ID = "platformId"; + + @SerializedName(SERIALIZED_NAME_PLATFORM_ID) + @jakarta.annotation.Nullable + private String platformId; + + public static final String SERIALIZED_NAME_ASSET_TYPE = "assetType"; + + @SerializedName(SERIALIZED_NAME_ASSET_TYPE) + @jakarta.annotation.Nullable + private Integer assetType; + + public static final String SERIALIZED_NAME_TOKEN_NAME = "tokenName"; + + @SerializedName(SERIALIZED_NAME_TOKEN_NAME) + @jakarta.annotation.Nullable + private String tokenName; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_TOKEN_LOGO_URL = "tokenLogoUrl"; + + @SerializedName(SERIALIZED_NAME_TOKEN_LOGO_URL) + @jakarta.annotation.Nullable + private String tokenLogoUrl; + + public static final String SERIALIZED_NAME_DECIMALS = "decimals"; + + @SerializedName(SERIALIZED_NAME_DECIMALS) + @jakarta.annotation.Nullable + private String decimals; + + public static final String SERIALIZED_NAME_UNDERLYING_TICKER = "underlyingTicker"; + + @SerializedName(SERIALIZED_NAME_UNDERLYING_TICKER) + @jakarta.annotation.Nullable + private String underlyingTicker; + + public static final String SERIALIZED_NAME_UNDERLYING_NAME = "underlyingName"; + + @SerializedName(SERIALIZED_NAME_UNDERLYING_NAME) + @jakarta.annotation.Nullable + private String underlyingName; + + public static final String SERIALIZED_NAME_UNDERLYING_NAME_ZH = "underlyingNameZh"; + + @SerializedName(SERIALIZED_NAME_UNDERLYING_NAME_ZH) + @jakarta.annotation.Nullable + private String underlyingNameZh; + + public static final String SERIALIZED_NAME_TOKEN_TO_SHARE_RATIO = "tokenToShareRatio"; + + @SerializedName(SERIALIZED_NAME_TOKEN_TO_SHARE_RATIO) + @jakarta.annotation.Nullable + private String tokenToShareRatio; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + + @SerializedName(SERIALIZED_NAME_TAGS) + @jakarta.annotation.Nullable + private List tags; + + public static final String SERIALIZED_NAME_STATUS_INFO = "statusInfo"; + + @SerializedName(SERIALIZED_NAME_STATUS_INFO) + @jakarta.annotation.Nullable + private GetRwaTokenListResponseDataInnerStatusInfo statusInfo; + + public static final String SERIALIZED_NAME_TOKEN_PRICE = "tokenPrice"; + + @SerializedName(SERIALIZED_NAME_TOKEN_PRICE) + @jakarta.annotation.Nullable + private String tokenPrice; + + public static final String SERIALIZED_NAME_REFERENCE_PRICE = "referencePrice"; + + @SerializedName(SERIALIZED_NAME_REFERENCE_PRICE) + @jakarta.annotation.Nullable + private String referencePrice; + + public static final String SERIALIZED_NAME_VOLUME24_H = "volume24H"; + + @SerializedName(SERIALIZED_NAME_VOLUME24_H) + @jakarta.annotation.Nullable + private String volume24H; + + public static final String SERIALIZED_NAME_MARKET_CAP = "marketCap"; + + @SerializedName(SERIALIZED_NAME_MARKET_CAP) + @jakarta.annotation.Nullable + private String marketCap; + + public static final String SERIALIZED_NAME_PE_RATIO_T_T_M = "peRatioTTM"; + + @SerializedName(SERIALIZED_NAME_PE_RATIO_T_T_M) + @jakarta.annotation.Nullable + private String peRatioTTM; + + public GetRwaTokenListResponseDataInner() {} + + public GetRwaTokenListResponseDataInner binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, + * \"CT_501\"=Solana). + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetRwaTokenListResponseDataInner tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetRwaTokenListResponseDataInner platformId( + @jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + return this; + } + + /** + * Unique platform identifier. + * + * @return platformId + */ + @jakarta.annotation.Nullable + public String getPlatformId() { + return platformId; + } + + public void setPlatformId(@jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + } + + public GetRwaTokenListResponseDataInner assetType( + @jakarta.annotation.Nullable Integer assetType) { + this.assetType = assetType; + return this; + } + + /** + * Asset type. 1=Stock, 2=Pre-IPO, 3=ETF. + * + * @return assetType + */ + @jakarta.annotation.Nullable + public Integer getAssetType() { + return assetType; + } + + public void setAssetType(@jakarta.annotation.Nullable Integer assetType) { + this.assetType = assetType; + } + + public GetRwaTokenListResponseDataInner tokenName( + @jakarta.annotation.Nullable String tokenName) { + this.tokenName = tokenName; + return this; + } + + /** + * Token full name. + * + * @return tokenName + */ + @jakarta.annotation.Nullable + public String getTokenName() { + return tokenName; + } + + public void setTokenName(@jakarta.annotation.Nullable String tokenName) { + this.tokenName = tokenName; + } + + public GetRwaTokenListResponseDataInner tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Token symbol. + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public GetRwaTokenListResponseDataInner tokenLogoUrl( + @jakarta.annotation.Nullable String tokenLogoUrl) { + this.tokenLogoUrl = tokenLogoUrl; + return this; + } + + /** + * Token logo URL. + * + * @return tokenLogoUrl + */ + @jakarta.annotation.Nullable + public String getTokenLogoUrl() { + return tokenLogoUrl; + } + + public void setTokenLogoUrl(@jakarta.annotation.Nullable String tokenLogoUrl) { + this.tokenLogoUrl = tokenLogoUrl; + } + + public GetRwaTokenListResponseDataInner decimals(@jakarta.annotation.Nullable String decimals) { + this.decimals = decimals; + return this; + } + + /** + * Token decimals. + * + * @return decimals + */ + @jakarta.annotation.Nullable + public String getDecimals() { + return decimals; + } + + public void setDecimals(@jakarta.annotation.Nullable String decimals) { + this.decimals = decimals; + } + + public GetRwaTokenListResponseDataInner underlyingTicker( + @jakarta.annotation.Nullable String underlyingTicker) { + this.underlyingTicker = underlyingTicker; + return this; + } + + /** + * Underlying asset ticker symbol. + * + * @return underlyingTicker + */ + @jakarta.annotation.Nullable + public String getUnderlyingTicker() { + return underlyingTicker; + } + + public void setUnderlyingTicker(@jakarta.annotation.Nullable String underlyingTicker) { + this.underlyingTicker = underlyingTicker; + } + + public GetRwaTokenListResponseDataInner underlyingName( + @jakarta.annotation.Nullable String underlyingName) { + this.underlyingName = underlyingName; + return this; + } + + /** + * Underlying company English name. + * + * @return underlyingName + */ + @jakarta.annotation.Nullable + public String getUnderlyingName() { + return underlyingName; + } + + public void setUnderlyingName(@jakarta.annotation.Nullable String underlyingName) { + this.underlyingName = underlyingName; + } + + public GetRwaTokenListResponseDataInner underlyingNameZh( + @jakarta.annotation.Nullable String underlyingNameZh) { + this.underlyingNameZh = underlyingNameZh; + return this; + } + + /** + * Underlying company Chinese name. Falls back to English if unavailable. + * + * @return underlyingNameZh + */ + @jakarta.annotation.Nullable + public String getUnderlyingNameZh() { + return underlyingNameZh; + } + + public void setUnderlyingNameZh(@jakarta.annotation.Nullable String underlyingNameZh) { + this.underlyingNameZh = underlyingNameZh; + } + + public GetRwaTokenListResponseDataInner tokenToShareRatio( + @jakarta.annotation.Nullable String tokenToShareRatio) { + this.tokenToShareRatio = tokenToShareRatio; + return this; + } + + /** + * Token-to-share exchange ratio. E.g. \"1.003701\" means 1 token ≈ 1.003701 + * underlying shares. + * + * @return tokenToShareRatio + */ + @jakarta.annotation.Nullable + public String getTokenToShareRatio() { + return tokenToShareRatio; + } + + public void setTokenToShareRatio(@jakarta.annotation.Nullable String tokenToShareRatio) { + this.tokenToShareRatio = tokenToShareRatio; + } + + public GetRwaTokenListResponseDataInner tags(@jakarta.annotation.Nullable List tags) { + this.tags = tags; + return this; + } + + public GetRwaTokenListResponseDataInner addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Token tag array. Enum: alpha, communityRecognized, volumeSurge, volumePlunge. + * + * @return tags + */ + @jakarta.annotation.Nullable + public List getTags() { + return tags; + } + + public void setTags(@jakarta.annotation.Nullable List tags) { + this.tags = tags; + } + + public GetRwaTokenListResponseDataInner statusInfo( + @jakarta.annotation.Nullable GetRwaTokenListResponseDataInnerStatusInfo statusInfo) { + this.statusInfo = statusInfo; + return this; + } + + /** + * Get statusInfo + * + * @return statusInfo + */ + @jakarta.annotation.Nullable + @Valid + public GetRwaTokenListResponseDataInnerStatusInfo getStatusInfo() { + return statusInfo; + } + + public void setStatusInfo( + @jakarta.annotation.Nullable GetRwaTokenListResponseDataInnerStatusInfo statusInfo) { + this.statusInfo = statusInfo; + } + + public GetRwaTokenListResponseDataInner tokenPrice( + @jakarta.annotation.Nullable String tokenPrice) { + this.tokenPrice = tokenPrice; + return this; + } + + /** + * On-chain token price (USD). + * + * @return tokenPrice + */ + @jakarta.annotation.Nullable + public String getTokenPrice() { + return tokenPrice; + } + + public void setTokenPrice(@jakarta.annotation.Nullable String tokenPrice) { + this.tokenPrice = tokenPrice; + } + + public GetRwaTokenListResponseDataInner referencePrice( + @jakarta.annotation.Nullable String referencePrice) { + this.referencePrice = referencePrice; + return this; + } + + /** + * Underlying reference price (USD). A per-share converted price derived from the on-chain token + * price, not an official quote from the traditional stock market. + * + * @return referencePrice + */ + @jakarta.annotation.Nullable + public String getReferencePrice() { + return referencePrice; + } + + public void setReferencePrice(@jakarta.annotation.Nullable String referencePrice) { + this.referencePrice = referencePrice; + } + + public GetRwaTokenListResponseDataInner volume24H( + @jakarta.annotation.Nullable String volume24H) { + this.volume24H = volume24H; + return this; + } + + /** + * 24-hour trading volume (USD). + * + * @return volume24H + */ + @jakarta.annotation.Nullable + public String getVolume24H() { + return volume24H; + } + + public void setVolume24H(@jakarta.annotation.Nullable String volume24H) { + this.volume24H = volume24H; + } + + public GetRwaTokenListResponseDataInner marketCap( + @jakarta.annotation.Nullable String marketCap) { + this.marketCap = marketCap; + return this; + } + + /** + * Market capitalization (USD). + * + * @return marketCap + */ + @jakarta.annotation.Nullable + public String getMarketCap() { + return marketCap; + } + + public void setMarketCap(@jakarta.annotation.Nullable String marketCap) { + this.marketCap = marketCap; + } + + public GetRwaTokenListResponseDataInner peRatioTTM( + @jakarta.annotation.Nullable String peRatioTTM) { + this.peRatioTTM = peRatioTTM; + return this; + } + + /** + * Price-to-Earnings ratio (TTM). Null when unavailable. + * + * @return peRatioTTM + */ + @jakarta.annotation.Nullable + public String getPeRatioTTM() { + return peRatioTTM; + } + + public void setPeRatioTTM(@jakarta.annotation.Nullable String peRatioTTM) { + this.peRatioTTM = peRatioTTM; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaTokenListResponseDataInner getRwaTokenListResponseDataInner = + (GetRwaTokenListResponseDataInner) o; + return Objects.equals(this.binanceChainId, getRwaTokenListResponseDataInner.binanceChainId) + && Objects.equals( + this.tokenContractAddress, + getRwaTokenListResponseDataInner.tokenContractAddress) + && Objects.equals(this.platformId, getRwaTokenListResponseDataInner.platformId) + && Objects.equals(this.assetType, getRwaTokenListResponseDataInner.assetType) + && Objects.equals(this.tokenName, getRwaTokenListResponseDataInner.tokenName) + && Objects.equals(this.tokenSymbol, getRwaTokenListResponseDataInner.tokenSymbol) + && Objects.equals(this.tokenLogoUrl, getRwaTokenListResponseDataInner.tokenLogoUrl) + && Objects.equals(this.decimals, getRwaTokenListResponseDataInner.decimals) + && Objects.equals( + this.underlyingTicker, getRwaTokenListResponseDataInner.underlyingTicker) + && Objects.equals( + this.underlyingName, getRwaTokenListResponseDataInner.underlyingName) + && Objects.equals( + this.underlyingNameZh, getRwaTokenListResponseDataInner.underlyingNameZh) + && Objects.equals( + this.tokenToShareRatio, getRwaTokenListResponseDataInner.tokenToShareRatio) + && Objects.equals(this.tags, getRwaTokenListResponseDataInner.tags) + && Objects.equals(this.statusInfo, getRwaTokenListResponseDataInner.statusInfo) + && Objects.equals(this.tokenPrice, getRwaTokenListResponseDataInner.tokenPrice) + && Objects.equals( + this.referencePrice, getRwaTokenListResponseDataInner.referencePrice) + && Objects.equals(this.volume24H, getRwaTokenListResponseDataInner.volume24H) + && Objects.equals(this.marketCap, getRwaTokenListResponseDataInner.marketCap) + && Objects.equals(this.peRatioTTM, getRwaTokenListResponseDataInner.peRatioTTM); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + binanceChainId, + tokenContractAddress, + platformId, + assetType, + tokenName, + tokenSymbol, + tokenLogoUrl, + decimals, + underlyingTicker, + underlyingName, + underlyingNameZh, + tokenToShareRatio, + tags, + statusInfo, + tokenPrice, + referencePrice, + volume24H, + marketCap, + peRatioTTM); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaTokenListResponseDataInner {\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" platformId: ").append(toIndentedString(platformId)).append("\n"); + sb.append(" assetType: ").append(toIndentedString(assetType)).append("\n"); + sb.append(" tokenName: ").append(toIndentedString(tokenName)).append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" tokenLogoUrl: ").append(toIndentedString(tokenLogoUrl)).append("\n"); + sb.append(" decimals: ").append(toIndentedString(decimals)).append("\n"); + sb.append(" underlyingTicker: ").append(toIndentedString(underlyingTicker)).append("\n"); + sb.append(" underlyingName: ").append(toIndentedString(underlyingName)).append("\n"); + sb.append(" underlyingNameZh: ").append(toIndentedString(underlyingNameZh)).append("\n"); + sb.append(" tokenToShareRatio: ").append(toIndentedString(tokenToShareRatio)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" statusInfo: ").append(toIndentedString(statusInfo)).append("\n"); + sb.append(" tokenPrice: ").append(toIndentedString(tokenPrice)).append("\n"); + sb.append(" referencePrice: ").append(toIndentedString(referencePrice)).append("\n"); + sb.append(" volume24H: ").append(toIndentedString(volume24H)).append("\n"); + sb.append(" marketCap: ").append(toIndentedString(marketCap)).append("\n"); + sb.append(" peRatioTTM: ").append(toIndentedString(peRatioTTM)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object platformIdValue = getPlatformId(); + String platformIdValueAsString = ""; + platformIdValueAsString = platformIdValue.toString(); + sb.append("platformId=").append(urlEncode(platformIdValueAsString)).append(""); + Object assetTypeValue = getAssetType(); + String assetTypeValueAsString = ""; + assetTypeValueAsString = assetTypeValue.toString(); + sb.append("assetType=").append(urlEncode(assetTypeValueAsString)).append(""); + Object tokenNameValue = getTokenName(); + String tokenNameValueAsString = ""; + tokenNameValueAsString = tokenNameValue.toString(); + sb.append("tokenName=").append(urlEncode(tokenNameValueAsString)).append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object tokenLogoUrlValue = getTokenLogoUrl(); + String tokenLogoUrlValueAsString = ""; + tokenLogoUrlValueAsString = tokenLogoUrlValue.toString(); + sb.append("tokenLogoUrl=").append(urlEncode(tokenLogoUrlValueAsString)).append(""); + Object decimalsValue = getDecimals(); + String decimalsValueAsString = ""; + decimalsValueAsString = decimalsValue.toString(); + sb.append("decimals=").append(urlEncode(decimalsValueAsString)).append(""); + Object underlyingTickerValue = getUnderlyingTicker(); + String underlyingTickerValueAsString = ""; + underlyingTickerValueAsString = underlyingTickerValue.toString(); + sb.append("underlyingTicker=").append(urlEncode(underlyingTickerValueAsString)).append(""); + Object underlyingNameValue = getUnderlyingName(); + String underlyingNameValueAsString = ""; + underlyingNameValueAsString = underlyingNameValue.toString(); + sb.append("underlyingName=").append(urlEncode(underlyingNameValueAsString)).append(""); + Object underlyingNameZhValue = getUnderlyingNameZh(); + String underlyingNameZhValueAsString = ""; + underlyingNameZhValueAsString = underlyingNameZhValue.toString(); + sb.append("underlyingNameZh=").append(urlEncode(underlyingNameZhValueAsString)).append(""); + Object tokenToShareRatioValue = getTokenToShareRatio(); + String tokenToShareRatioValueAsString = ""; + tokenToShareRatioValueAsString = tokenToShareRatioValue.toString(); + sb.append("tokenToShareRatio=") + .append(urlEncode(tokenToShareRatioValueAsString)) + .append(""); + Object tagsValue = getTags(); + String tagsValueAsString = ""; + tagsValueAsString = + (String) + ((Collection) tagsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("tags=").append(urlEncode(tagsValueAsString)).append(""); + Object statusInfoValue = getStatusInfo(); + String statusInfoValueAsString = ""; + statusInfoValueAsString = statusInfoValue.toString(); + sb.append("statusInfo=").append(urlEncode(statusInfoValueAsString)).append(""); + Object tokenPriceValue = getTokenPrice(); + String tokenPriceValueAsString = ""; + tokenPriceValueAsString = tokenPriceValue.toString(); + sb.append("tokenPrice=").append(urlEncode(tokenPriceValueAsString)).append(""); + Object referencePriceValue = getReferencePrice(); + String referencePriceValueAsString = ""; + referencePriceValueAsString = referencePriceValue.toString(); + sb.append("referencePrice=").append(urlEncode(referencePriceValueAsString)).append(""); + Object volume24HValue = getVolume24H(); + String volume24HValueAsString = ""; + volume24HValueAsString = volume24HValue.toString(); + sb.append("volume24H=").append(urlEncode(volume24HValueAsString)).append(""); + Object marketCapValue = getMarketCap(); + String marketCapValueAsString = ""; + marketCapValueAsString = marketCapValue.toString(); + sb.append("marketCap=").append(urlEncode(marketCapValueAsString)).append(""); + Object peRatioTTMValue = getPeRatioTTM(); + String peRatioTTMValueAsString = ""; + peRatioTTMValueAsString = peRatioTTMValue.toString(); + sb.append("peRatioTTM=").append(urlEncode(peRatioTTMValueAsString)).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("binanceChainId"); + openapiFields.add("tokenContractAddress"); + openapiFields.add("platformId"); + openapiFields.add("assetType"); + openapiFields.add("tokenName"); + openapiFields.add("tokenSymbol"); + openapiFields.add("tokenLogoUrl"); + openapiFields.add("decimals"); + openapiFields.add("underlyingTicker"); + openapiFields.add("underlyingName"); + openapiFields.add("underlyingNameZh"); + openapiFields.add("tokenToShareRatio"); + openapiFields.add("tags"); + openapiFields.add("statusInfo"); + openapiFields.add("tokenPrice"); + openapiFields.add("referencePrice"); + openapiFields.add("volume24H"); + openapiFields.add("marketCap"); + openapiFields.add("peRatioTTM"); + + // 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 + * GetRwaTokenListResponseDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaTokenListResponseDataInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaTokenListResponseDataInner is" + + " not found in the empty JSON string", + GetRwaTokenListResponseDataInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("platformId") != null && !jsonObj.get("platformId").isJsonNull()) + && !jsonObj.get("platformId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `platformId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("platformId").toString())); + } + if ((jsonObj.get("tokenName") != null && !jsonObj.get("tokenName").isJsonNull()) + && !jsonObj.get("tokenName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenName").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + if ((jsonObj.get("tokenLogoUrl") != null && !jsonObj.get("tokenLogoUrl").isJsonNull()) + && !jsonObj.get("tokenLogoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenLogoUrl` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenLogoUrl").toString())); + } + if ((jsonObj.get("decimals") != null && !jsonObj.get("decimals").isJsonNull()) + && !jsonObj.get("decimals").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `decimals` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("decimals").toString())); + } + if ((jsonObj.get("underlyingTicker") != null + && !jsonObj.get("underlyingTicker").isJsonNull()) + && !jsonObj.get("underlyingTicker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `underlyingTicker` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("underlyingTicker").toString())); + } + if ((jsonObj.get("underlyingName") != null && !jsonObj.get("underlyingName").isJsonNull()) + && !jsonObj.get("underlyingName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `underlyingName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("underlyingName").toString())); + } + if ((jsonObj.get("underlyingNameZh") != null + && !jsonObj.get("underlyingNameZh").isJsonNull()) + && !jsonObj.get("underlyingNameZh").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `underlyingNameZh` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("underlyingNameZh").toString())); + } + if ((jsonObj.get("tokenToShareRatio") != null + && !jsonObj.get("tokenToShareRatio").isJsonNull()) + && !jsonObj.get("tokenToShareRatio").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenToShareRatio` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("tokenToShareRatio").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null + && !jsonObj.get("tags").isJsonNull() + && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tags` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("tags").toString())); + } + // validate the optional field `statusInfo` + if (jsonObj.get("statusInfo") != null && !jsonObj.get("statusInfo").isJsonNull()) { + GetRwaTokenListResponseDataInnerStatusInfo.validateJsonElement( + jsonObj.get("statusInfo")); + } + if ((jsonObj.get("tokenPrice") != null && !jsonObj.get("tokenPrice").isJsonNull()) + && !jsonObj.get("tokenPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenPrice").toString())); + } + if ((jsonObj.get("referencePrice") != null && !jsonObj.get("referencePrice").isJsonNull()) + && !jsonObj.get("referencePrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `referencePrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("referencePrice").toString())); + } + if ((jsonObj.get("volume24H") != null && !jsonObj.get("volume24H").isJsonNull()) + && !jsonObj.get("volume24H").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volume24H` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("volume24H").toString())); + } + if ((jsonObj.get("marketCap") != null && !jsonObj.get("marketCap").isJsonNull()) + && !jsonObj.get("marketCap").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marketCap` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("marketCap").toString())); + } + if ((jsonObj.get("peRatioTTM") != null && !jsonObj.get("peRatioTTM").isJsonNull()) + && !jsonObj.get("peRatioTTM").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `peRatioTTM` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("peRatioTTM").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaTokenListResponseDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaTokenListResponseDataInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaTokenListResponseDataInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwaTokenListResponseDataInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaTokenListResponseDataInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaTokenListResponseDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaTokenListResponseDataInner + * @throws IOException if the JSON string is invalid with respect to + * GetRwaTokenListResponseDataInner + */ + public static GetRwaTokenListResponseDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaTokenListResponseDataInner.class); + } + + /** + * Convert an instance of GetRwaTokenListResponseDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponseDataInnerStatusInfo.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponseDataInnerStatusInfo.java new file mode 100644 index 0000000..96de73b --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenListResponseDataInnerStatusInfo.java @@ -0,0 +1,437 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.Arrays; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Market status information. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaTokenListResponseDataInnerStatusInfo { + public static final String SERIALIZED_NAME_OPEN_STATE = "openState"; + + @SerializedName(SERIALIZED_NAME_OPEN_STATE) + @jakarta.annotation.Nullable + private Boolean openState; + + public static final String SERIALIZED_NAME_MARKET_STATUS = "marketStatus"; + + @SerializedName(SERIALIZED_NAME_MARKET_STATUS) + @jakarta.annotation.Nullable + private String marketStatus; + + public static final String SERIALIZED_NAME_REASON_CODE = "reasonCode"; + + @SerializedName(SERIALIZED_NAME_REASON_CODE) + @jakarta.annotation.Nullable + private String reasonCode; + + public static final String SERIALIZED_NAME_REASON_MSG = "reasonMsg"; + + @SerializedName(SERIALIZED_NAME_REASON_MSG) + @jakarta.annotation.Nullable + private String reasonMsg; + + public static final String SERIALIZED_NAME_NEXT_OPEN_TIME = "nextOpenTime"; + + @SerializedName(SERIALIZED_NAME_NEXT_OPEN_TIME) + @jakarta.annotation.Nullable + private Long nextOpenTime; + + public static final String SERIALIZED_NAME_NEXT_CLOSE_TIME = "nextCloseTime"; + + @SerializedName(SERIALIZED_NAME_NEXT_CLOSE_TIME) + @jakarta.annotation.Nullable + private Long nextCloseTime; + + public GetRwaTokenListResponseDataInnerStatusInfo() {} + + public GetRwaTokenListResponseDataInnerStatusInfo openState( + @jakarta.annotation.Nullable Boolean openState) { + this.openState = openState; + return this; + } + + /** + * Whether the underlying market is currently tradable. + * + * @return openState + */ + @jakarta.annotation.Nullable + public Boolean getOpenState() { + return openState; + } + + public void setOpenState(@jakarta.annotation.Nullable Boolean openState) { + this.openState = openState; + } + + public GetRwaTokenListResponseDataInnerStatusInfo marketStatus( + @jakarta.annotation.Nullable String marketStatus) { + this.marketStatus = marketStatus; + return this; + } + + /** + * Current market status: premarket, regular (normal hours), postmarket, overnight, closed, or + * pause (trading halt/circuit breaker). + * + * @return marketStatus + */ + @jakarta.annotation.Nullable + public String getMarketStatus() { + return marketStatus; + } + + public void setMarketStatus(@jakarta.annotation.Nullable String marketStatus) { + this.marketStatus = marketStatus; + } + + public GetRwaTokenListResponseDataInnerStatusInfo reasonCode( + @jakarta.annotation.Nullable String reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * Reason code when the market is not tradable (returned when openState=false). + * Market-level: MARKET_CLOSED (closed), MARKET_PAUSED (whole market paused), MARKET_MAINTENANCE + * (system maintenance). Asset-level: ASSET_PAUSED (single asset paused, incl. corporate actions + * — see reasonMsg), ASSET_LIMITED (single asset restricted but not paused, e.g. earnings + * window). Others: TRADING (normal), UNSUPPORTED (not supported). + * + * @return reasonCode + */ + @jakarta.annotation.Nullable + public String getReasonCode() { + return reasonCode; + } + + public void setReasonCode(@jakarta.annotation.Nullable String reasonCode) { + this.reasonCode = reasonCode; + } + + public GetRwaTokenListResponseDataInnerStatusInfo reasonMsg( + @jakarta.annotation.Nullable String reasonMsg) { + this.reasonMsg = reasonMsg; + return this; + } + + /** + * Human-readable reason when the market is not tradable. Common case e.g. \"Weekend or + * Holiday\". For ASSET_PAUSED (corporate actions): cash_dividend, stock_dividend, + * stock_split, merger, acquisition, spinoff, maintenance, corporate action. For ASSET_LIMITED: + * earnings. + * + * @return reasonMsg + */ + @jakarta.annotation.Nullable + public String getReasonMsg() { + return reasonMsg; + } + + public void setReasonMsg(@jakarta.annotation.Nullable String reasonMsg) { + this.reasonMsg = reasonMsg; + } + + public GetRwaTokenListResponseDataInnerStatusInfo nextOpenTime( + @jakarta.annotation.Nullable Long nextOpenTime) { + this.nextOpenTime = nextOpenTime; + return this; + } + + /** + * Expected next market open time, Unix millisecond timestamp. + * + * @return nextOpenTime + */ + @jakarta.annotation.Nullable + public Long getNextOpenTime() { + return nextOpenTime; + } + + public void setNextOpenTime(@jakarta.annotation.Nullable Long nextOpenTime) { + this.nextOpenTime = nextOpenTime; + } + + public GetRwaTokenListResponseDataInnerStatusInfo nextCloseTime( + @jakarta.annotation.Nullable Long nextCloseTime) { + this.nextCloseTime = nextCloseTime; + return this; + } + + /** + * Expected next market close time, Unix millisecond timestamp. + * + * @return nextCloseTime + */ + @jakarta.annotation.Nullable + public Long getNextCloseTime() { + return nextCloseTime; + } + + public void setNextCloseTime(@jakarta.annotation.Nullable Long nextCloseTime) { + this.nextCloseTime = nextCloseTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaTokenListResponseDataInnerStatusInfo getRwaTokenListResponseDataInnerStatusInfo = + (GetRwaTokenListResponseDataInnerStatusInfo) o; + return Objects.equals(this.openState, getRwaTokenListResponseDataInnerStatusInfo.openState) + && Objects.equals( + this.marketStatus, getRwaTokenListResponseDataInnerStatusInfo.marketStatus) + && Objects.equals( + this.reasonCode, getRwaTokenListResponseDataInnerStatusInfo.reasonCode) + && Objects.equals( + this.reasonMsg, getRwaTokenListResponseDataInnerStatusInfo.reasonMsg) + && Objects.equals( + this.nextOpenTime, getRwaTokenListResponseDataInnerStatusInfo.nextOpenTime) + && Objects.equals( + this.nextCloseTime, + getRwaTokenListResponseDataInnerStatusInfo.nextCloseTime); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + openState, marketStatus, reasonCode, reasonMsg, nextOpenTime, nextCloseTime); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaTokenListResponseDataInnerStatusInfo {\n"); + sb.append(" openState: ").append(toIndentedString(openState)).append("\n"); + sb.append(" marketStatus: ").append(toIndentedString(marketStatus)).append("\n"); + sb.append(" reasonCode: ").append(toIndentedString(reasonCode)).append("\n"); + sb.append(" reasonMsg: ").append(toIndentedString(reasonMsg)).append("\n"); + sb.append(" nextOpenTime: ").append(toIndentedString(nextOpenTime)).append("\n"); + sb.append(" nextCloseTime: ").append(toIndentedString(nextCloseTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object openStateValue = getOpenState(); + String openStateValueAsString = ""; + openStateValueAsString = openStateValue.toString(); + sb.append("openState=").append(urlEncode(openStateValueAsString)).append(""); + Object marketStatusValue = getMarketStatus(); + String marketStatusValueAsString = ""; + marketStatusValueAsString = marketStatusValue.toString(); + sb.append("marketStatus=").append(urlEncode(marketStatusValueAsString)).append(""); + Object reasonCodeValue = getReasonCode(); + String reasonCodeValueAsString = ""; + reasonCodeValueAsString = reasonCodeValue.toString(); + sb.append("reasonCode=").append(urlEncode(reasonCodeValueAsString)).append(""); + Object reasonMsgValue = getReasonMsg(); + String reasonMsgValueAsString = ""; + reasonMsgValueAsString = reasonMsgValue.toString(); + sb.append("reasonMsg=").append(urlEncode(reasonMsgValueAsString)).append(""); + Object nextOpenTimeValue = getNextOpenTime(); + String nextOpenTimeValueAsString = ""; + nextOpenTimeValueAsString = nextOpenTimeValue.toString(); + sb.append("nextOpenTime=").append(urlEncode(nextOpenTimeValueAsString)).append(""); + Object nextCloseTimeValue = getNextCloseTime(); + String nextCloseTimeValueAsString = ""; + nextCloseTimeValueAsString = nextCloseTimeValue.toString(); + sb.append("nextCloseTime=").append(urlEncode(nextCloseTimeValueAsString)).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("openState"); + openapiFields.add("marketStatus"); + openapiFields.add("reasonCode"); + openapiFields.add("reasonMsg"); + openapiFields.add("nextOpenTime"); + openapiFields.add("nextCloseTime"); + + // 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 + * GetRwaTokenListResponseDataInnerStatusInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaTokenListResponseDataInnerStatusInfo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwaTokenListResponseDataInnerStatusInfo is not found in" + + " the empty JSON string", + GetRwaTokenListResponseDataInnerStatusInfo.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("marketStatus") != null && !jsonObj.get("marketStatus").isJsonNull()) + && !jsonObj.get("marketStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marketStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("marketStatus").toString())); + } + if ((jsonObj.get("reasonCode") != null && !jsonObj.get("reasonCode").isJsonNull()) + && !jsonObj.get("reasonCode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reasonCode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reasonCode").toString())); + } + if ((jsonObj.get("reasonMsg") != null && !jsonObj.get("reasonMsg").isJsonNull()) + && !jsonObj.get("reasonMsg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reasonMsg` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reasonMsg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaTokenListResponseDataInnerStatusInfo.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwaTokenListResponseDataInnerStatusInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaTokenListResponseDataInnerStatusInfo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwaTokenListResponseDataInnerStatusInfo value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaTokenListResponseDataInnerStatusInfo read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaTokenListResponseDataInnerStatusInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaTokenListResponseDataInnerStatusInfo + * @throws IOException if the JSON string is invalid with respect to + * GetRwaTokenListResponseDataInnerStatusInfo + */ + public static GetRwaTokenListResponseDataInnerStatusInfo fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwaTokenListResponseDataInnerStatusInfo.class); + } + + /** + * Convert an instance of GetRwaTokenListResponseDataInnerStatusInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenPriceResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenPriceResponse.java new file mode 100644 index 0000000..21d72b5 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenPriceResponse.java @@ -0,0 +1,378 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** GetRwaTokenPriceResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaTokenPriceResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private List<@Valid GetRwaTokenPriceResponseDataInner> data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetRwaTokenPriceResponse() {} + + public GetRwaTokenPriceResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetRwaTokenPriceResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Status message. + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetRwaTokenPriceResponse data( + @jakarta.annotation.Nullable List<@Valid GetRwaTokenPriceResponseDataInner> data) { + this.data = data; + return this; + } + + public GetRwaTokenPriceResponse addDataItem(GetRwaTokenPriceResponseDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of token price data. + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetRwaTokenPriceResponseDataInner> getData() { + return data; + } + + public void setData( + @jakarta.annotation.Nullable List<@Valid GetRwaTokenPriceResponseDataInner> data) { + this.data = data; + } + + public GetRwaTokenPriceResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Server response time, Unix millisecond timestamp. + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetRwaTokenPriceResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Whether the request was successful. + * + * @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; + } + GetRwaTokenPriceResponse getRwaTokenPriceResponse = (GetRwaTokenPriceResponse) o; + return Objects.equals(this.code, getRwaTokenPriceResponse.code) + && Objects.equals(this.msg, getRwaTokenPriceResponse.msg) + && Objects.equals(this.data, getRwaTokenPriceResponse.data) + && Objects.equals(this.timestamp, getRwaTokenPriceResponse.timestamp) + && Objects.equals(this.success, getRwaTokenPriceResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaTokenPriceResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = + (String) + ((Collection) dataValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 GetRwaTokenPriceResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaTokenPriceResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaTokenPriceResponse is not found" + + " in the empty JSON string", + GetRwaTokenPriceResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `data` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + GetRwaTokenPriceResponseDataInner.validateJsonElement(jsonArraydata.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaTokenPriceResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaTokenPriceResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetRwaTokenPriceResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwaTokenPriceResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaTokenPriceResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaTokenPriceResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaTokenPriceResponse + * @throws IOException if the JSON string is invalid with respect to GetRwaTokenPriceResponse + */ + public static GetRwaTokenPriceResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaTokenPriceResponse.class); + } + + /** + * Convert an instance of GetRwaTokenPriceResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenPriceResponseDataInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenPriceResponseDataInner.java new file mode 100644 index 0000000..e4d8726 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaTokenPriceResponseDataInner.java @@ -0,0 +1,437 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetRwaTokenPriceResponseDataInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaTokenPriceResponseDataInner { + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_PLATFORM_ID = "platformId"; + + @SerializedName(SERIALIZED_NAME_PLATFORM_ID) + @jakarta.annotation.Nullable + private String platformId; + + public static final String SERIALIZED_NAME_TOKEN_PRICE = "tokenPrice"; + + @SerializedName(SERIALIZED_NAME_TOKEN_PRICE) + @jakarta.annotation.Nullable + private String tokenPrice; + + public static final String SERIALIZED_NAME_REFERENCE_PRICE = "referencePrice"; + + @SerializedName(SERIALIZED_NAME_REFERENCE_PRICE) + @jakarta.annotation.Nullable + private String referencePrice; + + public static final String SERIALIZED_NAME_TOKEN_PRICE_UPDATED_AT = "tokenPriceUpdatedAt"; + + @SerializedName(SERIALIZED_NAME_TOKEN_PRICE_UPDATED_AT) + @jakarta.annotation.Nullable + private Long tokenPriceUpdatedAt; + + public GetRwaTokenPriceResponseDataInner() {} + + public GetRwaTokenPriceResponseDataInner binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, + * \"CT_501\"=Solana). + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetRwaTokenPriceResponseDataInner tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetRwaTokenPriceResponseDataInner platformId( + @jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + return this; + } + + /** + * Unique platform identifier. + * + * @return platformId + */ + @jakarta.annotation.Nullable + public String getPlatformId() { + return platformId; + } + + public void setPlatformId(@jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + } + + public GetRwaTokenPriceResponseDataInner tokenPrice( + @jakarta.annotation.Nullable String tokenPrice) { + this.tokenPrice = tokenPrice; + return this; + } + + /** + * On-chain token price (USD). + * + * @return tokenPrice + */ + @jakarta.annotation.Nullable + public String getTokenPrice() { + return tokenPrice; + } + + public void setTokenPrice(@jakarta.annotation.Nullable String tokenPrice) { + this.tokenPrice = tokenPrice; + } + + public GetRwaTokenPriceResponseDataInner referencePrice( + @jakarta.annotation.Nullable String referencePrice) { + this.referencePrice = referencePrice; + return this; + } + + /** + * Underlying reference price (USD). A per-share converted price derived from the on-chain token + * price, not an official quote from the traditional stock market. + * + * @return referencePrice + */ + @jakarta.annotation.Nullable + public String getReferencePrice() { + return referencePrice; + } + + public void setReferencePrice(@jakarta.annotation.Nullable String referencePrice) { + this.referencePrice = referencePrice; + } + + public GetRwaTokenPriceResponseDataInner tokenPriceUpdatedAt( + @jakarta.annotation.Nullable Long tokenPriceUpdatedAt) { + this.tokenPriceUpdatedAt = tokenPriceUpdatedAt; + return this; + } + + /** + * Token price last updated time, Unix millisecond timestamp. + * + * @return tokenPriceUpdatedAt + */ + @jakarta.annotation.Nullable + public Long getTokenPriceUpdatedAt() { + return tokenPriceUpdatedAt; + } + + public void setTokenPriceUpdatedAt(@jakarta.annotation.Nullable Long tokenPriceUpdatedAt) { + this.tokenPriceUpdatedAt = tokenPriceUpdatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaTokenPriceResponseDataInner getRwaTokenPriceResponseDataInner = + (GetRwaTokenPriceResponseDataInner) o; + return Objects.equals(this.binanceChainId, getRwaTokenPriceResponseDataInner.binanceChainId) + && Objects.equals( + this.tokenContractAddress, + getRwaTokenPriceResponseDataInner.tokenContractAddress) + && Objects.equals(this.platformId, getRwaTokenPriceResponseDataInner.platformId) + && Objects.equals(this.tokenPrice, getRwaTokenPriceResponseDataInner.tokenPrice) + && Objects.equals( + this.referencePrice, getRwaTokenPriceResponseDataInner.referencePrice) + && Objects.equals( + this.tokenPriceUpdatedAt, + getRwaTokenPriceResponseDataInner.tokenPriceUpdatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + binanceChainId, + tokenContractAddress, + platformId, + tokenPrice, + referencePrice, + tokenPriceUpdatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaTokenPriceResponseDataInner {\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" platformId: ").append(toIndentedString(platformId)).append("\n"); + sb.append(" tokenPrice: ").append(toIndentedString(tokenPrice)).append("\n"); + sb.append(" referencePrice: ").append(toIndentedString(referencePrice)).append("\n"); + sb.append(" tokenPriceUpdatedAt: ") + .append(toIndentedString(tokenPriceUpdatedAt)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object platformIdValue = getPlatformId(); + String platformIdValueAsString = ""; + platformIdValueAsString = platformIdValue.toString(); + sb.append("platformId=").append(urlEncode(platformIdValueAsString)).append(""); + Object tokenPriceValue = getTokenPrice(); + String tokenPriceValueAsString = ""; + tokenPriceValueAsString = tokenPriceValue.toString(); + sb.append("tokenPrice=").append(urlEncode(tokenPriceValueAsString)).append(""); + Object referencePriceValue = getReferencePrice(); + String referencePriceValueAsString = ""; + referencePriceValueAsString = referencePriceValue.toString(); + sb.append("referencePrice=").append(urlEncode(referencePriceValueAsString)).append(""); + Object tokenPriceUpdatedAtValue = getTokenPriceUpdatedAt(); + String tokenPriceUpdatedAtValueAsString = ""; + tokenPriceUpdatedAtValueAsString = tokenPriceUpdatedAtValue.toString(); + sb.append("tokenPriceUpdatedAt=") + .append(urlEncode(tokenPriceUpdatedAtValueAsString)) + .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("binanceChainId"); + openapiFields.add("tokenContractAddress"); + openapiFields.add("platformId"); + openapiFields.add("tokenPrice"); + openapiFields.add("referencePrice"); + openapiFields.add("tokenPriceUpdatedAt"); + + // 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 + * GetRwaTokenPriceResponseDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaTokenPriceResponseDataInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaTokenPriceResponseDataInner is" + + " not found in the empty JSON string", + GetRwaTokenPriceResponseDataInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("platformId") != null && !jsonObj.get("platformId").isJsonNull()) + && !jsonObj.get("platformId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `platformId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("platformId").toString())); + } + if ((jsonObj.get("tokenPrice") != null && !jsonObj.get("tokenPrice").isJsonNull()) + && !jsonObj.get("tokenPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenPrice").toString())); + } + if ((jsonObj.get("referencePrice") != null && !jsonObj.get("referencePrice").isJsonNull()) + && !jsonObj.get("referencePrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `referencePrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("referencePrice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaTokenPriceResponseDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaTokenPriceResponseDataInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaTokenPriceResponseDataInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwaTokenPriceResponseDataInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaTokenPriceResponseDataInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaTokenPriceResponseDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaTokenPriceResponseDataInner + * @throws IOException if the JSON string is invalid with respect to + * GetRwaTokenPriceResponseDataInner + */ + public static GetRwaTokenPriceResponseDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaTokenPriceResponseDataInner.class); + } + + /** + * Convert an instance of GetRwaTokenPriceResponseDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponse.java new file mode 100644 index 0000000..a9b8cc5 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponse.java @@ -0,0 +1,350 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetRwaUnderlyingInfoResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaUnderlyingInfoResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetRwaUnderlyingInfoResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetRwaUnderlyingInfoResponse() {} + + public GetRwaUnderlyingInfoResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetRwaUnderlyingInfoResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Status message. + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetRwaUnderlyingInfoResponse data( + @jakarta.annotation.Nullable GetRwaUnderlyingInfoResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetRwaUnderlyingInfoResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetRwaUnderlyingInfoResponseData data) { + this.data = data; + } + + public GetRwaUnderlyingInfoResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Server response time, Unix millisecond timestamp. + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetRwaUnderlyingInfoResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Whether the request was successful. + * + * @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; + } + GetRwaUnderlyingInfoResponse getRwaUnderlyingInfoResponse = + (GetRwaUnderlyingInfoResponse) o; + return Objects.equals(this.code, getRwaUnderlyingInfoResponse.code) + && Objects.equals(this.msg, getRwaUnderlyingInfoResponse.msg) + && Objects.equals(this.data, getRwaUnderlyingInfoResponse.data) + && Objects.equals(this.timestamp, getRwaUnderlyingInfoResponse.timestamp) + && Objects.equals(this.success, getRwaUnderlyingInfoResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaUnderlyingInfoResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * GetRwaUnderlyingInfoResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaUnderlyingInfoResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaUnderlyingInfoResponse is not" + + " found in the empty JSON string", + GetRwaUnderlyingInfoResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetRwaUnderlyingInfoResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaUnderlyingInfoResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaUnderlyingInfoResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaUnderlyingInfoResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwaUnderlyingInfoResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaUnderlyingInfoResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaUnderlyingInfoResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaUnderlyingInfoResponse + * @throws IOException if the JSON string is invalid with respect to + * GetRwaUnderlyingInfoResponse + */ + public static GetRwaUnderlyingInfoResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaUnderlyingInfoResponse.class); + } + + /** + * Convert an instance of GetRwaUnderlyingInfoResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseData.java new file mode 100644 index 0000000..b6b8865 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseData.java @@ -0,0 +1,595 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Underlying company information and protections. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaUnderlyingInfoResponseData { + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_PLATFORM_ID = "platformId"; + + @SerializedName(SERIALIZED_NAME_PLATFORM_ID) + @jakarta.annotation.Nullable + private String platformId; + + public static final String SERIALIZED_NAME_UNDERLYING_TICKER = "underlyingTicker"; + + @SerializedName(SERIALIZED_NAME_UNDERLYING_TICKER) + @jakarta.annotation.Nullable + private String underlyingTicker; + + public static final String SERIALIZED_NAME_UNDERLYING_FULL_NAME = "underlyingFullName"; + + @SerializedName(SERIALIZED_NAME_UNDERLYING_FULL_NAME) + @jakarta.annotation.Nullable + private String underlyingFullName; + + public static final String SERIALIZED_NAME_ASSET_TYPE = "assetType"; + + @SerializedName(SERIALIZED_NAME_ASSET_TYPE) + @jakarta.annotation.Nullable + private Integer assetType; + + public static final String SERIALIZED_NAME_TOKEN_TO_SHARE_RATIO = "tokenToShareRatio"; + + @SerializedName(SERIALIZED_NAME_TOKEN_TO_SHARE_RATIO) + @jakarta.annotation.Nullable + private String tokenToShareRatio; + + public static final String SERIALIZED_NAME_PROTECTIONS = "protections"; + + @SerializedName(SERIALIZED_NAME_PROTECTIONS) + @jakarta.annotation.Nullable + private Map protections; + + public static final String SERIALIZED_NAME_COMPANY_INFO = "companyInfo"; + + @SerializedName(SERIALIZED_NAME_COMPANY_INFO) + @jakarta.annotation.Nullable + private GetRwaUnderlyingInfoResponseDataCompanyInfo companyInfo; + + public GetRwaUnderlyingInfoResponseData() {} + + public GetRwaUnderlyingInfoResponseData binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, + * \"CT_501\"=Solana). + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetRwaUnderlyingInfoResponseData tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetRwaUnderlyingInfoResponseData platformId( + @jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + return this; + } + + /** + * Unique platform identifier. + * + * @return platformId + */ + @jakarta.annotation.Nullable + public String getPlatformId() { + return platformId; + } + + public void setPlatformId(@jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + } + + public GetRwaUnderlyingInfoResponseData underlyingTicker( + @jakarta.annotation.Nullable String underlyingTicker) { + this.underlyingTicker = underlyingTicker; + return this; + } + + /** + * Underlying asset ticker symbol. + * + * @return underlyingTicker + */ + @jakarta.annotation.Nullable + public String getUnderlyingTicker() { + return underlyingTicker; + } + + public void setUnderlyingTicker(@jakarta.annotation.Nullable String underlyingTicker) { + this.underlyingTicker = underlyingTicker; + } + + public GetRwaUnderlyingInfoResponseData underlyingFullName( + @jakarta.annotation.Nullable String underlyingFullName) { + this.underlyingFullName = underlyingFullName; + return this; + } + + /** + * Underlying asset full name. + * + * @return underlyingFullName + */ + @jakarta.annotation.Nullable + public String getUnderlyingFullName() { + return underlyingFullName; + } + + public void setUnderlyingFullName(@jakarta.annotation.Nullable String underlyingFullName) { + this.underlyingFullName = underlyingFullName; + } + + public GetRwaUnderlyingInfoResponseData assetType( + @jakarta.annotation.Nullable Integer assetType) { + this.assetType = assetType; + return this; + } + + /** + * Asset type. 1=Stock, 2=Pre-IPO, 3=ETF. + * + * @return assetType + */ + @jakarta.annotation.Nullable + public Integer getAssetType() { + return assetType; + } + + public void setAssetType(@jakarta.annotation.Nullable Integer assetType) { + this.assetType = assetType; + } + + public GetRwaUnderlyingInfoResponseData tokenToShareRatio( + @jakarta.annotation.Nullable String tokenToShareRatio) { + this.tokenToShareRatio = tokenToShareRatio; + return this; + } + + /** + * Token-to-share exchange ratio. E.g. \"1.003701\" means 1 token ≈ 1.003701 + * underlying shares. + * + * @return tokenToShareRatio + */ + @jakarta.annotation.Nullable + public String getTokenToShareRatio() { + return tokenToShareRatio; + } + + public void setTokenToShareRatio(@jakarta.annotation.Nullable String tokenToShareRatio) { + this.tokenToShareRatio = tokenToShareRatio; + } + + public GetRwaUnderlyingInfoResponseData protections( + @jakarta.annotation.Nullable + Map protections) { + this.protections = protections; + return this; + } + + public GetRwaUnderlyingInfoResponseData putProtectionsItem( + String key, GetRwaUnderlyingInfoResponseDataProtectionsValue protectionsItem) { + if (this.protections == null) { + this.protections = new HashMap<>(); + } + this.protections.put(key, protectionsItem); + return this; + } + + /** + * Investor protection mechanisms, keyed by mechanism type. Each entry includes whether it is + * supported and a related proof/report link. Known keys: dailyAttestationReport, + * monthlyAttestationReport, collateralReport. New keys may be added per platform. + * + * @return protections + */ + @jakarta.annotation.Nullable + @Valid + public Map getProtections() { + return protections; + } + + public void setProtections( + @jakarta.annotation.Nullable + Map protections) { + this.protections = protections; + } + + public GetRwaUnderlyingInfoResponseData companyInfo( + @jakarta.annotation.Nullable GetRwaUnderlyingInfoResponseDataCompanyInfo companyInfo) { + this.companyInfo = companyInfo; + return this; + } + + /** + * Get companyInfo + * + * @return companyInfo + */ + @jakarta.annotation.Nullable + @Valid + public GetRwaUnderlyingInfoResponseDataCompanyInfo getCompanyInfo() { + return companyInfo; + } + + public void setCompanyInfo( + @jakarta.annotation.Nullable GetRwaUnderlyingInfoResponseDataCompanyInfo companyInfo) { + this.companyInfo = companyInfo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaUnderlyingInfoResponseData getRwaUnderlyingInfoResponseData = + (GetRwaUnderlyingInfoResponseData) o; + return Objects.equals(this.binanceChainId, getRwaUnderlyingInfoResponseData.binanceChainId) + && Objects.equals( + this.tokenContractAddress, + getRwaUnderlyingInfoResponseData.tokenContractAddress) + && Objects.equals(this.platformId, getRwaUnderlyingInfoResponseData.platformId) + && Objects.equals( + this.underlyingTicker, getRwaUnderlyingInfoResponseData.underlyingTicker) + && Objects.equals( + this.underlyingFullName, + getRwaUnderlyingInfoResponseData.underlyingFullName) + && Objects.equals(this.assetType, getRwaUnderlyingInfoResponseData.assetType) + && Objects.equals( + this.tokenToShareRatio, getRwaUnderlyingInfoResponseData.tokenToShareRatio) + && Objects.equals(this.protections, getRwaUnderlyingInfoResponseData.protections) + && Objects.equals(this.companyInfo, getRwaUnderlyingInfoResponseData.companyInfo); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + binanceChainId, + tokenContractAddress, + platformId, + underlyingTicker, + underlyingFullName, + assetType, + tokenToShareRatio, + protections, + companyInfo); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaUnderlyingInfoResponseData {\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" platformId: ").append(toIndentedString(platformId)).append("\n"); + sb.append(" underlyingTicker: ").append(toIndentedString(underlyingTicker)).append("\n"); + sb.append(" underlyingFullName: ") + .append(toIndentedString(underlyingFullName)) + .append("\n"); + sb.append(" assetType: ").append(toIndentedString(assetType)).append("\n"); + sb.append(" tokenToShareRatio: ").append(toIndentedString(tokenToShareRatio)).append("\n"); + sb.append(" protections: ").append(toIndentedString(protections)).append("\n"); + sb.append(" companyInfo: ").append(toIndentedString(companyInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object platformIdValue = getPlatformId(); + String platformIdValueAsString = ""; + platformIdValueAsString = platformIdValue.toString(); + sb.append("platformId=").append(urlEncode(platformIdValueAsString)).append(""); + Object underlyingTickerValue = getUnderlyingTicker(); + String underlyingTickerValueAsString = ""; + underlyingTickerValueAsString = underlyingTickerValue.toString(); + sb.append("underlyingTicker=").append(urlEncode(underlyingTickerValueAsString)).append(""); + Object underlyingFullNameValue = getUnderlyingFullName(); + String underlyingFullNameValueAsString = ""; + underlyingFullNameValueAsString = underlyingFullNameValue.toString(); + sb.append("underlyingFullName=") + .append(urlEncode(underlyingFullNameValueAsString)) + .append(""); + Object assetTypeValue = getAssetType(); + String assetTypeValueAsString = ""; + assetTypeValueAsString = assetTypeValue.toString(); + sb.append("assetType=").append(urlEncode(assetTypeValueAsString)).append(""); + Object tokenToShareRatioValue = getTokenToShareRatio(); + String tokenToShareRatioValueAsString = ""; + tokenToShareRatioValueAsString = tokenToShareRatioValue.toString(); + sb.append("tokenToShareRatio=") + .append(urlEncode(tokenToShareRatioValueAsString)) + .append(""); + Object protectionsValue = getProtections(); + String protectionsValueAsString = ""; + protectionsValueAsString = protectionsValue.toString(); + sb.append("protections=").append(urlEncode(protectionsValueAsString)).append(""); + Object companyInfoValue = getCompanyInfo(); + String companyInfoValueAsString = ""; + companyInfoValueAsString = companyInfoValue.toString(); + sb.append("companyInfo=").append(urlEncode(companyInfoValueAsString)).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("binanceChainId"); + openapiFields.add("tokenContractAddress"); + openapiFields.add("platformId"); + openapiFields.add("underlyingTicker"); + openapiFields.add("underlyingFullName"); + openapiFields.add("assetType"); + openapiFields.add("tokenToShareRatio"); + openapiFields.add("protections"); + openapiFields.add("companyInfo"); + + // 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 + * GetRwaUnderlyingInfoResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaUnderlyingInfoResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaUnderlyingInfoResponseData is" + + " not found in the empty JSON string", + GetRwaUnderlyingInfoResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("platformId") != null && !jsonObj.get("platformId").isJsonNull()) + && !jsonObj.get("platformId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `platformId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("platformId").toString())); + } + if ((jsonObj.get("underlyingTicker") != null + && !jsonObj.get("underlyingTicker").isJsonNull()) + && !jsonObj.get("underlyingTicker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `underlyingTicker` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("underlyingTicker").toString())); + } + if ((jsonObj.get("underlyingFullName") != null + && !jsonObj.get("underlyingFullName").isJsonNull()) + && !jsonObj.get("underlyingFullName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `underlyingFullName` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("underlyingFullName").toString())); + } + if ((jsonObj.get("tokenToShareRatio") != null + && !jsonObj.get("tokenToShareRatio").isJsonNull()) + && !jsonObj.get("tokenToShareRatio").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenToShareRatio` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("tokenToShareRatio").toString())); + } + // validate the optional field `companyInfo` + if (jsonObj.get("companyInfo") != null && !jsonObj.get("companyInfo").isJsonNull()) { + GetRwaUnderlyingInfoResponseDataCompanyInfo.validateJsonElement( + jsonObj.get("companyInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaUnderlyingInfoResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaUnderlyingInfoResponseData' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaUnderlyingInfoResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwaUnderlyingInfoResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaUnderlyingInfoResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaUnderlyingInfoResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaUnderlyingInfoResponseData + * @throws IOException if the JSON string is invalid with respect to + * GetRwaUnderlyingInfoResponseData + */ + public static GetRwaUnderlyingInfoResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaUnderlyingInfoResponseData.class); + } + + /** + * Convert an instance of GetRwaUnderlyingInfoResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseDataCompanyInfo.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseDataCompanyInfo.java new file mode 100644 index 0000000..9fc6dd5 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseDataCompanyInfo.java @@ -0,0 +1,527 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.ArrayList; +import java.util.Arrays; +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.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Underlying company information; for ETF type, returns fund company info (e.g. Invesco, iShares). + */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaUnderlyingInfoResponseDataCompanyInfo { + public static final String SERIALIZED_NAME_CEO = "ceo"; + + @SerializedName(SERIALIZED_NAME_CEO) + @jakarta.annotation.Nullable + private String ceo; + + public static final String SERIALIZED_NAME_WEBSITE = "website"; + + @SerializedName(SERIALIZED_NAME_WEBSITE) + @jakarta.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_INDUSTRY = "industry"; + + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @jakarta.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_CONCEPTS_EN = "conceptsEn"; + + @SerializedName(SERIALIZED_NAME_CONCEPTS_EN) + @jakarta.annotation.Nullable + private List conceptsEn; + + public static final String SERIALIZED_NAME_CONCEPTS_CN = "conceptsCn"; + + @SerializedName(SERIALIZED_NAME_CONCEPTS_CN) + @jakarta.annotation.Nullable + private List conceptsCn; + + public static final String SERIALIZED_NAME_DESCRIPTION_EN = "descriptionEn"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION_EN) + @jakarta.annotation.Nullable + private String descriptionEn; + + public static final String SERIALIZED_NAME_DESCRIPTION_ZH = "descriptionZh"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION_ZH) + @jakarta.annotation.Nullable + private String descriptionZh; + + public GetRwaUnderlyingInfoResponseDataCompanyInfo() {} + + public GetRwaUnderlyingInfoResponseDataCompanyInfo ceo( + @jakarta.annotation.Nullable String ceo) { + this.ceo = ceo; + return this; + } + + /** + * CEO name. + * + * @return ceo + */ + @jakarta.annotation.Nullable + public String getCeo() { + return ceo; + } + + public void setCeo(@jakarta.annotation.Nullable String ceo) { + this.ceo = ceo; + } + + public GetRwaUnderlyingInfoResponseDataCompanyInfo website( + @jakarta.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Company official website. + * + * @return website + */ + @jakarta.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@jakarta.annotation.Nullable String website) { + this.website = website; + } + + public GetRwaUnderlyingInfoResponseDataCompanyInfo industry( + @jakarta.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Industry (English). + * + * @return industry + */ + @jakarta.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@jakarta.annotation.Nullable String industry) { + this.industry = industry; + } + + public GetRwaUnderlyingInfoResponseDataCompanyInfo conceptsEn( + @jakarta.annotation.Nullable List conceptsEn) { + this.conceptsEn = conceptsEn; + return this; + } + + public GetRwaUnderlyingInfoResponseDataCompanyInfo addConceptsEnItem(String conceptsEnItem) { + if (this.conceptsEn == null) { + this.conceptsEn = new ArrayList<>(); + } + this.conceptsEn.add(conceptsEnItem); + return this; + } + + /** + * Concept/sector tags (English). + * + * @return conceptsEn + */ + @jakarta.annotation.Nullable + public List getConceptsEn() { + return conceptsEn; + } + + public void setConceptsEn(@jakarta.annotation.Nullable List conceptsEn) { + this.conceptsEn = conceptsEn; + } + + public GetRwaUnderlyingInfoResponseDataCompanyInfo conceptsCn( + @jakarta.annotation.Nullable List conceptsCn) { + this.conceptsCn = conceptsCn; + return this; + } + + public GetRwaUnderlyingInfoResponseDataCompanyInfo addConceptsCnItem(String conceptsCnItem) { + if (this.conceptsCn == null) { + this.conceptsCn = new ArrayList<>(); + } + this.conceptsCn.add(conceptsCnItem); + return this; + } + + /** + * Concept/sector tags (Chinese). + * + * @return conceptsCn + */ + @jakarta.annotation.Nullable + public List getConceptsCn() { + return conceptsCn; + } + + public void setConceptsCn(@jakarta.annotation.Nullable List conceptsCn) { + this.conceptsCn = conceptsCn; + } + + public GetRwaUnderlyingInfoResponseDataCompanyInfo descriptionEn( + @jakarta.annotation.Nullable String descriptionEn) { + this.descriptionEn = descriptionEn; + return this; + } + + /** + * Company description (English). + * + * @return descriptionEn + */ + @jakarta.annotation.Nullable + public String getDescriptionEn() { + return descriptionEn; + } + + public void setDescriptionEn(@jakarta.annotation.Nullable String descriptionEn) { + this.descriptionEn = descriptionEn; + } + + public GetRwaUnderlyingInfoResponseDataCompanyInfo descriptionZh( + @jakarta.annotation.Nullable String descriptionZh) { + this.descriptionZh = descriptionZh; + return this; + } + + /** + * Company description (Chinese). + * + * @return descriptionZh + */ + @jakarta.annotation.Nullable + public String getDescriptionZh() { + return descriptionZh; + } + + public void setDescriptionZh(@jakarta.annotation.Nullable String descriptionZh) { + this.descriptionZh = descriptionZh; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaUnderlyingInfoResponseDataCompanyInfo getRwaUnderlyingInfoResponseDataCompanyInfo = + (GetRwaUnderlyingInfoResponseDataCompanyInfo) o; + return Objects.equals(this.ceo, getRwaUnderlyingInfoResponseDataCompanyInfo.ceo) + && Objects.equals(this.website, getRwaUnderlyingInfoResponseDataCompanyInfo.website) + && Objects.equals( + this.industry, getRwaUnderlyingInfoResponseDataCompanyInfo.industry) + && Objects.equals( + this.conceptsEn, getRwaUnderlyingInfoResponseDataCompanyInfo.conceptsEn) + && Objects.equals( + this.conceptsCn, getRwaUnderlyingInfoResponseDataCompanyInfo.conceptsCn) + && Objects.equals( + this.descriptionEn, + getRwaUnderlyingInfoResponseDataCompanyInfo.descriptionEn) + && Objects.equals( + this.descriptionZh, + getRwaUnderlyingInfoResponseDataCompanyInfo.descriptionZh); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + ceo, website, industry, conceptsEn, conceptsCn, descriptionEn, descriptionZh); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaUnderlyingInfoResponseDataCompanyInfo {\n"); + sb.append(" ceo: ").append(toIndentedString(ceo)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" conceptsEn: ").append(toIndentedString(conceptsEn)).append("\n"); + sb.append(" conceptsCn: ").append(toIndentedString(conceptsCn)).append("\n"); + sb.append(" descriptionEn: ").append(toIndentedString(descriptionEn)).append("\n"); + sb.append(" descriptionZh: ").append(toIndentedString(descriptionZh)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object ceoValue = getCeo(); + String ceoValueAsString = ""; + ceoValueAsString = ceoValue.toString(); + sb.append("ceo=").append(urlEncode(ceoValueAsString)).append(""); + Object websiteValue = getWebsite(); + String websiteValueAsString = ""; + websiteValueAsString = websiteValue.toString(); + sb.append("website=").append(urlEncode(websiteValueAsString)).append(""); + Object industryValue = getIndustry(); + String industryValueAsString = ""; + industryValueAsString = industryValue.toString(); + sb.append("industry=").append(urlEncode(industryValueAsString)).append(""); + Object conceptsEnValue = getConceptsEn(); + String conceptsEnValueAsString = ""; + conceptsEnValueAsString = + (String) + ((Collection) conceptsEnValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("conceptsEn=").append(urlEncode(conceptsEnValueAsString)).append(""); + Object conceptsCnValue = getConceptsCn(); + String conceptsCnValueAsString = ""; + conceptsCnValueAsString = + (String) + ((Collection) conceptsCnValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("conceptsCn=").append(urlEncode(conceptsCnValueAsString)).append(""); + Object descriptionEnValue = getDescriptionEn(); + String descriptionEnValueAsString = ""; + descriptionEnValueAsString = descriptionEnValue.toString(); + sb.append("descriptionEn=").append(urlEncode(descriptionEnValueAsString)).append(""); + Object descriptionZhValue = getDescriptionZh(); + String descriptionZhValueAsString = ""; + descriptionZhValueAsString = descriptionZhValue.toString(); + sb.append("descriptionZh=").append(urlEncode(descriptionZhValueAsString)).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("ceo"); + openapiFields.add("website"); + openapiFields.add("industry"); + openapiFields.add("conceptsEn"); + openapiFields.add("conceptsCn"); + openapiFields.add("descriptionEn"); + openapiFields.add("descriptionZh"); + + // 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 + * GetRwaUnderlyingInfoResponseDataCompanyInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaUnderlyingInfoResponseDataCompanyInfo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwaUnderlyingInfoResponseDataCompanyInfo is not found in" + + " the empty JSON string", + GetRwaUnderlyingInfoResponseDataCompanyInfo.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ceo") != null && !jsonObj.get("ceo").isJsonNull()) + && !jsonObj.get("ceo").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ceo` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ceo").toString())); + } + if ((jsonObj.get("website") != null && !jsonObj.get("website").isJsonNull()) + && !jsonObj.get("website").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `website` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("website").toString())); + } + if ((jsonObj.get("industry") != null && !jsonObj.get("industry").isJsonNull()) + && !jsonObj.get("industry").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `industry` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("industry").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("conceptsEn") != null + && !jsonObj.get("conceptsEn").isJsonNull() + && !jsonObj.get("conceptsEn").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `conceptsEn` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("conceptsEn").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("conceptsCn") != null + && !jsonObj.get("conceptsCn").isJsonNull() + && !jsonObj.get("conceptsCn").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `conceptsCn` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("conceptsCn").toString())); + } + if ((jsonObj.get("descriptionEn") != null && !jsonObj.get("descriptionEn").isJsonNull()) + && !jsonObj.get("descriptionEn").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `descriptionEn` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("descriptionEn").toString())); + } + if ((jsonObj.get("descriptionZh") != null && !jsonObj.get("descriptionZh").isJsonNull()) + && !jsonObj.get("descriptionZh").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `descriptionZh` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("descriptionZh").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaUnderlyingInfoResponseDataCompanyInfo.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwaUnderlyingInfoResponseDataCompanyInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaUnderlyingInfoResponseDataCompanyInfo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwaUnderlyingInfoResponseDataCompanyInfo value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaUnderlyingInfoResponseDataCompanyInfo read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaUnderlyingInfoResponseDataCompanyInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaUnderlyingInfoResponseDataCompanyInfo + * @throws IOException if the JSON string is invalid with respect to + * GetRwaUnderlyingInfoResponseDataCompanyInfo + */ + public static GetRwaUnderlyingInfoResponseDataCompanyInfo fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwaUnderlyingInfoResponseDataCompanyInfo.class); + } + + /** + * Convert an instance of GetRwaUnderlyingInfoResponseDataCompanyInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseDataProtectionsValue.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseDataProtectionsValue.java new file mode 100644 index 0000000..7643e0d --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingInfoResponseDataProtectionsValue.java @@ -0,0 +1,279 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.Arrays; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** GetRwaUnderlyingInfoResponseDataProtectionsValue */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaUnderlyingInfoResponseDataProtectionsValue { + public static final String SERIALIZED_NAME_SUPPORTED = "supported"; + + @SerializedName(SERIALIZED_NAME_SUPPORTED) + @jakarta.annotation.Nullable + private Boolean supported; + + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + @jakarta.annotation.Nullable + private String url; + + public GetRwaUnderlyingInfoResponseDataProtectionsValue() {} + + public GetRwaUnderlyingInfoResponseDataProtectionsValue supported( + @jakarta.annotation.Nullable Boolean supported) { + this.supported = supported; + return this; + } + + /** + * Whether this protection is supported. + * + * @return supported + */ + @jakarta.annotation.Nullable + public Boolean getSupported() { + return supported; + } + + public void setSupported(@jakarta.annotation.Nullable Boolean supported) { + this.supported = supported; + } + + public GetRwaUnderlyingInfoResponseDataProtectionsValue url( + @jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * URL to related report or proof. + * + * @return url + */ + @jakarta.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaUnderlyingInfoResponseDataProtectionsValue + getRwaUnderlyingInfoResponseDataProtectionsValue = + (GetRwaUnderlyingInfoResponseDataProtectionsValue) o; + return Objects.equals( + this.supported, getRwaUnderlyingInfoResponseDataProtectionsValue.supported) + && Objects.equals(this.url, getRwaUnderlyingInfoResponseDataProtectionsValue.url); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(supported, url); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaUnderlyingInfoResponseDataProtectionsValue {\n"); + sb.append(" supported: ").append(toIndentedString(supported)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object supportedValue = getSupported(); + String supportedValueAsString = ""; + supportedValueAsString = supportedValue.toString(); + sb.append("supported=").append(urlEncode(supportedValueAsString)).append(""); + Object urlValue = getUrl(); + String urlValueAsString = ""; + urlValueAsString = urlValue.toString(); + sb.append("url=").append(urlEncode(urlValueAsString)).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("supported"); + openapiFields.add("url"); + + // 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 + * GetRwaUnderlyingInfoResponseDataProtectionsValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaUnderlyingInfoResponseDataProtectionsValue.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwaUnderlyingInfoResponseDataProtectionsValue is not" + + " found in the empty JSON string", + GetRwaUnderlyingInfoResponseDataProtectionsValue + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) + && !jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `url` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaUnderlyingInfoResponseDataProtectionsValue.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwaUnderlyingInfoResponseDataProtectionsValue' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetRwaUnderlyingInfoResponseDataProtectionsValue.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetRwaUnderlyingInfoResponseDataProtectionsValue value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaUnderlyingInfoResponseDataProtectionsValue read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaUnderlyingInfoResponseDataProtectionsValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaUnderlyingInfoResponseDataProtectionsValue + * @throws IOException if the JSON string is invalid with respect to + * GetRwaUnderlyingInfoResponseDataProtectionsValue + */ + public static GetRwaUnderlyingInfoResponseDataProtectionsValue fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwaUnderlyingInfoResponseDataProtectionsValue.class); + } + + /** + * Convert an instance of GetRwaUnderlyingInfoResponseDataProtectionsValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponse.java new file mode 100644 index 0000000..b0b9172 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponse.java @@ -0,0 +1,355 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetRwaUnderlyingMarketDataResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaUnderlyingMarketDataResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetRwaUnderlyingMarketDataResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetRwaUnderlyingMarketDataResponse() {} + + public GetRwaUnderlyingMarketDataResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetRwaUnderlyingMarketDataResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Status message. + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetRwaUnderlyingMarketDataResponse data( + @jakarta.annotation.Nullable GetRwaUnderlyingMarketDataResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetRwaUnderlyingMarketDataResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetRwaUnderlyingMarketDataResponseData data) { + this.data = data; + } + + public GetRwaUnderlyingMarketDataResponse timestamp( + @jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Server response time, Unix millisecond timestamp. + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetRwaUnderlyingMarketDataResponse success( + @jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Whether the request was successful. + * + * @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; + } + GetRwaUnderlyingMarketDataResponse getRwaUnderlyingMarketDataResponse = + (GetRwaUnderlyingMarketDataResponse) o; + return Objects.equals(this.code, getRwaUnderlyingMarketDataResponse.code) + && Objects.equals(this.msg, getRwaUnderlyingMarketDataResponse.msg) + && Objects.equals(this.data, getRwaUnderlyingMarketDataResponse.data) + && Objects.equals(this.timestamp, getRwaUnderlyingMarketDataResponse.timestamp) + && Objects.equals(this.success, getRwaUnderlyingMarketDataResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaUnderlyingMarketDataResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * GetRwaUnderlyingMarketDataResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaUnderlyingMarketDataResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaUnderlyingMarketDataResponse is" + + " not found in the empty JSON string", + GetRwaUnderlyingMarketDataResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetRwaUnderlyingMarketDataResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaUnderlyingMarketDataResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaUnderlyingMarketDataResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaUnderlyingMarketDataResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRwaUnderlyingMarketDataResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaUnderlyingMarketDataResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaUnderlyingMarketDataResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaUnderlyingMarketDataResponse + * @throws IOException if the JSON string is invalid with respect to + * GetRwaUnderlyingMarketDataResponse + */ + public static GetRwaUnderlyingMarketDataResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaUnderlyingMarketDataResponse.class); + } + + /** + * Convert an instance of GetRwaUnderlyingMarketDataResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseData.java new file mode 100644 index 0000000..40aa297 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseData.java @@ -0,0 +1,438 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Underlying market data for the RWA token. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaUnderlyingMarketDataResponseData { + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_PLATFORM_ID = "platformId"; + + @SerializedName(SERIALIZED_NAME_PLATFORM_ID) + @jakarta.annotation.Nullable + private String platformId; + + public static final String SERIALIZED_NAME_ASSET_TYPE = "assetType"; + + @SerializedName(SERIALIZED_NAME_ASSET_TYPE) + @jakarta.annotation.Nullable + private Integer assetType; + + public static final String SERIALIZED_NAME_STATUS_INFO = "statusInfo"; + + @SerializedName(SERIALIZED_NAME_STATUS_INFO) + @jakarta.annotation.Nullable + private GetRwaUnderlyingMarketDataResponseDataStatusInfo statusInfo; + + public static final String SERIALIZED_NAME_MARKET_DATA = "marketData"; + + @SerializedName(SERIALIZED_NAME_MARKET_DATA) + @jakarta.annotation.Nullable + private GetRwaUnderlyingMarketDataResponseDataMarketData marketData; + + public GetRwaUnderlyingMarketDataResponseData() {} + + public GetRwaUnderlyingMarketDataResponseData binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, + * \"CT_501\"=Solana). + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetRwaUnderlyingMarketDataResponseData tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetRwaUnderlyingMarketDataResponseData platformId( + @jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + return this; + } + + /** + * Unique platform identifier. + * + * @return platformId + */ + @jakarta.annotation.Nullable + public String getPlatformId() { + return platformId; + } + + public void setPlatformId(@jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + } + + public GetRwaUnderlyingMarketDataResponseData assetType( + @jakarta.annotation.Nullable Integer assetType) { + this.assetType = assetType; + return this; + } + + /** + * Asset type. 1=Stock, 2=Pre-IPO, 3=ETF. + * + * @return assetType + */ + @jakarta.annotation.Nullable + public Integer getAssetType() { + return assetType; + } + + public void setAssetType(@jakarta.annotation.Nullable Integer assetType) { + this.assetType = assetType; + } + + public GetRwaUnderlyingMarketDataResponseData statusInfo( + @jakarta.annotation.Nullable + GetRwaUnderlyingMarketDataResponseDataStatusInfo statusInfo) { + this.statusInfo = statusInfo; + return this; + } + + /** + * Get statusInfo + * + * @return statusInfo + */ + @jakarta.annotation.Nullable + @Valid + public GetRwaUnderlyingMarketDataResponseDataStatusInfo getStatusInfo() { + return statusInfo; + } + + public void setStatusInfo( + @jakarta.annotation.Nullable + GetRwaUnderlyingMarketDataResponseDataStatusInfo statusInfo) { + this.statusInfo = statusInfo; + } + + public GetRwaUnderlyingMarketDataResponseData marketData( + @jakarta.annotation.Nullable + GetRwaUnderlyingMarketDataResponseDataMarketData marketData) { + this.marketData = marketData; + return this; + } + + /** + * Get marketData + * + * @return marketData + */ + @jakarta.annotation.Nullable + @Valid + public GetRwaUnderlyingMarketDataResponseDataMarketData getMarketData() { + return marketData; + } + + public void setMarketData( + @jakarta.annotation.Nullable + GetRwaUnderlyingMarketDataResponseDataMarketData marketData) { + this.marketData = marketData; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaUnderlyingMarketDataResponseData getRwaUnderlyingMarketDataResponseData = + (GetRwaUnderlyingMarketDataResponseData) o; + return Objects.equals( + this.binanceChainId, getRwaUnderlyingMarketDataResponseData.binanceChainId) + && Objects.equals( + this.tokenContractAddress, + getRwaUnderlyingMarketDataResponseData.tokenContractAddress) + && Objects.equals( + this.platformId, getRwaUnderlyingMarketDataResponseData.platformId) + && Objects.equals(this.assetType, getRwaUnderlyingMarketDataResponseData.assetType) + && Objects.equals( + this.statusInfo, getRwaUnderlyingMarketDataResponseData.statusInfo) + && Objects.equals( + this.marketData, getRwaUnderlyingMarketDataResponseData.marketData); + } + + @Override + public int hashCode() { + return Objects.hash( + binanceChainId, + tokenContractAddress, + platformId, + assetType, + statusInfo, + marketData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaUnderlyingMarketDataResponseData {\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" platformId: ").append(toIndentedString(platformId)).append("\n"); + sb.append(" assetType: ").append(toIndentedString(assetType)).append("\n"); + sb.append(" statusInfo: ").append(toIndentedString(statusInfo)).append("\n"); + sb.append(" marketData: ").append(toIndentedString(marketData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object platformIdValue = getPlatformId(); + String platformIdValueAsString = ""; + platformIdValueAsString = platformIdValue.toString(); + sb.append("platformId=").append(urlEncode(platformIdValueAsString)).append(""); + Object assetTypeValue = getAssetType(); + String assetTypeValueAsString = ""; + assetTypeValueAsString = assetTypeValue.toString(); + sb.append("assetType=").append(urlEncode(assetTypeValueAsString)).append(""); + Object statusInfoValue = getStatusInfo(); + String statusInfoValueAsString = ""; + statusInfoValueAsString = statusInfoValue.toString(); + sb.append("statusInfo=").append(urlEncode(statusInfoValueAsString)).append(""); + Object marketDataValue = getMarketData(); + String marketDataValueAsString = ""; + marketDataValueAsString = marketDataValue.toString(); + sb.append("marketData=").append(urlEncode(marketDataValueAsString)).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("binanceChainId"); + openapiFields.add("tokenContractAddress"); + openapiFields.add("platformId"); + openapiFields.add("assetType"); + openapiFields.add("statusInfo"); + openapiFields.add("marketData"); + + // 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 + * GetRwaUnderlyingMarketDataResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaUnderlyingMarketDataResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRwaUnderlyingMarketDataResponseData" + + " is not found in the empty JSON string", + GetRwaUnderlyingMarketDataResponseData.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("platformId") != null && !jsonObj.get("platformId").isJsonNull()) + && !jsonObj.get("platformId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `platformId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("platformId").toString())); + } + // validate the optional field `statusInfo` + if (jsonObj.get("statusInfo") != null && !jsonObj.get("statusInfo").isJsonNull()) { + GetRwaUnderlyingMarketDataResponseDataStatusInfo.validateJsonElement( + jsonObj.get("statusInfo")); + } + // validate the optional field `marketData` + if (jsonObj.get("marketData") != null && !jsonObj.get("marketData").isJsonNull()) { + GetRwaUnderlyingMarketDataResponseDataMarketData.validateJsonElement( + jsonObj.get("marketData")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaUnderlyingMarketDataResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRwaUnderlyingMarketDataResponseData' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetRwaUnderlyingMarketDataResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetRwaUnderlyingMarketDataResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaUnderlyingMarketDataResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaUnderlyingMarketDataResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaUnderlyingMarketDataResponseData + * @throws IOException if the JSON string is invalid with respect to + * GetRwaUnderlyingMarketDataResponseData + */ + public static GetRwaUnderlyingMarketDataResponseData fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetRwaUnderlyingMarketDataResponseData.class); + } + + /** + * Convert an instance of GetRwaUnderlyingMarketDataResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseDataMarketData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseDataMarketData.java new file mode 100644 index 0000000..1df0c51 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseDataMarketData.java @@ -0,0 +1,775 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.Arrays; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Underlying asset market data. Fields vary by asset type. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaUnderlyingMarketDataResponseDataMarketData { + public static final String SERIALIZED_NAME_REFERENCE_PRICE = "referencePrice"; + + @SerializedName(SERIALIZED_NAME_REFERENCE_PRICE) + @jakarta.annotation.Nullable + private String referencePrice; + + public static final String SERIALIZED_NAME_HIGH52_W = "high52W"; + + @SerializedName(SERIALIZED_NAME_HIGH52_W) + @jakarta.annotation.Nullable + private String high52W; + + public static final String SERIALIZED_NAME_LOW52_W = "low52W"; + + @SerializedName(SERIALIZED_NAME_LOW52_W) + @jakarta.annotation.Nullable + private String low52W; + + public static final String SERIALIZED_NAME_VOLUME_SHARES24_H = "volumeShares24H"; + + @SerializedName(SERIALIZED_NAME_VOLUME_SHARES24_H) + @jakarta.annotation.Nullable + private String volumeShares24H; + + public static final String SERIALIZED_NAME_AVG_DAILY_VOLUME1_Y = "avgDailyVolume1Y"; + + @SerializedName(SERIALIZED_NAME_AVG_DAILY_VOLUME1_Y) + @jakarta.annotation.Nullable + private String avgDailyVolume1Y; + + public static final String SERIALIZED_NAME_TOTAL_SHARES = "totalShares"; + + @SerializedName(SERIALIZED_NAME_TOTAL_SHARES) + @jakarta.annotation.Nullable + private String totalShares; + + public static final String SERIALIZED_NAME_MARKET_CAP = "marketCap"; + + @SerializedName(SERIALIZED_NAME_MARKET_CAP) + @jakarta.annotation.Nullable + private String marketCap; + + public static final String SERIALIZED_NAME_TURNOVER_RATE = "turnoverRate"; + + @SerializedName(SERIALIZED_NAME_TURNOVER_RATE) + @jakarta.annotation.Nullable + private String turnoverRate; + + public static final String SERIALIZED_NAME_AMPLITUDE = "amplitude"; + + @SerializedName(SERIALIZED_NAME_AMPLITUDE) + @jakarta.annotation.Nullable + private String amplitude; + + public static final String SERIALIZED_NAME_PE_RATIO_T_T_M = "peRatioTTM"; + + @SerializedName(SERIALIZED_NAME_PE_RATIO_T_T_M) + @jakarta.annotation.Nullable + private String peRatioTTM; + + public static final String SERIALIZED_NAME_PB_RATIO = "pbRatio"; + + @SerializedName(SERIALIZED_NAME_PB_RATIO) + @jakarta.annotation.Nullable + private String pbRatio; + + public static final String SERIALIZED_NAME_DIVIDEND_YIELD = "dividendYield"; + + @SerializedName(SERIALIZED_NAME_DIVIDEND_YIELD) + @jakarta.annotation.Nullable + private String dividendYield; + + public static final String SERIALIZED_NAME_LATEST_DIVIDEND = "latestDividend"; + + @SerializedName(SERIALIZED_NAME_LATEST_DIVIDEND) + @jakarta.annotation.Nullable + private String latestDividend; + + public GetRwaUnderlyingMarketDataResponseDataMarketData() {} + + public GetRwaUnderlyingMarketDataResponseDataMarketData referencePrice( + @jakarta.annotation.Nullable String referencePrice) { + this.referencePrice = referencePrice; + return this; + } + + /** + * Underlying reference price (USD). A per-share converted price derived from the on-chain token + * price, not an official quote from the traditional stock market. + * + * @return referencePrice + */ + @jakarta.annotation.Nullable + public String getReferencePrice() { + return referencePrice; + } + + public void setReferencePrice(@jakarta.annotation.Nullable String referencePrice) { + this.referencePrice = referencePrice; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData high52W( + @jakarta.annotation.Nullable String high52W) { + this.high52W = high52W; + return this; + } + + /** + * 52-week high price. Applicable to Stock and ETF only. + * + * @return high52W + */ + @jakarta.annotation.Nullable + public String getHigh52W() { + return high52W; + } + + public void setHigh52W(@jakarta.annotation.Nullable String high52W) { + this.high52W = high52W; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData low52W( + @jakarta.annotation.Nullable String low52W) { + this.low52W = low52W; + return this; + } + + /** + * 52-week low price. Applicable to Stock and ETF only. + * + * @return low52W + */ + @jakarta.annotation.Nullable + public String getLow52W() { + return low52W; + } + + public void setLow52W(@jakarta.annotation.Nullable String low52W) { + this.low52W = low52W; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData volumeShares24H( + @jakarta.annotation.Nullable String volumeShares24H) { + this.volumeShares24H = volumeShares24H; + return this; + } + + /** + * 24-hour trading volume in shares. + * + * @return volumeShares24H + */ + @jakarta.annotation.Nullable + public String getVolumeShares24H() { + return volumeShares24H; + } + + public void setVolumeShares24H(@jakarta.annotation.Nullable String volumeShares24H) { + this.volumeShares24H = volumeShares24H; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData avgDailyVolume1Y( + @jakarta.annotation.Nullable String avgDailyVolume1Y) { + this.avgDailyVolume1Y = avgDailyVolume1Y; + return this; + } + + /** + * 1-year average daily volume. Applicable to Stock and ETF only. + * + * @return avgDailyVolume1Y + */ + @jakarta.annotation.Nullable + public String getAvgDailyVolume1Y() { + return avgDailyVolume1Y; + } + + public void setAvgDailyVolume1Y(@jakarta.annotation.Nullable String avgDailyVolume1Y) { + this.avgDailyVolume1Y = avgDailyVolume1Y; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData totalShares( + @jakarta.annotation.Nullable String totalShares) { + this.totalShares = totalShares; + return this; + } + + /** + * Total outstanding shares (Stock) or total units (ETF). Applicable to Stock and ETF only. + * + * @return totalShares + */ + @jakarta.annotation.Nullable + public String getTotalShares() { + return totalShares; + } + + public void setTotalShares(@jakarta.annotation.Nullable String totalShares) { + this.totalShares = totalShares; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData marketCap( + @jakarta.annotation.Nullable String marketCap) { + this.marketCap = marketCap; + return this; + } + + /** + * Market capitalization (USD) for Stock/ETF, or implied total valuation for Pre-IPO. + * + * @return marketCap + */ + @jakarta.annotation.Nullable + public String getMarketCap() { + return marketCap; + } + + public void setMarketCap(@jakarta.annotation.Nullable String marketCap) { + this.marketCap = marketCap; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData turnoverRate( + @jakarta.annotation.Nullable String turnoverRate) { + this.turnoverRate = turnoverRate; + return this; + } + + /** + * Turnover rate. \"23.81\" means 23.81%. Applicable to Stock and ETF only. + * + * @return turnoverRate + */ + @jakarta.annotation.Nullable + public String getTurnoverRate() { + return turnoverRate; + } + + public void setTurnoverRate(@jakarta.annotation.Nullable String turnoverRate) { + this.turnoverRate = turnoverRate; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData amplitude( + @jakarta.annotation.Nullable String amplitude) { + this.amplitude = amplitude; + return this; + } + + /** + * Price amplitude (intraday). \"3.05\" means 3.05%, i.e. (intraday high − low) / + * previous close. Applicable to Stock and ETF only. + * + * @return amplitude + */ + @jakarta.annotation.Nullable + public String getAmplitude() { + return amplitude; + } + + public void setAmplitude(@jakarta.annotation.Nullable String amplitude) { + this.amplitude = amplitude; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData peRatioTTM( + @jakarta.annotation.Nullable String peRatioTTM) { + this.peRatioTTM = peRatioTTM; + return this; + } + + /** + * Price-to-Earnings ratio (TTM = Trailing Twelve Months, based on earnings of the most + * recent 12 months). Applicable to Stock only. + * + * @return peRatioTTM + */ + @jakarta.annotation.Nullable + public String getPeRatioTTM() { + return peRatioTTM; + } + + public void setPeRatioTTM(@jakarta.annotation.Nullable String peRatioTTM) { + this.peRatioTTM = peRatioTTM; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData pbRatio( + @jakarta.annotation.Nullable String pbRatio) { + this.pbRatio = pbRatio; + return this; + } + + /** + * Price-to-Book ratio. Applicable to Stock only. + * + * @return pbRatio + */ + @jakarta.annotation.Nullable + public String getPbRatio() { + return pbRatio; + } + + public void setPbRatio(@jakarta.annotation.Nullable String pbRatio) { + this.pbRatio = pbRatio; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData dividendYield( + @jakarta.annotation.Nullable String dividendYield) { + this.dividendYield = dividendYield; + return this; + } + + /** + * Dividend yield. \"0.85\" means 0.85%. Applicable to Stock and ETF only. + * + * @return dividendYield + */ + @jakarta.annotation.Nullable + public String getDividendYield() { + return dividendYield; + } + + public void setDividendYield(@jakarta.annotation.Nullable String dividendYield) { + this.dividendYield = dividendYield; + } + + public GetRwaUnderlyingMarketDataResponseDataMarketData latestDividend( + @jakarta.annotation.Nullable String latestDividend) { + this.latestDividend = latestDividend; + return this; + } + + /** + * Latest dividend amount (USD). Applicable to Stock and ETF only. + * + * @return latestDividend + */ + @jakarta.annotation.Nullable + public String getLatestDividend() { + return latestDividend; + } + + public void setLatestDividend(@jakarta.annotation.Nullable String latestDividend) { + this.latestDividend = latestDividend; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaUnderlyingMarketDataResponseDataMarketData + getRwaUnderlyingMarketDataResponseDataMarketData = + (GetRwaUnderlyingMarketDataResponseDataMarketData) o; + return Objects.equals( + this.referencePrice, + getRwaUnderlyingMarketDataResponseDataMarketData.referencePrice) + && Objects.equals( + this.high52W, getRwaUnderlyingMarketDataResponseDataMarketData.high52W) + && Objects.equals( + this.low52W, getRwaUnderlyingMarketDataResponseDataMarketData.low52W) + && Objects.equals( + this.volumeShares24H, + getRwaUnderlyingMarketDataResponseDataMarketData.volumeShares24H) + && Objects.equals( + this.avgDailyVolume1Y, + getRwaUnderlyingMarketDataResponseDataMarketData.avgDailyVolume1Y) + && Objects.equals( + this.totalShares, + getRwaUnderlyingMarketDataResponseDataMarketData.totalShares) + && Objects.equals( + this.marketCap, getRwaUnderlyingMarketDataResponseDataMarketData.marketCap) + && Objects.equals( + this.turnoverRate, + getRwaUnderlyingMarketDataResponseDataMarketData.turnoverRate) + && Objects.equals( + this.amplitude, getRwaUnderlyingMarketDataResponseDataMarketData.amplitude) + && Objects.equals( + this.peRatioTTM, + getRwaUnderlyingMarketDataResponseDataMarketData.peRatioTTM) + && Objects.equals( + this.pbRatio, getRwaUnderlyingMarketDataResponseDataMarketData.pbRatio) + && Objects.equals( + this.dividendYield, + getRwaUnderlyingMarketDataResponseDataMarketData.dividendYield) + && Objects.equals( + this.latestDividend, + getRwaUnderlyingMarketDataResponseDataMarketData.latestDividend); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + referencePrice, + high52W, + low52W, + volumeShares24H, + avgDailyVolume1Y, + totalShares, + marketCap, + turnoverRate, + amplitude, + peRatioTTM, + pbRatio, + dividendYield, + latestDividend); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaUnderlyingMarketDataResponseDataMarketData {\n"); + sb.append(" referencePrice: ").append(toIndentedString(referencePrice)).append("\n"); + sb.append(" high52W: ").append(toIndentedString(high52W)).append("\n"); + sb.append(" low52W: ").append(toIndentedString(low52W)).append("\n"); + sb.append(" volumeShares24H: ").append(toIndentedString(volumeShares24H)).append("\n"); + sb.append(" avgDailyVolume1Y: ").append(toIndentedString(avgDailyVolume1Y)).append("\n"); + sb.append(" totalShares: ").append(toIndentedString(totalShares)).append("\n"); + sb.append(" marketCap: ").append(toIndentedString(marketCap)).append("\n"); + sb.append(" turnoverRate: ").append(toIndentedString(turnoverRate)).append("\n"); + sb.append(" amplitude: ").append(toIndentedString(amplitude)).append("\n"); + sb.append(" peRatioTTM: ").append(toIndentedString(peRatioTTM)).append("\n"); + sb.append(" pbRatio: ").append(toIndentedString(pbRatio)).append("\n"); + sb.append(" dividendYield: ").append(toIndentedString(dividendYield)).append("\n"); + sb.append(" latestDividend: ").append(toIndentedString(latestDividend)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object referencePriceValue = getReferencePrice(); + String referencePriceValueAsString = ""; + referencePriceValueAsString = referencePriceValue.toString(); + sb.append("referencePrice=").append(urlEncode(referencePriceValueAsString)).append(""); + Object high52WValue = getHigh52W(); + String high52WValueAsString = ""; + high52WValueAsString = high52WValue.toString(); + sb.append("high52W=").append(urlEncode(high52WValueAsString)).append(""); + Object low52WValue = getLow52W(); + String low52WValueAsString = ""; + low52WValueAsString = low52WValue.toString(); + sb.append("low52W=").append(urlEncode(low52WValueAsString)).append(""); + Object volumeShares24HValue = getVolumeShares24H(); + String volumeShares24HValueAsString = ""; + volumeShares24HValueAsString = volumeShares24HValue.toString(); + sb.append("volumeShares24H=").append(urlEncode(volumeShares24HValueAsString)).append(""); + Object avgDailyVolume1YValue = getAvgDailyVolume1Y(); + String avgDailyVolume1YValueAsString = ""; + avgDailyVolume1YValueAsString = avgDailyVolume1YValue.toString(); + sb.append("avgDailyVolume1Y=").append(urlEncode(avgDailyVolume1YValueAsString)).append(""); + Object totalSharesValue = getTotalShares(); + String totalSharesValueAsString = ""; + totalSharesValueAsString = totalSharesValue.toString(); + sb.append("totalShares=").append(urlEncode(totalSharesValueAsString)).append(""); + Object marketCapValue = getMarketCap(); + String marketCapValueAsString = ""; + marketCapValueAsString = marketCapValue.toString(); + sb.append("marketCap=").append(urlEncode(marketCapValueAsString)).append(""); + Object turnoverRateValue = getTurnoverRate(); + String turnoverRateValueAsString = ""; + turnoverRateValueAsString = turnoverRateValue.toString(); + sb.append("turnoverRate=").append(urlEncode(turnoverRateValueAsString)).append(""); + Object amplitudeValue = getAmplitude(); + String amplitudeValueAsString = ""; + amplitudeValueAsString = amplitudeValue.toString(); + sb.append("amplitude=").append(urlEncode(amplitudeValueAsString)).append(""); + Object peRatioTTMValue = getPeRatioTTM(); + String peRatioTTMValueAsString = ""; + peRatioTTMValueAsString = peRatioTTMValue.toString(); + sb.append("peRatioTTM=").append(urlEncode(peRatioTTMValueAsString)).append(""); + Object pbRatioValue = getPbRatio(); + String pbRatioValueAsString = ""; + pbRatioValueAsString = pbRatioValue.toString(); + sb.append("pbRatio=").append(urlEncode(pbRatioValueAsString)).append(""); + Object dividendYieldValue = getDividendYield(); + String dividendYieldValueAsString = ""; + dividendYieldValueAsString = dividendYieldValue.toString(); + sb.append("dividendYield=").append(urlEncode(dividendYieldValueAsString)).append(""); + Object latestDividendValue = getLatestDividend(); + String latestDividendValueAsString = ""; + latestDividendValueAsString = latestDividendValue.toString(); + sb.append("latestDividend=").append(urlEncode(latestDividendValueAsString)).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("referencePrice"); + openapiFields.add("high52W"); + openapiFields.add("low52W"); + openapiFields.add("volumeShares24H"); + openapiFields.add("avgDailyVolume1Y"); + openapiFields.add("totalShares"); + openapiFields.add("marketCap"); + openapiFields.add("turnoverRate"); + openapiFields.add("amplitude"); + openapiFields.add("peRatioTTM"); + openapiFields.add("pbRatio"); + openapiFields.add("dividendYield"); + openapiFields.add("latestDividend"); + + // 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 + * GetRwaUnderlyingMarketDataResponseDataMarketData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaUnderlyingMarketDataResponseDataMarketData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwaUnderlyingMarketDataResponseDataMarketData is not" + + " found in the empty JSON string", + GetRwaUnderlyingMarketDataResponseDataMarketData + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("referencePrice") != null && !jsonObj.get("referencePrice").isJsonNull()) + && !jsonObj.get("referencePrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `referencePrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("referencePrice").toString())); + } + if ((jsonObj.get("high52W") != null && !jsonObj.get("high52W").isJsonNull()) + && !jsonObj.get("high52W").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `high52W` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("high52W").toString())); + } + if ((jsonObj.get("low52W") != null && !jsonObj.get("low52W").isJsonNull()) + && !jsonObj.get("low52W").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `low52W` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("low52W").toString())); + } + if ((jsonObj.get("volumeShares24H") != null && !jsonObj.get("volumeShares24H").isJsonNull()) + && !jsonObj.get("volumeShares24H").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volumeShares24H` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("volumeShares24H").toString())); + } + if ((jsonObj.get("avgDailyVolume1Y") != null + && !jsonObj.get("avgDailyVolume1Y").isJsonNull()) + && !jsonObj.get("avgDailyVolume1Y").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `avgDailyVolume1Y` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("avgDailyVolume1Y").toString())); + } + if ((jsonObj.get("totalShares") != null && !jsonObj.get("totalShares").isJsonNull()) + && !jsonObj.get("totalShares").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalShares` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("totalShares").toString())); + } + if ((jsonObj.get("marketCap") != null && !jsonObj.get("marketCap").isJsonNull()) + && !jsonObj.get("marketCap").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marketCap` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("marketCap").toString())); + } + if ((jsonObj.get("turnoverRate") != null && !jsonObj.get("turnoverRate").isJsonNull()) + && !jsonObj.get("turnoverRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `turnoverRate` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("turnoverRate").toString())); + } + if ((jsonObj.get("amplitude") != null && !jsonObj.get("amplitude").isJsonNull()) + && !jsonObj.get("amplitude").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amplitude` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("amplitude").toString())); + } + if ((jsonObj.get("peRatioTTM") != null && !jsonObj.get("peRatioTTM").isJsonNull()) + && !jsonObj.get("peRatioTTM").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `peRatioTTM` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("peRatioTTM").toString())); + } + if ((jsonObj.get("pbRatio") != null && !jsonObj.get("pbRatio").isJsonNull()) + && !jsonObj.get("pbRatio").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pbRatio` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("pbRatio").toString())); + } + if ((jsonObj.get("dividendYield") != null && !jsonObj.get("dividendYield").isJsonNull()) + && !jsonObj.get("dividendYield").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dividendYield` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("dividendYield").toString())); + } + if ((jsonObj.get("latestDividend") != null && !jsonObj.get("latestDividend").isJsonNull()) + && !jsonObj.get("latestDividend").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `latestDividend` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("latestDividend").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaUnderlyingMarketDataResponseDataMarketData.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwaUnderlyingMarketDataResponseDataMarketData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetRwaUnderlyingMarketDataResponseDataMarketData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetRwaUnderlyingMarketDataResponseDataMarketData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaUnderlyingMarketDataResponseDataMarketData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaUnderlyingMarketDataResponseDataMarketData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaUnderlyingMarketDataResponseDataMarketData + * @throws IOException if the JSON string is invalid with respect to + * GetRwaUnderlyingMarketDataResponseDataMarketData + */ + public static GetRwaUnderlyingMarketDataResponseDataMarketData fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwaUnderlyingMarketDataResponseDataMarketData.class); + } + + /** + * Convert an instance of GetRwaUnderlyingMarketDataResponseDataMarketData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseDataStatusInfo.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseDataStatusInfo.java new file mode 100644 index 0000000..29fcf7f --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetRwaUnderlyingMarketDataResponseDataStatusInfo.java @@ -0,0 +1,445 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.Arrays; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Market status information. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetRwaUnderlyingMarketDataResponseDataStatusInfo { + public static final String SERIALIZED_NAME_OPEN_STATE = "openState"; + + @SerializedName(SERIALIZED_NAME_OPEN_STATE) + @jakarta.annotation.Nullable + private Boolean openState; + + public static final String SERIALIZED_NAME_MARKET_STATUS = "marketStatus"; + + @SerializedName(SERIALIZED_NAME_MARKET_STATUS) + @jakarta.annotation.Nullable + private String marketStatus; + + public static final String SERIALIZED_NAME_REASON_CODE = "reasonCode"; + + @SerializedName(SERIALIZED_NAME_REASON_CODE) + @jakarta.annotation.Nullable + private String reasonCode; + + public static final String SERIALIZED_NAME_REASON_MSG = "reasonMsg"; + + @SerializedName(SERIALIZED_NAME_REASON_MSG) + @jakarta.annotation.Nullable + private String reasonMsg; + + public static final String SERIALIZED_NAME_NEXT_OPEN_TIME = "nextOpenTime"; + + @SerializedName(SERIALIZED_NAME_NEXT_OPEN_TIME) + @jakarta.annotation.Nullable + private Long nextOpenTime; + + public static final String SERIALIZED_NAME_NEXT_CLOSE_TIME = "nextCloseTime"; + + @SerializedName(SERIALIZED_NAME_NEXT_CLOSE_TIME) + @jakarta.annotation.Nullable + private Long nextCloseTime; + + public GetRwaUnderlyingMarketDataResponseDataStatusInfo() {} + + public GetRwaUnderlyingMarketDataResponseDataStatusInfo openState( + @jakarta.annotation.Nullable Boolean openState) { + this.openState = openState; + return this; + } + + /** + * Whether the underlying market is currently tradable. + * + * @return openState + */ + @jakarta.annotation.Nullable + public Boolean getOpenState() { + return openState; + } + + public void setOpenState(@jakarta.annotation.Nullable Boolean openState) { + this.openState = openState; + } + + public GetRwaUnderlyingMarketDataResponseDataStatusInfo marketStatus( + @jakarta.annotation.Nullable String marketStatus) { + this.marketStatus = marketStatus; + return this; + } + + /** + * Current market status: premarket, regular (normal hours), postmarket, overnight, closed, or + * pause (trading halt/circuit breaker). + * + * @return marketStatus + */ + @jakarta.annotation.Nullable + public String getMarketStatus() { + return marketStatus; + } + + public void setMarketStatus(@jakarta.annotation.Nullable String marketStatus) { + this.marketStatus = marketStatus; + } + + public GetRwaUnderlyingMarketDataResponseDataStatusInfo reasonCode( + @jakarta.annotation.Nullable String reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * Reason code when the market is not tradable (returned when openState=false). + * Market-level: MARKET_CLOSED (closed), MARKET_PAUSED (whole market paused), MARKET_MAINTENANCE + * (system maintenance). Asset-level: ASSET_PAUSED (single asset paused, incl. corporate actions + * — see reasonMsg), ASSET_LIMITED (single asset restricted but not paused, e.g. earnings + * window). Others: TRADING (normal), UNSUPPORTED (not supported). + * + * @return reasonCode + */ + @jakarta.annotation.Nullable + public String getReasonCode() { + return reasonCode; + } + + public void setReasonCode(@jakarta.annotation.Nullable String reasonCode) { + this.reasonCode = reasonCode; + } + + public GetRwaUnderlyingMarketDataResponseDataStatusInfo reasonMsg( + @jakarta.annotation.Nullable String reasonMsg) { + this.reasonMsg = reasonMsg; + return this; + } + + /** + * Human-readable reason when the market is not tradable. Common case e.g. \"Weekend or + * Holiday\". For ASSET_PAUSED (corporate actions): cash_dividend, stock_dividend, + * stock_split, merger, acquisition, spinoff, maintenance, corporate action. For ASSET_LIMITED: + * earnings. + * + * @return reasonMsg + */ + @jakarta.annotation.Nullable + public String getReasonMsg() { + return reasonMsg; + } + + public void setReasonMsg(@jakarta.annotation.Nullable String reasonMsg) { + this.reasonMsg = reasonMsg; + } + + public GetRwaUnderlyingMarketDataResponseDataStatusInfo nextOpenTime( + @jakarta.annotation.Nullable Long nextOpenTime) { + this.nextOpenTime = nextOpenTime; + return this; + } + + /** + * Expected next market open time, Unix millisecond timestamp. + * + * @return nextOpenTime + */ + @jakarta.annotation.Nullable + public Long getNextOpenTime() { + return nextOpenTime; + } + + public void setNextOpenTime(@jakarta.annotation.Nullable Long nextOpenTime) { + this.nextOpenTime = nextOpenTime; + } + + public GetRwaUnderlyingMarketDataResponseDataStatusInfo nextCloseTime( + @jakarta.annotation.Nullable Long nextCloseTime) { + this.nextCloseTime = nextCloseTime; + return this; + } + + /** + * Expected next market close time, Unix millisecond timestamp. + * + * @return nextCloseTime + */ + @jakarta.annotation.Nullable + public Long getNextCloseTime() { + return nextCloseTime; + } + + public void setNextCloseTime(@jakarta.annotation.Nullable Long nextCloseTime) { + this.nextCloseTime = nextCloseTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRwaUnderlyingMarketDataResponseDataStatusInfo + getRwaUnderlyingMarketDataResponseDataStatusInfo = + (GetRwaUnderlyingMarketDataResponseDataStatusInfo) o; + return Objects.equals( + this.openState, getRwaUnderlyingMarketDataResponseDataStatusInfo.openState) + && Objects.equals( + this.marketStatus, + getRwaUnderlyingMarketDataResponseDataStatusInfo.marketStatus) + && Objects.equals( + this.reasonCode, + getRwaUnderlyingMarketDataResponseDataStatusInfo.reasonCode) + && Objects.equals( + this.reasonMsg, getRwaUnderlyingMarketDataResponseDataStatusInfo.reasonMsg) + && Objects.equals( + this.nextOpenTime, + getRwaUnderlyingMarketDataResponseDataStatusInfo.nextOpenTime) + && Objects.equals( + this.nextCloseTime, + getRwaUnderlyingMarketDataResponseDataStatusInfo.nextCloseTime); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + openState, marketStatus, reasonCode, reasonMsg, nextOpenTime, nextCloseTime); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRwaUnderlyingMarketDataResponseDataStatusInfo {\n"); + sb.append(" openState: ").append(toIndentedString(openState)).append("\n"); + sb.append(" marketStatus: ").append(toIndentedString(marketStatus)).append("\n"); + sb.append(" reasonCode: ").append(toIndentedString(reasonCode)).append("\n"); + sb.append(" reasonMsg: ").append(toIndentedString(reasonMsg)).append("\n"); + sb.append(" nextOpenTime: ").append(toIndentedString(nextOpenTime)).append("\n"); + sb.append(" nextCloseTime: ").append(toIndentedString(nextCloseTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object openStateValue = getOpenState(); + String openStateValueAsString = ""; + openStateValueAsString = openStateValue.toString(); + sb.append("openState=").append(urlEncode(openStateValueAsString)).append(""); + Object marketStatusValue = getMarketStatus(); + String marketStatusValueAsString = ""; + marketStatusValueAsString = marketStatusValue.toString(); + sb.append("marketStatus=").append(urlEncode(marketStatusValueAsString)).append(""); + Object reasonCodeValue = getReasonCode(); + String reasonCodeValueAsString = ""; + reasonCodeValueAsString = reasonCodeValue.toString(); + sb.append("reasonCode=").append(urlEncode(reasonCodeValueAsString)).append(""); + Object reasonMsgValue = getReasonMsg(); + String reasonMsgValueAsString = ""; + reasonMsgValueAsString = reasonMsgValue.toString(); + sb.append("reasonMsg=").append(urlEncode(reasonMsgValueAsString)).append(""); + Object nextOpenTimeValue = getNextOpenTime(); + String nextOpenTimeValueAsString = ""; + nextOpenTimeValueAsString = nextOpenTimeValue.toString(); + sb.append("nextOpenTime=").append(urlEncode(nextOpenTimeValueAsString)).append(""); + Object nextCloseTimeValue = getNextCloseTime(); + String nextCloseTimeValueAsString = ""; + nextCloseTimeValueAsString = nextCloseTimeValue.toString(); + sb.append("nextCloseTime=").append(urlEncode(nextCloseTimeValueAsString)).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("openState"); + openapiFields.add("marketStatus"); + openapiFields.add("reasonCode"); + openapiFields.add("reasonMsg"); + openapiFields.add("nextOpenTime"); + openapiFields.add("nextCloseTime"); + + // 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 + * GetRwaUnderlyingMarketDataResponseDataStatusInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetRwaUnderlyingMarketDataResponseDataStatusInfo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetRwaUnderlyingMarketDataResponseDataStatusInfo is not" + + " found in the empty JSON string", + GetRwaUnderlyingMarketDataResponseDataStatusInfo + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("marketStatus") != null && !jsonObj.get("marketStatus").isJsonNull()) + && !jsonObj.get("marketStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marketStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("marketStatus").toString())); + } + if ((jsonObj.get("reasonCode") != null && !jsonObj.get("reasonCode").isJsonNull()) + && !jsonObj.get("reasonCode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reasonCode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reasonCode").toString())); + } + if ((jsonObj.get("reasonMsg") != null && !jsonObj.get("reasonMsg").isJsonNull()) + && !jsonObj.get("reasonMsg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reasonMsg` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reasonMsg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRwaUnderlyingMarketDataResponseDataStatusInfo.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetRwaUnderlyingMarketDataResponseDataStatusInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetRwaUnderlyingMarketDataResponseDataStatusInfo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetRwaUnderlyingMarketDataResponseDataStatusInfo value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRwaUnderlyingMarketDataResponseDataStatusInfo read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRwaUnderlyingMarketDataResponseDataStatusInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRwaUnderlyingMarketDataResponseDataStatusInfo + * @throws IOException if the JSON string is invalid with respect to + * GetRwaUnderlyingMarketDataResponseDataStatusInfo + */ + public static GetRwaUnderlyingMarketDataResponseDataStatusInfo fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetRwaUnderlyingMarketDataResponseDataStatusInfo.class); + } + + /** + * Convert an instance of GetRwaUnderlyingMarketDataResponseDataStatusInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponse.java new file mode 100644 index 0000000..02e59a0 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponse.java @@ -0,0 +1,346 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetTokenDevInfoResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetTokenDevInfoResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetTokenDevInfoResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetTokenDevInfoResponse() {} + + public GetTokenDevInfoResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetTokenDevInfoResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetTokenDevInfoResponse data( + @jakarta.annotation.Nullable GetTokenDevInfoResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetTokenDevInfoResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetTokenDevInfoResponseData data) { + this.data = data; + } + + public GetTokenDevInfoResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetTokenDevInfoResponse 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; + } + GetTokenDevInfoResponse getTokenDevInfoResponse = (GetTokenDevInfoResponse) o; + return Objects.equals(this.code, getTokenDevInfoResponse.code) + && Objects.equals(this.msg, getTokenDevInfoResponse.msg) + && Objects.equals(this.data, getTokenDevInfoResponse.data) + && Objects.equals(this.timestamp, getTokenDevInfoResponse.timestamp) + && Objects.equals(this.success, getTokenDevInfoResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTokenDevInfoResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 GetTokenDevInfoResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetTokenDevInfoResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTokenDevInfoResponse is not found" + + " in the empty JSON string", + GetTokenDevInfoResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetTokenDevInfoResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTokenDevInfoResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTokenDevInfoResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTokenDevInfoResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTokenDevInfoResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTokenDevInfoResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTokenDevInfoResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTokenDevInfoResponse + * @throws IOException if the JSON string is invalid with respect to GetTokenDevInfoResponse + */ + public static GetTokenDevInfoResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTokenDevInfoResponse.class); + } + + /** + * Convert an instance of GetTokenDevInfoResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseData.java new file mode 100644 index 0000000..bf31356 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseData.java @@ -0,0 +1,256 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Token developer information. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetTokenDevInfoResponseData { + public static final String SERIALIZED_NAME_DEV_LAUNCHED_INFO = "devLaunchedInfo"; + + @SerializedName(SERIALIZED_NAME_DEV_LAUNCHED_INFO) + @jakarta.annotation.Nullable + private GetTokenDevInfoResponseDataDevLaunchedInfo devLaunchedInfo; + + public static final String SERIALIZED_NAME_DEV_HOLDING_INFO = "devHoldingInfo"; + + @SerializedName(SERIALIZED_NAME_DEV_HOLDING_INFO) + @jakarta.annotation.Nullable + private GetTokenDevInfoResponseDataDevHoldingInfo devHoldingInfo; + + public GetTokenDevInfoResponseData() {} + + public GetTokenDevInfoResponseData devLaunchedInfo( + @jakarta.annotation.Nullable + GetTokenDevInfoResponseDataDevLaunchedInfo devLaunchedInfo) { + this.devLaunchedInfo = devLaunchedInfo; + return this; + } + + /** + * Get devLaunchedInfo + * + * @return devLaunchedInfo + */ + @jakarta.annotation.Nullable + @Valid + public GetTokenDevInfoResponseDataDevLaunchedInfo getDevLaunchedInfo() { + return devLaunchedInfo; + } + + public void setDevLaunchedInfo( + @jakarta.annotation.Nullable + GetTokenDevInfoResponseDataDevLaunchedInfo devLaunchedInfo) { + this.devLaunchedInfo = devLaunchedInfo; + } + + public GetTokenDevInfoResponseData devHoldingInfo( + @jakarta.annotation.Nullable GetTokenDevInfoResponseDataDevHoldingInfo devHoldingInfo) { + this.devHoldingInfo = devHoldingInfo; + return this; + } + + /** + * Get devHoldingInfo + * + * @return devHoldingInfo + */ + @jakarta.annotation.Nullable + @Valid + public GetTokenDevInfoResponseDataDevHoldingInfo getDevHoldingInfo() { + return devHoldingInfo; + } + + public void setDevHoldingInfo( + @jakarta.annotation.Nullable GetTokenDevInfoResponseDataDevHoldingInfo devHoldingInfo) { + this.devHoldingInfo = devHoldingInfo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenDevInfoResponseData getTokenDevInfoResponseData = (GetTokenDevInfoResponseData) o; + return Objects.equals(this.devLaunchedInfo, getTokenDevInfoResponseData.devLaunchedInfo) + && Objects.equals(this.devHoldingInfo, getTokenDevInfoResponseData.devHoldingInfo); + } + + @Override + public int hashCode() { + return Objects.hash(devLaunchedInfo, devHoldingInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTokenDevInfoResponseData {\n"); + sb.append(" devLaunchedInfo: ").append(toIndentedString(devLaunchedInfo)).append("\n"); + sb.append(" devHoldingInfo: ").append(toIndentedString(devHoldingInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object devLaunchedInfoValue = getDevLaunchedInfo(); + String devLaunchedInfoValueAsString = ""; + devLaunchedInfoValueAsString = devLaunchedInfoValue.toString(); + sb.append("devLaunchedInfo=").append(urlEncode(devLaunchedInfoValueAsString)).append(""); + Object devHoldingInfoValue = getDevHoldingInfo(); + String devHoldingInfoValueAsString = ""; + devHoldingInfoValueAsString = devHoldingInfoValue.toString(); + sb.append("devHoldingInfo=").append(urlEncode(devHoldingInfoValueAsString)).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("devLaunchedInfo"); + openapiFields.add("devHoldingInfo"); + + // 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 + * GetTokenDevInfoResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetTokenDevInfoResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTokenDevInfoResponseData is not" + + " found in the empty JSON string", + GetTokenDevInfoResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `devLaunchedInfo` + if (jsonObj.get("devLaunchedInfo") != null + && !jsonObj.get("devLaunchedInfo").isJsonNull()) { + GetTokenDevInfoResponseDataDevLaunchedInfo.validateJsonElement( + jsonObj.get("devLaunchedInfo")); + } + // validate the optional field `devHoldingInfo` + if (jsonObj.get("devHoldingInfo") != null && !jsonObj.get("devHoldingInfo").isJsonNull()) { + GetTokenDevInfoResponseDataDevHoldingInfo.validateJsonElement( + jsonObj.get("devHoldingInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTokenDevInfoResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTokenDevInfoResponseData' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTokenDevInfoResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTokenDevInfoResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTokenDevInfoResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTokenDevInfoResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTokenDevInfoResponseData + * @throws IOException if the JSON string is invalid with respect to GetTokenDevInfoResponseData + */ + public static GetTokenDevInfoResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTokenDevInfoResponseData.class); + } + + /** + * Convert an instance of GetTokenDevInfoResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseDataDevHoldingInfo.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseDataDevHoldingInfo.java new file mode 100644 index 0000000..4bbab5f --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseDataDevHoldingInfo.java @@ -0,0 +1,551 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Developer's current holding information for this token. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetTokenDevInfoResponseDataDevHoldingInfo { + public static final String SERIALIZED_NAME_DEV_HOLDING_PERCENT = "devHoldingPercent"; + + @SerializedName(SERIALIZED_NAME_DEV_HOLDING_PERCENT) + @jakarta.annotation.Nullable + private String devHoldingPercent; + + public static final String SERIALIZED_NAME_DEV_ADDRESS = "devAddress"; + + @SerializedName(SERIALIZED_NAME_DEV_ADDRESS) + @jakarta.annotation.Nullable + private String devAddress; + + public static final String SERIALIZED_NAME_FUNDING_SOURCE = "fundingSource"; + + @SerializedName(SERIALIZED_NAME_FUNDING_SOURCE) + @jakarta.annotation.Nullable + private String fundingSource; + + public static final String SERIALIZED_NAME_FUNDING_SOURCE_LABEL = "fundingSourceLabel"; + + @SerializedName(SERIALIZED_NAME_FUNDING_SOURCE_LABEL) + @jakarta.annotation.Nullable + private String fundingSourceLabel; + + public static final String SERIALIZED_NAME_FUNDING_SOURCE_HASH = "fundingSourceHash"; + + @SerializedName(SERIALIZED_NAME_FUNDING_SOURCE_HASH) + @jakarta.annotation.Nullable + private String fundingSourceHash; + + public static final String SERIALIZED_NAME_FUNDING_SOURCE_TIME = "fundingSourceTime"; + + @SerializedName(SERIALIZED_NAME_FUNDING_SOURCE_TIME) + @jakarta.annotation.Nullable + private String fundingSourceTime; + + public static final String SERIALIZED_NAME_FUNDING_SOURCE_AMOUNT = "fundingSourceAmount"; + + @SerializedName(SERIALIZED_NAME_FUNDING_SOURCE_AMOUNT) + @jakarta.annotation.Nullable + private String fundingSourceAmount; + + public static final String SERIALIZED_NAME_DEV_BALANCE = "devBalance"; + + @SerializedName(SERIALIZED_NAME_DEV_BALANCE) + @jakarta.annotation.Nullable + private String devBalance; + + public GetTokenDevInfoResponseDataDevHoldingInfo() {} + + public GetTokenDevInfoResponseDataDevHoldingInfo devHoldingPercent( + @jakarta.annotation.Nullable String devHoldingPercent) { + this.devHoldingPercent = devHoldingPercent; + return this; + } + + /** + * Developer's current holding percentage for this token. No percent sign included. Empty + * string means fully sold. + * + * @return devHoldingPercent + */ + @jakarta.annotation.Nullable + public String getDevHoldingPercent() { + return devHoldingPercent; + } + + public void setDevHoldingPercent(@jakarta.annotation.Nullable String devHoldingPercent) { + this.devHoldingPercent = devHoldingPercent; + } + + public GetTokenDevInfoResponseDataDevHoldingInfo devAddress( + @jakarta.annotation.Nullable String devAddress) { + this.devAddress = devAddress; + return this; + } + + /** + * Developer (creator) wallet address. + * + * @return devAddress + */ + @jakarta.annotation.Nullable + public String getDevAddress() { + return devAddress; + } + + public void setDevAddress(@jakarta.annotation.Nullable String devAddress) { + this.devAddress = devAddress; + } + + public GetTokenDevInfoResponseDataDevHoldingInfo fundingSource( + @jakarta.annotation.Nullable String fundingSource) { + this.fundingSource = fundingSource; + return this; + } + + /** + * Funding source address — the originator of the first inbound native-token transfer. Empty + * string when no inbound transfer is recorded. + * + * @return fundingSource + */ + @jakarta.annotation.Nullable + public String getFundingSource() { + return fundingSource; + } + + public void setFundingSource(@jakarta.annotation.Nullable String fundingSource) { + this.fundingSource = fundingSource; + } + + public GetTokenDevInfoResponseDataDevHoldingInfo fundingSourceLabel( + @jakarta.annotation.Nullable String fundingSourceLabel) { + this.fundingSourceLabel = fundingSourceLabel; + return this; + } + + /** + * Funding source name (e.g. exchange name). Empty string when unknown. + * + * @return fundingSourceLabel + */ + @jakarta.annotation.Nullable + public String getFundingSourceLabel() { + return fundingSourceLabel; + } + + public void setFundingSourceLabel(@jakarta.annotation.Nullable String fundingSourceLabel) { + this.fundingSourceLabel = fundingSourceLabel; + } + + public GetTokenDevInfoResponseDataDevHoldingInfo fundingSourceHash( + @jakarta.annotation.Nullable String fundingSourceHash) { + this.fundingSourceHash = fundingSourceHash; + return this; + } + + /** + * Transaction hash of the first inbound native-token transfer. + * + * @return fundingSourceHash + */ + @jakarta.annotation.Nullable + public String getFundingSourceHash() { + return fundingSourceHash; + } + + public void setFundingSourceHash(@jakarta.annotation.Nullable String fundingSourceHash) { + this.fundingSourceHash = fundingSourceHash; + } + + public GetTokenDevInfoResponseDataDevHoldingInfo fundingSourceTime( + @jakarta.annotation.Nullable String fundingSourceTime) { + this.fundingSourceTime = fundingSourceTime; + return this; + } + + /** + * Timestamp of the first inbound native-token transfer, Unix millisecond timestamp. + * + * @return fundingSourceTime + */ + @jakarta.annotation.Nullable + public String getFundingSourceTime() { + return fundingSourceTime; + } + + public void setFundingSourceTime(@jakarta.annotation.Nullable String fundingSourceTime) { + this.fundingSourceTime = fundingSourceTime; + } + + public GetTokenDevInfoResponseDataDevHoldingInfo fundingSourceAmount( + @jakarta.annotation.Nullable String fundingSourceAmount) { + this.fundingSourceAmount = fundingSourceAmount; + return this; + } + + /** + * Amount of the first inbound native-token transfer (native token units). + * + * @return fundingSourceAmount + */ + @jakarta.annotation.Nullable + public String getFundingSourceAmount() { + return fundingSourceAmount; + } + + public void setFundingSourceAmount(@jakarta.annotation.Nullable String fundingSourceAmount) { + this.fundingSourceAmount = fundingSourceAmount; + } + + public GetTokenDevInfoResponseDataDevHoldingInfo devBalance( + @jakarta.annotation.Nullable String devBalance) { + this.devBalance = devBalance; + return this; + } + + /** + * Developer wallet's native token balance (e.g. SOL). Empty string when unavailable. + * + * @return devBalance + */ + @jakarta.annotation.Nullable + public String getDevBalance() { + return devBalance; + } + + public void setDevBalance(@jakarta.annotation.Nullable String devBalance) { + this.devBalance = devBalance; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenDevInfoResponseDataDevHoldingInfo getTokenDevInfoResponseDataDevHoldingInfo = + (GetTokenDevInfoResponseDataDevHoldingInfo) o; + return Objects.equals( + this.devHoldingPercent, + getTokenDevInfoResponseDataDevHoldingInfo.devHoldingPercent) + && Objects.equals( + this.devAddress, getTokenDevInfoResponseDataDevHoldingInfo.devAddress) + && Objects.equals( + this.fundingSource, getTokenDevInfoResponseDataDevHoldingInfo.fundingSource) + && Objects.equals( + this.fundingSourceLabel, + getTokenDevInfoResponseDataDevHoldingInfo.fundingSourceLabel) + && Objects.equals( + this.fundingSourceHash, + getTokenDevInfoResponseDataDevHoldingInfo.fundingSourceHash) + && Objects.equals( + this.fundingSourceTime, + getTokenDevInfoResponseDataDevHoldingInfo.fundingSourceTime) + && Objects.equals( + this.fundingSourceAmount, + getTokenDevInfoResponseDataDevHoldingInfo.fundingSourceAmount) + && Objects.equals( + this.devBalance, getTokenDevInfoResponseDataDevHoldingInfo.devBalance); + } + + @Override + public int hashCode() { + return Objects.hash( + devHoldingPercent, + devAddress, + fundingSource, + fundingSourceLabel, + fundingSourceHash, + fundingSourceTime, + fundingSourceAmount, + devBalance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTokenDevInfoResponseDataDevHoldingInfo {\n"); + sb.append(" devHoldingPercent: ").append(toIndentedString(devHoldingPercent)).append("\n"); + sb.append(" devAddress: ").append(toIndentedString(devAddress)).append("\n"); + sb.append(" fundingSource: ").append(toIndentedString(fundingSource)).append("\n"); + sb.append(" fundingSourceLabel: ") + .append(toIndentedString(fundingSourceLabel)) + .append("\n"); + sb.append(" fundingSourceHash: ").append(toIndentedString(fundingSourceHash)).append("\n"); + sb.append(" fundingSourceTime: ").append(toIndentedString(fundingSourceTime)).append("\n"); + sb.append(" fundingSourceAmount: ") + .append(toIndentedString(fundingSourceAmount)) + .append("\n"); + sb.append(" devBalance: ").append(toIndentedString(devBalance)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object devHoldingPercentValue = getDevHoldingPercent(); + String devHoldingPercentValueAsString = ""; + devHoldingPercentValueAsString = devHoldingPercentValue.toString(); + sb.append("devHoldingPercent=") + .append(urlEncode(devHoldingPercentValueAsString)) + .append(""); + Object devAddressValue = getDevAddress(); + String devAddressValueAsString = ""; + devAddressValueAsString = devAddressValue.toString(); + sb.append("devAddress=").append(urlEncode(devAddressValueAsString)).append(""); + Object fundingSourceValue = getFundingSource(); + String fundingSourceValueAsString = ""; + fundingSourceValueAsString = fundingSourceValue.toString(); + sb.append("fundingSource=").append(urlEncode(fundingSourceValueAsString)).append(""); + Object fundingSourceLabelValue = getFundingSourceLabel(); + String fundingSourceLabelValueAsString = ""; + fundingSourceLabelValueAsString = fundingSourceLabelValue.toString(); + sb.append("fundingSourceLabel=") + .append(urlEncode(fundingSourceLabelValueAsString)) + .append(""); + Object fundingSourceHashValue = getFundingSourceHash(); + String fundingSourceHashValueAsString = ""; + fundingSourceHashValueAsString = fundingSourceHashValue.toString(); + sb.append("fundingSourceHash=") + .append(urlEncode(fundingSourceHashValueAsString)) + .append(""); + Object fundingSourceTimeValue = getFundingSourceTime(); + String fundingSourceTimeValueAsString = ""; + fundingSourceTimeValueAsString = fundingSourceTimeValue.toString(); + sb.append("fundingSourceTime=") + .append(urlEncode(fundingSourceTimeValueAsString)) + .append(""); + Object fundingSourceAmountValue = getFundingSourceAmount(); + String fundingSourceAmountValueAsString = ""; + fundingSourceAmountValueAsString = fundingSourceAmountValue.toString(); + sb.append("fundingSourceAmount=") + .append(urlEncode(fundingSourceAmountValueAsString)) + .append(""); + Object devBalanceValue = getDevBalance(); + String devBalanceValueAsString = ""; + devBalanceValueAsString = devBalanceValue.toString(); + sb.append("devBalance=").append(urlEncode(devBalanceValueAsString)).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("devHoldingPercent"); + openapiFields.add("devAddress"); + openapiFields.add("fundingSource"); + openapiFields.add("fundingSourceLabel"); + openapiFields.add("fundingSourceHash"); + openapiFields.add("fundingSourceTime"); + openapiFields.add("fundingSourceAmount"); + openapiFields.add("devBalance"); + + // 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 + * GetTokenDevInfoResponseDataDevHoldingInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetTokenDevInfoResponseDataDevHoldingInfo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetTokenDevInfoResponseDataDevHoldingInfo is not found in" + + " the empty JSON string", + GetTokenDevInfoResponseDataDevHoldingInfo.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("devHoldingPercent") != null + && !jsonObj.get("devHoldingPercent").isJsonNull()) + && !jsonObj.get("devHoldingPercent").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `devHoldingPercent` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("devHoldingPercent").toString())); + } + if ((jsonObj.get("devAddress") != null && !jsonObj.get("devAddress").isJsonNull()) + && !jsonObj.get("devAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `devAddress` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("devAddress").toString())); + } + if ((jsonObj.get("fundingSource") != null && !jsonObj.get("fundingSource").isJsonNull()) + && !jsonObj.get("fundingSource").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fundingSource` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("fundingSource").toString())); + } + if ((jsonObj.get("fundingSourceLabel") != null + && !jsonObj.get("fundingSourceLabel").isJsonNull()) + && !jsonObj.get("fundingSourceLabel").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fundingSourceLabel` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("fundingSourceLabel").toString())); + } + if ((jsonObj.get("fundingSourceHash") != null + && !jsonObj.get("fundingSourceHash").isJsonNull()) + && !jsonObj.get("fundingSourceHash").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fundingSourceHash` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("fundingSourceHash").toString())); + } + if ((jsonObj.get("fundingSourceTime") != null + && !jsonObj.get("fundingSourceTime").isJsonNull()) + && !jsonObj.get("fundingSourceTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fundingSourceTime` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("fundingSourceTime").toString())); + } + if ((jsonObj.get("fundingSourceAmount") != null + && !jsonObj.get("fundingSourceAmount").isJsonNull()) + && !jsonObj.get("fundingSourceAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fundingSourceAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("fundingSourceAmount").toString())); + } + if ((jsonObj.get("devBalance") != null && !jsonObj.get("devBalance").isJsonNull()) + && !jsonObj.get("devBalance").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `devBalance` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("devBalance").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTokenDevInfoResponseDataDevHoldingInfo.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetTokenDevInfoResponseDataDevHoldingInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetTokenDevInfoResponseDataDevHoldingInfo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetTokenDevInfoResponseDataDevHoldingInfo value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTokenDevInfoResponseDataDevHoldingInfo read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTokenDevInfoResponseDataDevHoldingInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTokenDevInfoResponseDataDevHoldingInfo + * @throws IOException if the JSON string is invalid with respect to + * GetTokenDevInfoResponseDataDevHoldingInfo + */ + public static GetTokenDevInfoResponseDataDevHoldingInfo fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetTokenDevInfoResponseDataDevHoldingInfo.class); + } + + /** + * Convert an instance of GetTokenDevInfoResponseDataDevHoldingInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseDataDevLaunchedInfo.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseDataDevLaunchedInfo.java new file mode 100644 index 0000000..3d760cc --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTokenDevInfoResponseDataDevLaunchedInfo.java @@ -0,0 +1,267 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Historical token launch summary for this developer. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetTokenDevInfoResponseDataDevLaunchedInfo { + public static final String SERIALIZED_NAME_TOTAL_TOKEN = "totalToken"; + + @SerializedName(SERIALIZED_NAME_TOTAL_TOKEN) + @jakarta.annotation.Nullable + private String totalToken; + + public static final String SERIALIZED_NAME_MIGRATED_COUNT = "migratedCount"; + + @SerializedName(SERIALIZED_NAME_MIGRATED_COUNT) + @jakarta.annotation.Nullable + private String migratedCount; + + public GetTokenDevInfoResponseDataDevLaunchedInfo() {} + + public GetTokenDevInfoResponseDataDevLaunchedInfo totalToken( + @jakarta.annotation.Nullable String totalToken) { + this.totalToken = totalToken; + return this; + } + + /** + * Total number of tokens launched by this developer via launch platforms. + * + * @return totalToken + */ + @jakarta.annotation.Nullable + public String getTotalToken() { + return totalToken; + } + + public void setTotalToken(@jakarta.annotation.Nullable String totalToken) { + this.totalToken = totalToken; + } + + public GetTokenDevInfoResponseDataDevLaunchedInfo migratedCount( + @jakarta.annotation.Nullable String migratedCount) { + this.migratedCount = migratedCount; + return this; + } + + /** + * Number of tokens successfully migrated to external DEX by this developer. + * + * @return migratedCount + */ + @jakarta.annotation.Nullable + public String getMigratedCount() { + return migratedCount; + } + + public void setMigratedCount(@jakarta.annotation.Nullable String migratedCount) { + this.migratedCount = migratedCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenDevInfoResponseDataDevLaunchedInfo getTokenDevInfoResponseDataDevLaunchedInfo = + (GetTokenDevInfoResponseDataDevLaunchedInfo) o; + return Objects.equals( + this.totalToken, getTokenDevInfoResponseDataDevLaunchedInfo.totalToken) + && Objects.equals( + this.migratedCount, + getTokenDevInfoResponseDataDevLaunchedInfo.migratedCount); + } + + @Override + public int hashCode() { + return Objects.hash(totalToken, migratedCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTokenDevInfoResponseDataDevLaunchedInfo {\n"); + sb.append(" totalToken: ").append(toIndentedString(totalToken)).append("\n"); + sb.append(" migratedCount: ").append(toIndentedString(migratedCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object totalTokenValue = getTotalToken(); + String totalTokenValueAsString = ""; + totalTokenValueAsString = totalTokenValue.toString(); + sb.append("totalToken=").append(urlEncode(totalTokenValueAsString)).append(""); + Object migratedCountValue = getMigratedCount(); + String migratedCountValueAsString = ""; + migratedCountValueAsString = migratedCountValue.toString(); + sb.append("migratedCount=").append(urlEncode(migratedCountValueAsString)).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("totalToken"); + openapiFields.add("migratedCount"); + + // 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 + * GetTokenDevInfoResponseDataDevLaunchedInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetTokenDevInfoResponseDataDevLaunchedInfo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetTokenDevInfoResponseDataDevLaunchedInfo is not found in" + + " the empty JSON string", + GetTokenDevInfoResponseDataDevLaunchedInfo.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("totalToken") != null && !jsonObj.get("totalToken").isJsonNull()) + && !jsonObj.get("totalToken").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalToken` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("totalToken").toString())); + } + if ((jsonObj.get("migratedCount") != null && !jsonObj.get("migratedCount").isJsonNull()) + && !jsonObj.get("migratedCount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `migratedCount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("migratedCount").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTokenDevInfoResponseDataDevLaunchedInfo.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetTokenDevInfoResponseDataDevLaunchedInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetTokenDevInfoResponseDataDevLaunchedInfo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetTokenDevInfoResponseDataDevLaunchedInfo value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTokenDevInfoResponseDataDevLaunchedInfo read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTokenDevInfoResponseDataDevLaunchedInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTokenDevInfoResponseDataDevLaunchedInfo + * @throws IOException if the JSON string is invalid with respect to + * GetTokenDevInfoResponseDataDevLaunchedInfo + */ + public static GetTokenDevInfoResponseDataDevLaunchedInfo fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetTokenDevInfoResponseDataDevLaunchedInfo.class); + } + + /** + * Convert an instance of GetTokenDevInfoResponseDataDevLaunchedInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponse.java new file mode 100644 index 0000000..7a59f43 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponse.java @@ -0,0 +1,346 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetTrackedTradesResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetTrackedTradesResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetTrackedTradesResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public GetTrackedTradesResponse() {} + + public GetTrackedTradesResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public GetTrackedTradesResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public GetTrackedTradesResponse data( + @jakarta.annotation.Nullable GetTrackedTradesResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetTrackedTradesResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetTrackedTradesResponseData data) { + this.data = data; + } + + public GetTrackedTradesResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public GetTrackedTradesResponse 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; + } + GetTrackedTradesResponse getTrackedTradesResponse = (GetTrackedTradesResponse) o; + return Objects.equals(this.code, getTrackedTradesResponse.code) + && Objects.equals(this.msg, getTrackedTradesResponse.msg) + && Objects.equals(this.data, getTrackedTradesResponse.data) + && Objects.equals(this.timestamp, getTrackedTradesResponse.timestamp) + && Objects.equals(this.success, getTrackedTradesResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTrackedTradesResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 GetTrackedTradesResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetTrackedTradesResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTrackedTradesResponse is not found" + + " in the empty JSON string", + GetTrackedTradesResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetTrackedTradesResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTrackedTradesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTrackedTradesResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTrackedTradesResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTrackedTradesResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTrackedTradesResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTrackedTradesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTrackedTradesResponse + * @throws IOException if the JSON string is invalid with respect to GetTrackedTradesResponse + */ + public static GetTrackedTradesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTrackedTradesResponse.class); + } + + /** + * Convert an instance of GetTrackedTradesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponseData.java new file mode 100644 index 0000000..eb824d1 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponseData.java @@ -0,0 +1,250 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** Tracker trade results. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetTrackedTradesResponseData { + public static final String SERIALIZED_NAME_TRADES = "trades"; + + @SerializedName(SERIALIZED_NAME_TRADES) + @jakarta.annotation.Nullable + private List<@Valid GetTrackedTradesResponseDataTradesInner> trades; + + public GetTrackedTradesResponseData() {} + + public GetTrackedTradesResponseData trades( + @jakarta.annotation.Nullable + List<@Valid GetTrackedTradesResponseDataTradesInner> trades) { + this.trades = trades; + return this; + } + + public GetTrackedTradesResponseData addTradesItem( + GetTrackedTradesResponseDataTradesInner tradesItem) { + if (this.trades == null) { + this.trades = new ArrayList<>(); + } + this.trades.add(tradesItem); + return this; + } + + /** + * List of tracked address trades. + * + * @return trades + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetTrackedTradesResponseDataTradesInner> getTrades() { + return trades; + } + + public void setTrades( + @jakarta.annotation.Nullable + List<@Valid GetTrackedTradesResponseDataTradesInner> trades) { + this.trades = trades; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTrackedTradesResponseData getTrackedTradesResponseData = + (GetTrackedTradesResponseData) o; + return Objects.equals(this.trades, getTrackedTradesResponseData.trades); + } + + @Override + public int hashCode() { + return Objects.hash(trades); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTrackedTradesResponseData {\n"); + sb.append(" trades: ").append(toIndentedString(trades)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tradesValue = getTrades(); + String tradesValueAsString = ""; + tradesValueAsString = + (String) + ((Collection) tradesValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("trades=").append(urlEncode(tradesValueAsString)).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("trades"); + + // 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 + * GetTrackedTradesResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetTrackedTradesResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTrackedTradesResponseData is not" + + " found in the empty JSON string", + GetTrackedTradesResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("trades") != null && !jsonObj.get("trades").isJsonNull()) { + JsonArray jsonArraytrades = jsonObj.getAsJsonArray("trades"); + if (jsonArraytrades != null) { + // ensure the json data is an array + if (!jsonObj.get("trades").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `trades` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("trades").toString())); + } + + // validate the optional field `trades` (array) + for (int i = 0; i < jsonArraytrades.size(); i++) { + GetTrackedTradesResponseDataTradesInner.validateJsonElement( + jsonArraytrades.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTrackedTradesResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTrackedTradesResponseData' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetTrackedTradesResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTrackedTradesResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTrackedTradesResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTrackedTradesResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTrackedTradesResponseData + * @throws IOException if the JSON string is invalid with respect to + * GetTrackedTradesResponseData + */ + public static GetTrackedTradesResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTrackedTradesResponseData.class); + } + + /** + * Convert an instance of GetTrackedTradesResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponseDataTradesInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponseDataTradesInner.java new file mode 100644 index 0000000..1bf47a6 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTrackedTradesResponseDataTradesInner.java @@ -0,0 +1,574 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** GetTrackedTradesResponseDataTradesInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class GetTrackedTradesResponseDataTradesInner { + public static final String SERIALIZED_NAME_TX_HASH = "txHash"; + + @SerializedName(SERIALIZED_NAME_TX_HASH) + @jakarta.annotation.Nullable + private String txHash; + + public static final String SERIALIZED_NAME_WALLET_ADDRESS = "walletAddress"; + + @SerializedName(SERIALIZED_NAME_WALLET_ADDRESS) + @jakarta.annotation.Nullable + private String walletAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_PRICE = "tokenPrice"; + + @SerializedName(SERIALIZED_NAME_TOKEN_PRICE) + @jakarta.annotation.Nullable + private String tokenPrice; + + public static final String SERIALIZED_NAME_MARKET_CAP = "marketCap"; + + @SerializedName(SERIALIZED_NAME_MARKET_CAP) + @jakarta.annotation.Nullable + private String marketCap; + + public static final String SERIALIZED_NAME_TRADE_TYPE = "tradeType"; + + @SerializedName(SERIALIZED_NAME_TRADE_TYPE) + @jakarta.annotation.Nullable + private String tradeType; + + public static final String SERIALIZED_NAME_TRADE_TIME = "tradeTime"; + + @SerializedName(SERIALIZED_NAME_TRADE_TIME) + @jakarta.annotation.Nullable + private String tradeTime; + + public GetTrackedTradesResponseDataTradesInner() {} + + public GetTrackedTradesResponseDataTradesInner txHash( + @jakarta.annotation.Nullable String txHash) { + this.txHash = txHash; + return this; + } + + /** + * On-chain transaction hash. + * + * @return txHash + */ + @jakarta.annotation.Nullable + public String getTxHash() { + return txHash; + } + + public void setTxHash(@jakarta.annotation.Nullable String txHash) { + this.txHash = txHash; + } + + public GetTrackedTradesResponseDataTradesInner walletAddress( + @jakarta.annotation.Nullable String walletAddress) { + this.walletAddress = walletAddress; + return this; + } + + /** + * Wallet address that initiated this trade. EVM addresses are lowercase; Solana addresses are + * case-sensitive. + * + * @return walletAddress + */ + @jakarta.annotation.Nullable + public String getWalletAddress() { + return walletAddress; + } + + public void setWalletAddress(@jakarta.annotation.Nullable String walletAddress) { + this.walletAddress = walletAddress; + } + + public GetTrackedTradesResponseDataTradesInner tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Symbol of the traded token. + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public GetTrackedTradesResponseDataTradesInner tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Contract address of the traded token. EVM addresses are lowercase; Solana addresses are + * case-sensitive. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public GetTrackedTradesResponseDataTradesInner binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier of the traded token. + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public GetTrackedTradesResponseDataTradesInner tokenPrice( + @jakarta.annotation.Nullable String tokenPrice) { + this.tokenPrice = tokenPrice; + return this; + } + + /** + * Token price at the time of this trade, denominated in USD. + * + * @return tokenPrice + */ + @jakarta.annotation.Nullable + public String getTokenPrice() { + return tokenPrice; + } + + public void setTokenPrice(@jakarta.annotation.Nullable String tokenPrice) { + this.tokenPrice = tokenPrice; + } + + public GetTrackedTradesResponseDataTradesInner marketCap( + @jakarta.annotation.Nullable String marketCap) { + this.marketCap = marketCap; + return this; + } + + /** + * Token market cap at the time of this trade, denominated in USD. + * + * @return marketCap + */ + @jakarta.annotation.Nullable + public String getMarketCap() { + return marketCap; + } + + public void setMarketCap(@jakarta.annotation.Nullable String marketCap) { + this.marketCap = marketCap; + } + + public GetTrackedTradesResponseDataTradesInner tradeType( + @jakarta.annotation.Nullable String tradeType) { + this.tradeType = tradeType; + return this; + } + + /** + * Trade type. 1=Buy, 2=Sell, 3=Add position, 4=Reduce position, 5=Open + * position, 6=Close position, 7=Transfer in, 8=Transfer out. + * + * @return tradeType + */ + @jakarta.annotation.Nullable + public String getTradeType() { + return tradeType; + } + + public void setTradeType(@jakarta.annotation.Nullable String tradeType) { + this.tradeType = tradeType; + } + + public GetTrackedTradesResponseDataTradesInner tradeTime( + @jakarta.annotation.Nullable String tradeTime) { + this.tradeTime = tradeTime; + return this; + } + + /** + * On-chain time of this trade, Unix millisecond timestamp. + * + * @return tradeTime + */ + @jakarta.annotation.Nullable + public String getTradeTime() { + return tradeTime; + } + + public void setTradeTime(@jakarta.annotation.Nullable String tradeTime) { + this.tradeTime = tradeTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTrackedTradesResponseDataTradesInner getTrackedTradesResponseDataTradesInner = + (GetTrackedTradesResponseDataTradesInner) o; + return Objects.equals(this.txHash, getTrackedTradesResponseDataTradesInner.txHash) + && Objects.equals( + this.walletAddress, getTrackedTradesResponseDataTradesInner.walletAddress) + && Objects.equals( + this.tokenSymbol, getTrackedTradesResponseDataTradesInner.tokenSymbol) + && Objects.equals( + this.tokenContractAddress, + getTrackedTradesResponseDataTradesInner.tokenContractAddress) + && Objects.equals( + this.binanceChainId, getTrackedTradesResponseDataTradesInner.binanceChainId) + && Objects.equals( + this.tokenPrice, getTrackedTradesResponseDataTradesInner.tokenPrice) + && Objects.equals(this.marketCap, getTrackedTradesResponseDataTradesInner.marketCap) + && Objects.equals(this.tradeType, getTrackedTradesResponseDataTradesInner.tradeType) + && Objects.equals( + this.tradeTime, getTrackedTradesResponseDataTradesInner.tradeTime); + } + + @Override + public int hashCode() { + return Objects.hash( + txHash, + walletAddress, + tokenSymbol, + tokenContractAddress, + binanceChainId, + tokenPrice, + marketCap, + tradeType, + tradeTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTrackedTradesResponseDataTradesInner {\n"); + sb.append(" txHash: ").append(toIndentedString(txHash)).append("\n"); + sb.append(" walletAddress: ").append(toIndentedString(walletAddress)).append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenPrice: ").append(toIndentedString(tokenPrice)).append("\n"); + sb.append(" marketCap: ").append(toIndentedString(marketCap)).append("\n"); + sb.append(" tradeType: ").append(toIndentedString(tradeType)).append("\n"); + sb.append(" tradeTime: ").append(toIndentedString(tradeTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object txHashValue = getTxHash(); + String txHashValueAsString = ""; + txHashValueAsString = txHashValue.toString(); + sb.append("txHash=").append(urlEncode(txHashValueAsString)).append(""); + Object walletAddressValue = getWalletAddress(); + String walletAddressValueAsString = ""; + walletAddressValueAsString = walletAddressValue.toString(); + sb.append("walletAddress=").append(urlEncode(walletAddressValueAsString)).append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenPriceValue = getTokenPrice(); + String tokenPriceValueAsString = ""; + tokenPriceValueAsString = tokenPriceValue.toString(); + sb.append("tokenPrice=").append(urlEncode(tokenPriceValueAsString)).append(""); + Object marketCapValue = getMarketCap(); + String marketCapValueAsString = ""; + marketCapValueAsString = marketCapValue.toString(); + sb.append("marketCap=").append(urlEncode(marketCapValueAsString)).append(""); + Object tradeTypeValue = getTradeType(); + String tradeTypeValueAsString = ""; + tradeTypeValueAsString = tradeTypeValue.toString(); + sb.append("tradeType=").append(urlEncode(tradeTypeValueAsString)).append(""); + Object tradeTimeValue = getTradeTime(); + String tradeTimeValueAsString = ""; + tradeTimeValueAsString = tradeTimeValue.toString(); + sb.append("tradeTime=").append(urlEncode(tradeTimeValueAsString)).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("txHash"); + openapiFields.add("walletAddress"); + openapiFields.add("tokenSymbol"); + openapiFields.add("tokenContractAddress"); + openapiFields.add("binanceChainId"); + openapiFields.add("tokenPrice"); + openapiFields.add("marketCap"); + openapiFields.add("tradeType"); + openapiFields.add("tradeTime"); + + // 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 + * GetTrackedTradesResponseDataTradesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetTrackedTradesResponseDataTradesInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetTrackedTradesResponseDataTradesInner is not found in the" + + " empty JSON string", + GetTrackedTradesResponseDataTradesInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("txHash") != null && !jsonObj.get("txHash").isJsonNull()) + && !jsonObj.get("txHash").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txHash` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("txHash").toString())); + } + if ((jsonObj.get("walletAddress") != null && !jsonObj.get("walletAddress").isJsonNull()) + && !jsonObj.get("walletAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `walletAddress` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("walletAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("tokenPrice") != null && !jsonObj.get("tokenPrice").isJsonNull()) + && !jsonObj.get("tokenPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenPrice").toString())); + } + if ((jsonObj.get("marketCap") != null && !jsonObj.get("marketCap").isJsonNull()) + && !jsonObj.get("marketCap").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `marketCap` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("marketCap").toString())); + } + if ((jsonObj.get("tradeType") != null && !jsonObj.get("tradeType").isJsonNull()) + && !jsonObj.get("tradeType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tradeType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tradeType").toString())); + } + if ((jsonObj.get("tradeTime") != null && !jsonObj.get("tradeTime").isJsonNull()) + && !jsonObj.get("tradeTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tradeTime` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tradeTime").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTrackedTradesResponseDataTradesInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'GetTrackedTradesResponseDataTradesInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetTrackedTradesResponseDataTradesInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetTrackedTradesResponseDataTradesInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTrackedTradesResponseDataTradesInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTrackedTradesResponseDataTradesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTrackedTradesResponseDataTradesInner + * @throws IOException if the JSON string is invalid with respect to + * GetTrackedTradesResponseDataTradesInner + */ + public static GetTrackedTradesResponseDataTradesInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetTrackedTradesResponseDataTradesInner.class); + } + + /** + * Convert an instance of GetTrackedTradesResponseDataTradesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTransactionSupportedChainsResponseDataInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTransactionSupportedChainsResponseDataInner.java index 192bae7..b4ce4d3 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTransactionSupportedChainsResponseDataInner.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/GetTransactionSupportedChainsResponseDataInner.java @@ -70,7 +70,8 @@ public GetTransactionSupportedChainsResponseDataInner binanceChainId( /** * Unique chain identifier (follows EIP-155 chainId for EVM chains; e.g. - * \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana). + * \"1\"=Ethereum, \"56\"=BSC, \"CT_501\"=Solana, + * \"CT_195\"=Tron). * * @return binanceChainId */ diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/OrderType.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/OrderType.java new file mode 100644 index 0000000..210a0fc --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/OrderType.java @@ -0,0 +1,73 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets orderType */ +@JsonAdapter(OrderType.Adapter.class) +public enum OrderType { + TYPE_1("1"), + + TYPE_2("2"); + + private String value; + + OrderType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OrderType fromValue(String value) { + for (OrderType b : OrderType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OrderType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OrderType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OrderType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OrderType.fromValue(value); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/PlatformId.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/PlatformId.java new file mode 100644 index 0000000..e428db4 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/PlatformId.java @@ -0,0 +1,73 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets platformId */ +@JsonAdapter(PlatformId.Adapter.class) +public enum PlatformId { + ondo("ondo"), + + bstock("bstock"); + + private String value; + + PlatformId(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PlatformId fromValue(String value) { + for (PlatformId b : PlatformId.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PlatformId enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PlatformId read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PlatformId.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PlatformId.fromValue(value); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponse.java new file mode 100644 index 0000000..a344388 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponse.java @@ -0,0 +1,357 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** QuoteAndBuildSwapTransactionResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class QuoteAndBuildSwapTransactionResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private QuoteAndBuildSwapTransactionResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public QuoteAndBuildSwapTransactionResponse() {} + + public QuoteAndBuildSwapTransactionResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public QuoteAndBuildSwapTransactionResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public QuoteAndBuildSwapTransactionResponse data( + @jakarta.annotation.Nullable QuoteAndBuildSwapTransactionResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public QuoteAndBuildSwapTransactionResponseData getData() { + return data; + } + + public void setData( + @jakarta.annotation.Nullable QuoteAndBuildSwapTransactionResponseData data) { + this.data = data; + } + + public QuoteAndBuildSwapTransactionResponse timestamp( + @jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public QuoteAndBuildSwapTransactionResponse 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; + } + QuoteAndBuildSwapTransactionResponse quoteAndBuildSwapTransactionResponse = + (QuoteAndBuildSwapTransactionResponse) o; + return Objects.equals(this.code, quoteAndBuildSwapTransactionResponse.code) + && Objects.equals(this.msg, quoteAndBuildSwapTransactionResponse.msg) + && Objects.equals(this.data, quoteAndBuildSwapTransactionResponse.data) + && Objects.equals(this.timestamp, quoteAndBuildSwapTransactionResponse.timestamp) + && Objects.equals(this.success, quoteAndBuildSwapTransactionResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuoteAndBuildSwapTransactionResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 + * QuoteAndBuildSwapTransactionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QuoteAndBuildSwapTransactionResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QuoteAndBuildSwapTransactionResponse" + + " is not found in the empty JSON string", + QuoteAndBuildSwapTransactionResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + QuoteAndBuildSwapTransactionResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuoteAndBuildSwapTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuoteAndBuildSwapTransactionResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QuoteAndBuildSwapTransactionResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, QuoteAndBuildSwapTransactionResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuoteAndBuildSwapTransactionResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QuoteAndBuildSwapTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuoteAndBuildSwapTransactionResponse + * @throws IOException if the JSON string is invalid with respect to + * QuoteAndBuildSwapTransactionResponse + */ + public static QuoteAndBuildSwapTransactionResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, QuoteAndBuildSwapTransactionResponse.class); + } + + /** + * Convert an instance of QuoteAndBuildSwapTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponseData.java new file mode 100644 index 0000000..e233a48 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponseData.java @@ -0,0 +1,363 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.Arrays; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; +import org.openapitools.jackson.nullable.JsonNullable; + +/** QuoteAndBuildSwapTransactionResponseData */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class QuoteAndBuildSwapTransactionResponseData { + public static final String SERIALIZED_NAME_ROUTER_RESULT = "routerResult"; + + @SerializedName(SERIALIZED_NAME_ROUTER_RESULT) + @jakarta.annotation.Nullable + private BuildSwapTransactionResponseDataRouterResult routerResult; + + public static final String SERIALIZED_NAME_TX = "tx"; + + @SerializedName(SERIALIZED_NAME_TX) + @jakarta.annotation.Nullable + private BuildSwapTransactionResponseDataTx tx; + + public static final String SERIALIZED_NAME_EXECUTION_MODE = "executionMode"; + + @SerializedName(SERIALIZED_NAME_EXECUTION_MODE) + @jakarta.annotation.Nullable + private String executionMode; + + public static final String SERIALIZED_NAME_RFQ = "rfq"; + + @SerializedName(SERIALIZED_NAME_RFQ) + @jakarta.annotation.Nullable + private QuoteAndBuildSwapTransactionResponseDataRfq rfq; + + public QuoteAndBuildSwapTransactionResponseData() {} + + public QuoteAndBuildSwapTransactionResponseData routerResult( + @jakarta.annotation.Nullable + BuildSwapTransactionResponseDataRouterResult routerResult) { + this.routerResult = routerResult; + return this; + } + + /** + * Get routerResult + * + * @return routerResult + */ + @jakarta.annotation.Nullable + @Valid + public BuildSwapTransactionResponseDataRouterResult getRouterResult() { + return routerResult; + } + + public void setRouterResult( + @jakarta.annotation.Nullable + BuildSwapTransactionResponseDataRouterResult routerResult) { + this.routerResult = routerResult; + } + + public QuoteAndBuildSwapTransactionResponseData tx( + @jakarta.annotation.Nullable BuildSwapTransactionResponseDataTx tx) { + this.tx = tx; + return this; + } + + /** + * Get tx + * + * @return tx + */ + @jakarta.annotation.Nullable + @Valid + public BuildSwapTransactionResponseDataTx getTx() { + return tx; + } + + public void setTx(@jakarta.annotation.Nullable BuildSwapTransactionResponseDataTx tx) { + this.tx = tx; + } + + public QuoteAndBuildSwapTransactionResponseData executionMode( + @jakarta.annotation.Nullable String executionMode) { + this.executionMode = executionMode; + return this; + } + + /** + * Always `SWAP` for this endpoint — returns executable calldata / swapTransaction to + * sign and broadcast on-chain (no `RFQ` mode). + * + * @return executionMode + */ + @jakarta.annotation.Nullable + public String getExecutionMode() { + return executionMode; + } + + public void setExecutionMode(@jakarta.annotation.Nullable String executionMode) { + this.executionMode = executionMode; + } + + public QuoteAndBuildSwapTransactionResponseData rfq( + @jakarta.annotation.Nullable QuoteAndBuildSwapTransactionResponseDataRfq rfq) { + this.rfq = rfq; + return this; + } + + /** + * Get rfq + * + * @return rfq + */ + @jakarta.annotation.Nullable + @Valid + public QuoteAndBuildSwapTransactionResponseDataRfq getRfq() { + return rfq; + } + + public void setRfq( + @jakarta.annotation.Nullable QuoteAndBuildSwapTransactionResponseDataRfq rfq) { + this.rfq = rfq; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuoteAndBuildSwapTransactionResponseData quoteAndBuildSwapTransactionResponseData = + (QuoteAndBuildSwapTransactionResponseData) o; + return Objects.equals( + this.routerResult, quoteAndBuildSwapTransactionResponseData.routerResult) + && Objects.equals(this.tx, quoteAndBuildSwapTransactionResponseData.tx) + && Objects.equals( + this.executionMode, quoteAndBuildSwapTransactionResponseData.executionMode) + && Objects.equals(this.rfq, quoteAndBuildSwapTransactionResponseData.rfq); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(routerResult, tx, executionMode, rfq); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuoteAndBuildSwapTransactionResponseData {\n"); + sb.append(" routerResult: ").append(toIndentedString(routerResult)).append("\n"); + sb.append(" tx: ").append(toIndentedString(tx)).append("\n"); + sb.append(" executionMode: ").append(toIndentedString(executionMode)).append("\n"); + sb.append(" rfq: ").append(toIndentedString(rfq)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object routerResultValue = getRouterResult(); + String routerResultValueAsString = ""; + routerResultValueAsString = routerResultValue.toString(); + sb.append("routerResult=").append(urlEncode(routerResultValueAsString)).append(""); + Object txValue = getTx(); + String txValueAsString = ""; + txValueAsString = txValue.toString(); + sb.append("tx=").append(urlEncode(txValueAsString)).append(""); + Object executionModeValue = getExecutionMode(); + String executionModeValueAsString = ""; + executionModeValueAsString = executionModeValue.toString(); + sb.append("executionMode=").append(urlEncode(executionModeValueAsString)).append(""); + Object rfqValue = getRfq(); + String rfqValueAsString = ""; + rfqValueAsString = rfqValue.toString(); + sb.append("rfq=").append(urlEncode(rfqValueAsString)).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("routerResult"); + openapiFields.add("tx"); + openapiFields.add("executionMode"); + openapiFields.add("rfq"); + + // 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 + * QuoteAndBuildSwapTransactionResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QuoteAndBuildSwapTransactionResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " QuoteAndBuildSwapTransactionResponseData is not found in" + + " the empty JSON string", + QuoteAndBuildSwapTransactionResponseData.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `routerResult` + if (jsonObj.get("routerResult") != null && !jsonObj.get("routerResult").isJsonNull()) { + BuildSwapTransactionResponseDataRouterResult.validateJsonElement( + jsonObj.get("routerResult")); + } + // validate the optional field `tx` + if (jsonObj.get("tx") != null && !jsonObj.get("tx").isJsonNull()) { + BuildSwapTransactionResponseDataTx.validateJsonElement(jsonObj.get("tx")); + } + if ((jsonObj.get("executionMode") != null && !jsonObj.get("executionMode").isJsonNull()) + && !jsonObj.get("executionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executionMode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executionMode").toString())); + } + // validate the optional field `rfq` + if (jsonObj.get("rfq") != null && !jsonObj.get("rfq").isJsonNull()) { + QuoteAndBuildSwapTransactionResponseDataRfq.validateJsonElement(jsonObj.get("rfq")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuoteAndBuildSwapTransactionResponseData.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'QuoteAndBuildSwapTransactionResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QuoteAndBuildSwapTransactionResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, QuoteAndBuildSwapTransactionResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuoteAndBuildSwapTransactionResponseData read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QuoteAndBuildSwapTransactionResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuoteAndBuildSwapTransactionResponseData + * @throws IOException if the JSON string is invalid with respect to + * QuoteAndBuildSwapTransactionResponseData + */ + public static QuoteAndBuildSwapTransactionResponseData fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, QuoteAndBuildSwapTransactionResponseData.class); + } + + /** + * Convert an instance of QuoteAndBuildSwapTransactionResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponseDataRfq.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponseDataRfq.java new file mode 100644 index 0000000..f505f80 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/QuoteAndBuildSwapTransactionResponseDataRfq.java @@ -0,0 +1,421 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.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.*; + +/** Always `null` for this endpoint (only `SWAP` mode is returned). */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class QuoteAndBuildSwapTransactionResponseDataRfq { + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + + @SerializedName(SERIALIZED_NAME_VENDOR) + @jakarta.annotation.Nullable + private String vendor; + + public static final String SERIALIZED_NAME_TX_TYPE = "txType"; + + @SerializedName(SERIALIZED_NAME_TX_TYPE) + @jakarta.annotation.Nullable + private String txType; + + public static final String SERIALIZED_NAME_TYPED_DATA_TO_SIGN = "typedDataToSign"; + + @SerializedName(SERIALIZED_NAME_TYPED_DATA_TO_SIGN) + @jakarta.annotation.Nullable + private String typedDataToSign; + + public static final String SERIALIZED_NAME_SIGNING_SCHEME = "signingScheme"; + + @SerializedName(SERIALIZED_NAME_SIGNING_SCHEME) + @jakarta.annotation.Nullable + private String signingScheme; + + public static final String SERIALIZED_NAME_SIGNATURE_DATA = "signatureData"; + + @SerializedName(SERIALIZED_NAME_SIGNATURE_DATA) + @jakarta.annotation.Nullable + private List signatureData; + + public QuoteAndBuildSwapTransactionResponseDataRfq() {} + + public QuoteAndBuildSwapTransactionResponseDataRfq vendor( + @jakarta.annotation.Nullable String vendor) { + this.vendor = vendor; + return this; + } + + /** + * RFQ vendor that will settle this order on-chain. Pass this as the `vendor` field in + * `POST /order/submit`. + * + * @return vendor + */ + @jakarta.annotation.Nullable + public String getVendor() { + return vendor; + } + + public void setVendor(@jakarta.annotation.Nullable String vendor) { + this.vendor = vendor; + } + + public QuoteAndBuildSwapTransactionResponseDataRfq txType( + @jakarta.annotation.Nullable String txType) { + this.txType = txType; + return this; + } + + /** + * Transaction type for this RFQ order. Currently always `EIP712` (all three RFQ + * vendors use EIP-712 typed-data signing); reserved for future signing schemes. + * + * @return txType + */ + @jakarta.annotation.Nullable + public String getTxType() { + return txType; + } + + public void setTxType(@jakarta.annotation.Nullable String txType) { + this.txType = txType; + } + + public QuoteAndBuildSwapTransactionResponseDataRfq typedDataToSign( + @jakarta.annotation.Nullable String typedDataToSign) { + this.typedDataToSign = typedDataToSign; + return this; + } + + /** + * EIP-712 typed data payload for `eth_signTypedData_v4`, serialized as a hex string + * (or JSON-encoded string). Sign with the wallet that matches `userWalletAddress` + * from `/quote`. Pass the resulting signature as `userSignature` in + * `POST /order/submit`. + * + * @return typedDataToSign + */ + @jakarta.annotation.Nullable + public String getTypedDataToSign() { + return typedDataToSign; + } + + public void setTypedDataToSign(@jakarta.annotation.Nullable String typedDataToSign) { + this.typedDataToSign = typedDataToSign; + } + + public QuoteAndBuildSwapTransactionResponseDataRfq signingScheme( + @jakarta.annotation.Nullable String signingScheme) { + this.signingScheme = signingScheme; + return this; + } + + /** + * Signing scheme required by this vendor. Pass this as `signingScheme` in `POST + * /order/submit`. + * + * @return signingScheme + */ + @jakarta.annotation.Nullable + public String getSigningScheme() { + return signingScheme; + } + + public void setSigningScheme(@jakarta.annotation.Nullable String signingScheme) { + this.signingScheme = signingScheme; + } + + public QuoteAndBuildSwapTransactionResponseDataRfq signatureData( + @jakarta.annotation.Nullable List signatureData) { + this.signatureData = signatureData; + return this; + } + + public QuoteAndBuildSwapTransactionResponseDataRfq addSignatureDataItem( + String signatureDataItem) { + if (this.signatureData == null) { + this.signatureData = new ArrayList<>(); + } + this.signatureData.add(signatureDataItem); + return this; + } + + /** + * Approve transaction data, present only when `approveTransaction=true` was + * passed and the from-token is an EVM ERC-20. Each element is a JSON string containing + * `approveContract` (the spender address, resolved per vendor: InchFusion→router, + * PcsXRfq→Permit2, CowSwap→VaultRelayer) and `approveTxCalldata` (the ERC-20 + * `approve()` calldata). Empty list otherwise. + * + * @return signatureData + */ + @jakarta.annotation.Nullable + public List getSignatureData() { + return signatureData; + } + + public void setSignatureData(@jakarta.annotation.Nullable List signatureData) { + this.signatureData = signatureData; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuoteAndBuildSwapTransactionResponseDataRfq quoteAndBuildSwapTransactionResponseDataRfq = + (QuoteAndBuildSwapTransactionResponseDataRfq) o; + return Objects.equals(this.vendor, quoteAndBuildSwapTransactionResponseDataRfq.vendor) + && Objects.equals(this.txType, quoteAndBuildSwapTransactionResponseDataRfq.txType) + && Objects.equals( + this.typedDataToSign, + quoteAndBuildSwapTransactionResponseDataRfq.typedDataToSign) + && Objects.equals( + this.signingScheme, + quoteAndBuildSwapTransactionResponseDataRfq.signingScheme) + && Objects.equals( + this.signatureData, + quoteAndBuildSwapTransactionResponseDataRfq.signatureData); + } + + @Override + public int hashCode() { + return Objects.hash(vendor, txType, typedDataToSign, signingScheme, signatureData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuoteAndBuildSwapTransactionResponseDataRfq {\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" txType: ").append(toIndentedString(txType)).append("\n"); + sb.append(" typedDataToSign: ").append(toIndentedString(typedDataToSign)).append("\n"); + sb.append(" signingScheme: ").append(toIndentedString(signingScheme)).append("\n"); + sb.append(" signatureData: ").append(toIndentedString(signatureData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object vendorValue = getVendor(); + String vendorValueAsString = ""; + vendorValueAsString = vendorValue.toString(); + sb.append("vendor=").append(urlEncode(vendorValueAsString)).append(""); + Object txTypeValue = getTxType(); + String txTypeValueAsString = ""; + txTypeValueAsString = txTypeValue.toString(); + sb.append("txType=").append(urlEncode(txTypeValueAsString)).append(""); + Object typedDataToSignValue = getTypedDataToSign(); + String typedDataToSignValueAsString = ""; + typedDataToSignValueAsString = typedDataToSignValue.toString(); + sb.append("typedDataToSign=").append(urlEncode(typedDataToSignValueAsString)).append(""); + Object signingSchemeValue = getSigningScheme(); + String signingSchemeValueAsString = ""; + signingSchemeValueAsString = signingSchemeValue.toString(); + sb.append("signingScheme=").append(urlEncode(signingSchemeValueAsString)).append(""); + Object signatureDataValue = getSignatureData(); + String signatureDataValueAsString = ""; + signatureDataValueAsString = + (String) + ((Collection) signatureDataValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("signatureData=").append(urlEncode(signatureDataValueAsString)).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("vendor"); + openapiFields.add("txType"); + openapiFields.add("typedDataToSign"); + openapiFields.add("signingScheme"); + openapiFields.add("signatureData"); + + // 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 + * QuoteAndBuildSwapTransactionResponseDataRfq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QuoteAndBuildSwapTransactionResponseDataRfq.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " QuoteAndBuildSwapTransactionResponseDataRfq is not found in" + + " the empty JSON string", + QuoteAndBuildSwapTransactionResponseDataRfq.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("vendor") != null && !jsonObj.get("vendor").isJsonNull()) + && !jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `vendor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("vendor").toString())); + } + if ((jsonObj.get("txType") != null && !jsonObj.get("txType").isJsonNull()) + && !jsonObj.get("txType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txType` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("txType").toString())); + } + if ((jsonObj.get("typedDataToSign") != null && !jsonObj.get("typedDataToSign").isJsonNull()) + && !jsonObj.get("typedDataToSign").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `typedDataToSign` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("typedDataToSign").toString())); + } + if ((jsonObj.get("signingScheme") != null && !jsonObj.get("signingScheme").isJsonNull()) + && !jsonObj.get("signingScheme").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `signingScheme` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("signingScheme").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("signatureData") != null + && !jsonObj.get("signatureData").isJsonNull() + && !jsonObj.get("signatureData").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `signatureData` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("signatureData").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuoteAndBuildSwapTransactionResponseDataRfq.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'QuoteAndBuildSwapTransactionResponseDataRfq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QuoteAndBuildSwapTransactionResponseDataRfq.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, QuoteAndBuildSwapTransactionResponseDataRfq value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuoteAndBuildSwapTransactionResponseDataRfq read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QuoteAndBuildSwapTransactionResponseDataRfq given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuoteAndBuildSwapTransactionResponseDataRfq + * @throws IOException if the JSON string is invalid with respect to + * QuoteAndBuildSwapTransactionResponseDataRfq + */ + public static QuoteAndBuildSwapTransactionResponseDataRfq fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, QuoteAndBuildSwapTransactionResponseDataRfq.class); + } + + /** + * Convert an instance of QuoteAndBuildSwapTransactionResponseDataRfq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponse.java new file mode 100644 index 0000000..0c205c9 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponse.java @@ -0,0 +1,377 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** SearchRwaTokenResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class SearchRwaTokenResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private List<@Valid SearchRwaTokenResponseDataInner> data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public SearchRwaTokenResponse() {} + + public SearchRwaTokenResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Business status code. 0 indicates success. + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public SearchRwaTokenResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Status message. + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public SearchRwaTokenResponse data( + @jakarta.annotation.Nullable List<@Valid SearchRwaTokenResponseDataInner> data) { + this.data = data; + return this; + } + + public SearchRwaTokenResponse addDataItem(SearchRwaTokenResponseDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of matched tickers and their tokenized assets. + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid SearchRwaTokenResponseDataInner> getData() { + return data; + } + + public void setData( + @jakarta.annotation.Nullable List<@Valid SearchRwaTokenResponseDataInner> data) { + this.data = data; + } + + public SearchRwaTokenResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Server response time, Unix millisecond timestamp. + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public SearchRwaTokenResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Whether the request was successful. + * + * @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; + } + SearchRwaTokenResponse searchRwaTokenResponse = (SearchRwaTokenResponse) o; + return Objects.equals(this.code, searchRwaTokenResponse.code) + && Objects.equals(this.msg, searchRwaTokenResponse.msg) + && Objects.equals(this.data, searchRwaTokenResponse.data) + && Objects.equals(this.timestamp, searchRwaTokenResponse.timestamp) + && Objects.equals(this.success, searchRwaTokenResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchRwaTokenResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = + (String) + ((Collection) dataValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 SearchRwaTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SearchRwaTokenResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SearchRwaTokenResponse is not found in" + + " the empty JSON string", + SearchRwaTokenResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `data` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SearchRwaTokenResponseDataInner.validateJsonElement(jsonArraydata.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SearchRwaTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SearchRwaTokenResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SearchRwaTokenResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SearchRwaTokenResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SearchRwaTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SearchRwaTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SearchRwaTokenResponse + * @throws IOException if the JSON string is invalid with respect to SearchRwaTokenResponse + */ + public static SearchRwaTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SearchRwaTokenResponse.class); + } + + /** + * Convert an instance of SearchRwaTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponseDataInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponseDataInner.java new file mode 100644 index 0000000..0574247 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponseDataInner.java @@ -0,0 +1,332 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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; +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.*; + +/** SearchRwaTokenResponseDataInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class SearchRwaTokenResponseDataInner { + public static final String SERIALIZED_NAME_TICKER = "ticker"; + + @SerializedName(SERIALIZED_NAME_TICKER) + @jakarta.annotation.Nullable + private String ticker; + + public static final String SERIALIZED_NAME_COMPANY_NAME = "companyName"; + + @SerializedName(SERIALIZED_NAME_COMPANY_NAME) + @jakarta.annotation.Nullable + private String companyName; + + public static final String SERIALIZED_NAME_ASSETS = "assets"; + + @SerializedName(SERIALIZED_NAME_ASSETS) + @jakarta.annotation.Nullable + private List<@Valid SearchRwaTokenResponseDataInnerAssetsInner> assets; + + public SearchRwaTokenResponseDataInner() {} + + public SearchRwaTokenResponseDataInner ticker(@jakarta.annotation.Nullable String ticker) { + this.ticker = ticker; + return this; + } + + /** + * Matched stock ticker symbol. + * + * @return ticker + */ + @jakarta.annotation.Nullable + public String getTicker() { + return ticker; + } + + public void setTicker(@jakarta.annotation.Nullable String ticker) { + this.ticker = ticker; + } + + public SearchRwaTokenResponseDataInner companyName( + @jakarta.annotation.Nullable String companyName) { + this.companyName = companyName; + return this; + } + + /** + * Company English name. + * + * @return companyName + */ + @jakarta.annotation.Nullable + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(@jakarta.annotation.Nullable String companyName) { + this.companyName = companyName; + } + + public SearchRwaTokenResponseDataInner assets( + @jakarta.annotation.Nullable + List<@Valid SearchRwaTokenResponseDataInnerAssetsInner> assets) { + this.assets = assets; + return this; + } + + public SearchRwaTokenResponseDataInner addAssetsItem( + SearchRwaTokenResponseDataInnerAssetsInner assetsItem) { + if (this.assets == null) { + this.assets = new ArrayList<>(); + } + this.assets.add(assetsItem); + return this; + } + + /** + * Tokenized assets for this ticker across platforms and chains. + * + * @return assets + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid SearchRwaTokenResponseDataInnerAssetsInner> getAssets() { + return assets; + } + + public void setAssets( + @jakarta.annotation.Nullable + List<@Valid SearchRwaTokenResponseDataInnerAssetsInner> assets) { + this.assets = assets; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SearchRwaTokenResponseDataInner searchRwaTokenResponseDataInner = + (SearchRwaTokenResponseDataInner) o; + return Objects.equals(this.ticker, searchRwaTokenResponseDataInner.ticker) + && Objects.equals(this.companyName, searchRwaTokenResponseDataInner.companyName) + && Objects.equals(this.assets, searchRwaTokenResponseDataInner.assets); + } + + @Override + public int hashCode() { + return Objects.hash(ticker, companyName, assets); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchRwaTokenResponseDataInner {\n"); + sb.append(" ticker: ").append(toIndentedString(ticker)).append("\n"); + sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); + sb.append(" assets: ").append(toIndentedString(assets)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tickerValue = getTicker(); + String tickerValueAsString = ""; + tickerValueAsString = tickerValue.toString(); + sb.append("ticker=").append(urlEncode(tickerValueAsString)).append(""); + Object companyNameValue = getCompanyName(); + String companyNameValueAsString = ""; + companyNameValueAsString = companyNameValue.toString(); + sb.append("companyName=").append(urlEncode(companyNameValueAsString)).append(""); + Object assetsValue = getAssets(); + String assetsValueAsString = ""; + assetsValueAsString = + (String) + ((Collection) assetsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("assets=").append(urlEncode(assetsValueAsString)).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("ticker"); + openapiFields.add("companyName"); + openapiFields.add("assets"); + + // 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 + * SearchRwaTokenResponseDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SearchRwaTokenResponseDataInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SearchRwaTokenResponseDataInner is not" + + " found in the empty JSON string", + SearchRwaTokenResponseDataInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ticker") != null && !jsonObj.get("ticker").isJsonNull()) + && !jsonObj.get("ticker").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ticker` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("ticker").toString())); + } + if ((jsonObj.get("companyName") != null && !jsonObj.get("companyName").isJsonNull()) + && !jsonObj.get("companyName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `companyName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("companyName").toString())); + } + if (jsonObj.get("assets") != null && !jsonObj.get("assets").isJsonNull()) { + JsonArray jsonArrayassets = jsonObj.getAsJsonArray("assets"); + if (jsonArrayassets != null) { + // ensure the json data is an array + if (!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())); + } + + // validate the optional field `assets` (array) + for (int i = 0; i < jsonArrayassets.size(); i++) { + SearchRwaTokenResponseDataInnerAssetsInner.validateJsonElement( + jsonArrayassets.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SearchRwaTokenResponseDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SearchRwaTokenResponseDataInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SearchRwaTokenResponseDataInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SearchRwaTokenResponseDataInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SearchRwaTokenResponseDataInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SearchRwaTokenResponseDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SearchRwaTokenResponseDataInner + * @throws IOException if the JSON string is invalid with respect to + * SearchRwaTokenResponseDataInner + */ + public static SearchRwaTokenResponseDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SearchRwaTokenResponseDataInner.class); + } + + /** + * Convert an instance of SearchRwaTokenResponseDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponseDataInnerAssetsInner.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponseDataInnerAssetsInner.java new file mode 100644 index 0000000..a4653a9 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SearchRwaTokenResponseDataInnerAssetsInner.java @@ -0,0 +1,393 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** SearchRwaTokenResponseDataInnerAssetsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class SearchRwaTokenResponseDataInnerAssetsInner { + public static final String SERIALIZED_NAME_PLATFORM_ID = "platformId"; + + @SerializedName(SERIALIZED_NAME_PLATFORM_ID) + @jakarta.annotation.Nullable + private String platformId; + + public static final String SERIALIZED_NAME_BINANCE_CHAIN_ID = "binanceChainId"; + + @SerializedName(SERIALIZED_NAME_BINANCE_CHAIN_ID) + @jakarta.annotation.Nullable + private String binanceChainId; + + public static final String SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS = "tokenContractAddress"; + + @SerializedName(SERIALIZED_NAME_TOKEN_CONTRACT_ADDRESS) + @jakarta.annotation.Nullable + private String tokenContractAddress; + + public static final String SERIALIZED_NAME_TOKEN_SYMBOL = "tokenSymbol"; + + @SerializedName(SERIALIZED_NAME_TOKEN_SYMBOL) + @jakarta.annotation.Nullable + private String tokenSymbol; + + public static final String SERIALIZED_NAME_ASSET_TYPE = "assetType"; + + @SerializedName(SERIALIZED_NAME_ASSET_TYPE) + @jakarta.annotation.Nullable + private Integer assetType; + + public SearchRwaTokenResponseDataInnerAssetsInner() {} + + public SearchRwaTokenResponseDataInnerAssetsInner platformId( + @jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + return this; + } + + /** + * Unique platform identifier. + * + * @return platformId + */ + @jakarta.annotation.Nullable + public String getPlatformId() { + return platformId; + } + + public void setPlatformId(@jakarta.annotation.Nullable String platformId) { + this.platformId = platformId; + } + + public SearchRwaTokenResponseDataInnerAssetsInner binanceChainId( + @jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + return this; + } + + /** + * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, + * \"CT_501\"=Solana). + * + * @return binanceChainId + */ + @jakarta.annotation.Nullable + public String getBinanceChainId() { + return binanceChainId; + } + + public void setBinanceChainId(@jakarta.annotation.Nullable String binanceChainId) { + this.binanceChainId = binanceChainId; + } + + public SearchRwaTokenResponseDataInnerAssetsInner tokenContractAddress( + @jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + return this; + } + + /** + * Token contract address. + * + * @return tokenContractAddress + */ + @jakarta.annotation.Nullable + public String getTokenContractAddress() { + return tokenContractAddress; + } + + public void setTokenContractAddress(@jakarta.annotation.Nullable String tokenContractAddress) { + this.tokenContractAddress = tokenContractAddress; + } + + public SearchRwaTokenResponseDataInnerAssetsInner tokenSymbol( + @jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + return this; + } + + /** + * Token symbol. + * + * @return tokenSymbol + */ + @jakarta.annotation.Nullable + public String getTokenSymbol() { + return tokenSymbol; + } + + public void setTokenSymbol(@jakarta.annotation.Nullable String tokenSymbol) { + this.tokenSymbol = tokenSymbol; + } + + public SearchRwaTokenResponseDataInnerAssetsInner assetType( + @jakarta.annotation.Nullable Integer assetType) { + this.assetType = assetType; + return this; + } + + /** + * Asset type. 1=Stock, 2=Pre-IPO, 3=ETF. + * + * @return assetType + */ + @jakarta.annotation.Nullable + public Integer getAssetType() { + return assetType; + } + + public void setAssetType(@jakarta.annotation.Nullable Integer assetType) { + this.assetType = assetType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SearchRwaTokenResponseDataInnerAssetsInner searchRwaTokenResponseDataInnerAssetsInner = + (SearchRwaTokenResponseDataInnerAssetsInner) o; + return Objects.equals( + this.platformId, searchRwaTokenResponseDataInnerAssetsInner.platformId) + && Objects.equals( + this.binanceChainId, + searchRwaTokenResponseDataInnerAssetsInner.binanceChainId) + && Objects.equals( + this.tokenContractAddress, + searchRwaTokenResponseDataInnerAssetsInner.tokenContractAddress) + && Objects.equals( + this.tokenSymbol, searchRwaTokenResponseDataInnerAssetsInner.tokenSymbol) + && Objects.equals( + this.assetType, searchRwaTokenResponseDataInnerAssetsInner.assetType); + } + + @Override + public int hashCode() { + return Objects.hash( + platformId, binanceChainId, tokenContractAddress, tokenSymbol, assetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SearchRwaTokenResponseDataInnerAssetsInner {\n"); + sb.append(" platformId: ").append(toIndentedString(platformId)).append("\n"); + sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); + sb.append(" tokenContractAddress: ") + .append(toIndentedString(tokenContractAddress)) + .append("\n"); + sb.append(" tokenSymbol: ").append(toIndentedString(tokenSymbol)).append("\n"); + sb.append(" assetType: ").append(toIndentedString(assetType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object platformIdValue = getPlatformId(); + String platformIdValueAsString = ""; + platformIdValueAsString = platformIdValue.toString(); + sb.append("platformId=").append(urlEncode(platformIdValueAsString)).append(""); + Object binanceChainIdValue = getBinanceChainId(); + String binanceChainIdValueAsString = ""; + binanceChainIdValueAsString = binanceChainIdValue.toString(); + sb.append("binanceChainId=").append(urlEncode(binanceChainIdValueAsString)).append(""); + Object tokenContractAddressValue = getTokenContractAddress(); + String tokenContractAddressValueAsString = ""; + tokenContractAddressValueAsString = tokenContractAddressValue.toString(); + sb.append("tokenContractAddress=") + .append(urlEncode(tokenContractAddressValueAsString)) + .append(""); + Object tokenSymbolValue = getTokenSymbol(); + String tokenSymbolValueAsString = ""; + tokenSymbolValueAsString = tokenSymbolValue.toString(); + sb.append("tokenSymbol=").append(urlEncode(tokenSymbolValueAsString)).append(""); + Object assetTypeValue = getAssetType(); + String assetTypeValueAsString = ""; + assetTypeValueAsString = assetTypeValue.toString(); + sb.append("assetType=").append(urlEncode(assetTypeValueAsString)).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("platformId"); + openapiFields.add("binanceChainId"); + openapiFields.add("tokenContractAddress"); + openapiFields.add("tokenSymbol"); + openapiFields.add("assetType"); + + // 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 + * SearchRwaTokenResponseDataInnerAssetsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SearchRwaTokenResponseDataInnerAssetsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " SearchRwaTokenResponseDataInnerAssetsInner is not found in" + + " the empty JSON string", + SearchRwaTokenResponseDataInnerAssetsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("platformId") != null && !jsonObj.get("platformId").isJsonNull()) + && !jsonObj.get("platformId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `platformId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("platformId").toString())); + } + if ((jsonObj.get("binanceChainId") != null && !jsonObj.get("binanceChainId").isJsonNull()) + && !jsonObj.get("binanceChainId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `binanceChainId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("binanceChainId").toString())); + } + if ((jsonObj.get("tokenContractAddress") != null + && !jsonObj.get("tokenContractAddress").isJsonNull()) + && !jsonObj.get("tokenContractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenContractAddress` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("tokenContractAddress").toString())); + } + if ((jsonObj.get("tokenSymbol") != null && !jsonObj.get("tokenSymbol").isJsonNull()) + && !jsonObj.get("tokenSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tokenSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tokenSymbol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SearchRwaTokenResponseDataInnerAssetsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'SearchRwaTokenResponseDataInnerAssetsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SearchRwaTokenResponseDataInnerAssetsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, SearchRwaTokenResponseDataInnerAssetsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SearchRwaTokenResponseDataInnerAssetsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SearchRwaTokenResponseDataInnerAssetsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SearchRwaTokenResponseDataInnerAssetsInner + * @throws IOException if the JSON string is invalid with respect to + * SearchRwaTokenResponseDataInnerAssetsInner + */ + public static SearchRwaTokenResponseDataInnerAssetsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, SearchRwaTokenResponseDataInnerAssetsInner.class); + } + + /** + * Convert an instance of SearchRwaTokenResponseDataInnerAssetsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequest.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequest.java index 89e9bbb..4745e5b 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequest.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequest.java @@ -46,15 +46,21 @@ public class SimulateTransactionsRequest { public static final String SERIALIZED_NAME_EVM_TX = "evmTx"; @SerializedName(SERIALIZED_NAME_EVM_TX) - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull private SimulateTransactionsRequestEvmTx evmTx; public static final String SERIALIZED_NAME_SOL_TX = "solTx"; @SerializedName(SERIALIZED_NAME_SOL_TX) - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull private SimulateTransactionsRequestSolTx solTx; + public static final String SERIALIZED_NAME_TRON_TX = "tronTx"; + + @SerializedName(SERIALIZED_NAME_TRON_TX) + @jakarta.annotation.Nonnull + private SimulateTransactionsRequestTronTx tronTx; + public SimulateTransactionsRequest() {} public SimulateTransactionsRequest binanceChainId( @@ -65,7 +71,11 @@ public SimulateTransactionsRequest binanceChainId( /** * Unique chain identifier (e.g. \"1\"=Ethereum, \"56\"=BSC, - * \"CT_501\"=Solana). + * \"CT_501\"=Solana, \"CT_195\"=Tron). Provide `evmTx` + * for EVM chains, `solTx` for Solana, or `tronTx` for Tron — exactly one + * must be present. Note: `evmTx`, `solTx`, and `tronTx` are + * marked required in this schema for rendering purposes only; in practice supply exactly one + * matching `binanceChainId`. * * @return binanceChainId */ @@ -80,7 +90,7 @@ public void setBinanceChainId(@jakarta.annotation.Nonnull String binanceChainId) } public SimulateTransactionsRequest evmTx( - @jakarta.annotation.Nullable SimulateTransactionsRequestEvmTx evmTx) { + @jakarta.annotation.Nonnull SimulateTransactionsRequestEvmTx evmTx) { this.evmTx = evmTx; return this; } @@ -90,18 +100,19 @@ public SimulateTransactionsRequest evmTx( * * @return evmTx */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull + @NotNull @Valid public SimulateTransactionsRequestEvmTx getEvmTx() { return evmTx; } - public void setEvmTx(@jakarta.annotation.Nullable SimulateTransactionsRequestEvmTx evmTx) { + public void setEvmTx(@jakarta.annotation.Nonnull SimulateTransactionsRequestEvmTx evmTx) { this.evmTx = evmTx; } public SimulateTransactionsRequest solTx( - @jakarta.annotation.Nullable SimulateTransactionsRequestSolTx solTx) { + @jakarta.annotation.Nonnull SimulateTransactionsRequestSolTx solTx) { this.solTx = solTx; return this; } @@ -111,16 +122,39 @@ public SimulateTransactionsRequest solTx( * * @return solTx */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull + @NotNull @Valid public SimulateTransactionsRequestSolTx getSolTx() { return solTx; } - public void setSolTx(@jakarta.annotation.Nullable SimulateTransactionsRequestSolTx solTx) { + public void setSolTx(@jakarta.annotation.Nonnull SimulateTransactionsRequestSolTx solTx) { this.solTx = solTx; } + public SimulateTransactionsRequest tronTx( + @jakarta.annotation.Nonnull SimulateTransactionsRequestTronTx tronTx) { + this.tronTx = tronTx; + return this; + } + + /** + * Get tronTx + * + * @return tronTx + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public SimulateTransactionsRequestTronTx getTronTx() { + return tronTx; + } + + public void setTronTx(@jakarta.annotation.Nonnull SimulateTransactionsRequestTronTx tronTx) { + this.tronTx = tronTx; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -132,12 +166,13 @@ public boolean equals(Object o) { SimulateTransactionsRequest simulateTransactionsRequest = (SimulateTransactionsRequest) o; return Objects.equals(this.binanceChainId, simulateTransactionsRequest.binanceChainId) && Objects.equals(this.evmTx, simulateTransactionsRequest.evmTx) - && Objects.equals(this.solTx, simulateTransactionsRequest.solTx); + && Objects.equals(this.solTx, simulateTransactionsRequest.solTx) + && Objects.equals(this.tronTx, simulateTransactionsRequest.tronTx); } @Override public int hashCode() { - return Objects.hash(binanceChainId, evmTx, solTx); + return Objects.hash(binanceChainId, evmTx, solTx, tronTx); } @Override @@ -147,6 +182,7 @@ public String toString() { sb.append(" binanceChainId: ").append(toIndentedString(binanceChainId)).append("\n"); sb.append(" evmTx: ").append(toIndentedString(evmTx)).append("\n"); sb.append(" solTx: ").append(toIndentedString(solTx)).append("\n"); + sb.append(" tronTx: ").append(toIndentedString(tronTx)).append("\n"); sb.append("}"); return sb.toString(); } @@ -166,6 +202,10 @@ public String toUrlQueryString() { String solTxValueAsString = ""; solTxValueAsString = solTxValue.toString(); sb.append("solTx=").append(urlEncode(solTxValueAsString)).append(""); + Object tronTxValue = getTronTx(); + String tronTxValueAsString = ""; + tronTxValueAsString = tronTxValue.toString(); + sb.append("tronTx=").append(urlEncode(tronTxValueAsString)).append(""); return sb.toString(); } @@ -197,10 +237,14 @@ private String toIndentedString(Object o) { openapiFields.add("binanceChainId"); openapiFields.add("evmTx"); openapiFields.add("solTx"); + openapiFields.add("tronTx"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("binanceChainId"); + openapiRequiredFields.add("evmTx"); + openapiRequiredFields.add("solTx"); + openapiRequiredFields.add("tronTx"); } /** @@ -239,14 +283,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("binanceChainId").toString())); } - // validate the optional field `evmTx` - if (jsonObj.get("evmTx") != null && !jsonObj.get("evmTx").isJsonNull()) { - SimulateTransactionsRequestEvmTx.validateJsonElement(jsonObj.get("evmTx")); - } - // validate the optional field `solTx` - if (jsonObj.get("solTx") != null && !jsonObj.get("solTx").isJsonNull()) { - SimulateTransactionsRequestSolTx.validateJsonElement(jsonObj.get("solTx")); - } + // validate the required field `evmTx` + SimulateTransactionsRequestEvmTx.validateJsonElement(jsonObj.get("evmTx")); + // validate the required field `solTx` + SimulateTransactionsRequestSolTx.validateJsonElement(jsonObj.get("solTx")); + // validate the required field `tronTx` + SimulateTransactionsRequestTronTx.validateJsonElement(jsonObj.get("tronTx")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestEvmTx.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestEvmTx.java index 30c4654..4f5b380 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestEvmTx.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestEvmTx.java @@ -57,7 +57,7 @@ public class SimulateTransactionsRequestEvmTx { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull private String data; public SimulateTransactionsRequestEvmTx() {} @@ -122,7 +122,7 @@ public void setValue(@jakarta.annotation.Nonnull String value) { this.value = value; } - public SimulateTransactionsRequestEvmTx data(@jakarta.annotation.Nullable String data) { + public SimulateTransactionsRequestEvmTx data(@jakarta.annotation.Nonnull String data) { this.data = data; return this; } @@ -132,12 +132,13 @@ public SimulateTransactionsRequestEvmTx data(@jakarta.annotation.Nullable String * * @return data */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull + @NotNull public String getData() { return data; } - public void setData(@jakarta.annotation.Nullable String data) { + public void setData(@jakarta.annotation.Nonnull String data) { this.data = data; } @@ -231,6 +232,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("from"); openapiRequiredFields.add("to"); openapiRequiredFields.add("value"); + openapiRequiredFields.add("data"); } /** @@ -283,8 +285,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("value").toString())); } - if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) - && !jsonObj.get("data").isJsonPrimitive()) { + if (!jsonObj.get("data").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `data` to be a primitive type in the JSON string" diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestSolTx.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestSolTx.java index e7fd1d2..2dd14a6 100644 --- a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestSolTx.java +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestSolTx.java @@ -45,7 +45,7 @@ public class SimulateTransactionsRequestSolTx { public static final String SERIALIZED_NAME_ADDRESS = "address"; @SerializedName(SERIALIZED_NAME_ADDRESS) - @jakarta.annotation.Nonnull + @jakarta.annotation.Nullable private String address; public SimulateTransactionsRequestSolTx() {} @@ -70,7 +70,7 @@ public void setBase64Tx(@jakarta.annotation.Nonnull String base64Tx) { this.base64Tx = base64Tx; } - public SimulateTransactionsRequestSolTx address(@jakarta.annotation.Nonnull String address) { + public SimulateTransactionsRequestSolTx address(@jakarta.annotation.Nullable String address) { this.address = address; return this; } @@ -80,13 +80,12 @@ public SimulateTransactionsRequestSolTx address(@jakarta.annotation.Nonnull Stri * * @return address */ - @jakarta.annotation.Nonnull - @NotNull + @jakarta.annotation.Nullable public String getAddress() { return address; } - public void setAddress(@jakarta.annotation.Nonnull String address) { + public void setAddress(@jakarta.annotation.Nullable String address) { this.address = address; } @@ -164,7 +163,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("base64Tx"); - openapiRequiredFields.add("address"); } /** @@ -203,7 +201,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("base64Tx").toString())); } - if (!jsonObj.get("address").isJsonPrimitive()) { + 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" diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestTronTx.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestTronTx.java new file mode 100644 index 0000000..425221b --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SimulateTransactionsRequestTronTx.java @@ -0,0 +1,429 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.JsonAdapter; +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.*; + +/** Tron transaction payload. Required when `binanceChainId=CT_195`. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class SimulateTransactionsRequestTronTx { + public static final String SERIALIZED_NAME_FROM = "from"; + + @SerializedName(SERIALIZED_NAME_FROM) + @jakarta.annotation.Nonnull + private String from; + + /** + * Tron contract type. `TRIGGER_SMART_CONTRACT` requires + * `triggerSmartContractParams`; `TRANSFER_CONTRACT` requires + * `transferContractParams`. + */ + @JsonAdapter(TxTypeEnum.Adapter.class) + public enum TxTypeEnum { + TRIGGER_SMART_CONTRACT("TRIGGER_SMART_CONTRACT"), + + TRANSFER_CONTRACT("TRANSFER_CONTRACT"); + + private String value; + + TxTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TxTypeEnum fromValue(String value) { + for (TxTypeEnum b : TxTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TxTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TxTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TxTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TxTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TX_TYPE = "txType"; + + @SerializedName(SERIALIZED_NAME_TX_TYPE) + @jakarta.annotation.Nonnull + private TxTypeEnum txType; + + public static final String SERIALIZED_NAME_TRIGGER_SMART_CONTRACT_PARAMS = + "triggerSmartContractParams"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_SMART_CONTRACT_PARAMS) + @jakarta.annotation.Nullable + private GetGasLimitRequestTronTxTriggerSmartContractParams triggerSmartContractParams; + + public static final String SERIALIZED_NAME_TRANSFER_CONTRACT_PARAMS = "transferContractParams"; + + @SerializedName(SERIALIZED_NAME_TRANSFER_CONTRACT_PARAMS) + @jakarta.annotation.Nullable + private GetGasLimitRequestTronTxTransferContractParams transferContractParams; + + public SimulateTransactionsRequestTronTx() {} + + public SimulateTransactionsRequestTronTx from(@jakarta.annotation.Nonnull String from) { + this.from = from; + return this; + } + + /** + * Sender address (base58check), also used to attribute balance changes. + * + * @return from + */ + @jakarta.annotation.Nonnull + @NotNull + public String getFrom() { + return from; + } + + public void setFrom(@jakarta.annotation.Nonnull String from) { + this.from = from; + } + + public SimulateTransactionsRequestTronTx txType(@jakarta.annotation.Nonnull TxTypeEnum txType) { + this.txType = txType; + return this; + } + + /** + * Tron contract type. `TRIGGER_SMART_CONTRACT` requires + * `triggerSmartContractParams`; `TRANSFER_CONTRACT` requires + * `transferContractParams`. + * + * @return txType + */ + @jakarta.annotation.Nonnull + @NotNull + public TxTypeEnum getTxType() { + return txType; + } + + public void setTxType(@jakarta.annotation.Nonnull TxTypeEnum txType) { + this.txType = txType; + } + + public SimulateTransactionsRequestTronTx triggerSmartContractParams( + @jakarta.annotation.Nullable + GetGasLimitRequestTronTxTriggerSmartContractParams triggerSmartContractParams) { + this.triggerSmartContractParams = triggerSmartContractParams; + return this; + } + + /** + * Get triggerSmartContractParams + * + * @return triggerSmartContractParams + */ + @jakarta.annotation.Nullable + @Valid + public GetGasLimitRequestTronTxTriggerSmartContractParams getTriggerSmartContractParams() { + return triggerSmartContractParams; + } + + public void setTriggerSmartContractParams( + @jakarta.annotation.Nullable + GetGasLimitRequestTronTxTriggerSmartContractParams triggerSmartContractParams) { + this.triggerSmartContractParams = triggerSmartContractParams; + } + + public SimulateTransactionsRequestTronTx transferContractParams( + @jakarta.annotation.Nullable + GetGasLimitRequestTronTxTransferContractParams transferContractParams) { + this.transferContractParams = transferContractParams; + return this; + } + + /** + * Get transferContractParams + * + * @return transferContractParams + */ + @jakarta.annotation.Nullable + @Valid + public GetGasLimitRequestTronTxTransferContractParams getTransferContractParams() { + return transferContractParams; + } + + public void setTransferContractParams( + @jakarta.annotation.Nullable + GetGasLimitRequestTronTxTransferContractParams transferContractParams) { + this.transferContractParams = transferContractParams; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimulateTransactionsRequestTronTx simulateTransactionsRequestTronTx = + (SimulateTransactionsRequestTronTx) o; + return Objects.equals(this.from, simulateTransactionsRequestTronTx.from) + && Objects.equals(this.txType, simulateTransactionsRequestTronTx.txType) + && Objects.equals( + this.triggerSmartContractParams, + simulateTransactionsRequestTronTx.triggerSmartContractParams) + && Objects.equals( + this.transferContractParams, + simulateTransactionsRequestTronTx.transferContractParams); + } + + @Override + public int hashCode() { + return Objects.hash(from, txType, triggerSmartContractParams, transferContractParams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimulateTransactionsRequestTronTx {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" txType: ").append(toIndentedString(txType)).append("\n"); + sb.append(" triggerSmartContractParams: ") + .append(toIndentedString(triggerSmartContractParams)) + .append("\n"); + sb.append(" transferContractParams: ") + .append(toIndentedString(transferContractParams)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object fromValue = getFrom(); + String fromValueAsString = ""; + fromValueAsString = fromValue.toString(); + sb.append("from=").append(urlEncode(fromValueAsString)).append(""); + Object txTypeValue = getTxType(); + String txTypeValueAsString = ""; + txTypeValueAsString = txTypeValue.toString(); + sb.append("txType=").append(urlEncode(txTypeValueAsString)).append(""); + Object triggerSmartContractParamsValue = getTriggerSmartContractParams(); + String triggerSmartContractParamsValueAsString = ""; + triggerSmartContractParamsValueAsString = triggerSmartContractParamsValue.toString(); + sb.append("triggerSmartContractParams=") + .append(urlEncode(triggerSmartContractParamsValueAsString)) + .append(""); + Object transferContractParamsValue = getTransferContractParams(); + String transferContractParamsValueAsString = ""; + transferContractParamsValueAsString = transferContractParamsValue.toString(); + sb.append("transferContractParams=") + .append(urlEncode(transferContractParamsValueAsString)) + .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("from"); + openapiFields.add("txType"); + openapiFields.add("triggerSmartContractParams"); + openapiFields.add("transferContractParams"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("txType"); + } + + /** + * 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 + * SimulateTransactionsRequestTronTx + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SimulateTransactionsRequestTronTx.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SimulateTransactionsRequestTronTx is" + + " not found in the empty JSON string", + SimulateTransactionsRequestTronTx.openapiRequiredFields + .toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SimulateTransactionsRequestTronTx.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("from").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `from` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("from").toString())); + } + if (!jsonObj.get("txType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `txType` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("txType").toString())); + } + // validate the required field `txType` + TxTypeEnum.validateJsonElement(jsonObj.get("txType")); + // validate the optional field `triggerSmartContractParams` + if (jsonObj.get("triggerSmartContractParams") != null + && !jsonObj.get("triggerSmartContractParams").isJsonNull()) { + GetGasLimitRequestTronTxTriggerSmartContractParams.validateJsonElement( + jsonObj.get("triggerSmartContractParams")); + } + // validate the optional field `transferContractParams` + if (jsonObj.get("transferContractParams") != null + && !jsonObj.get("transferContractParams").isJsonNull()) { + GetGasLimitRequestTronTxTransferContractParams.validateJsonElement( + jsonObj.get("transferContractParams")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SimulateTransactionsRequestTronTx.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SimulateTransactionsRequestTronTx' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SimulateTransactionsRequestTronTx.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SimulateTransactionsRequestTronTx value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SimulateTransactionsRequestTronTx read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SimulateTransactionsRequestTronTx given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimulateTransactionsRequestTronTx + * @throws IOException if the JSON string is invalid with respect to + * SimulateTransactionsRequestTronTx + */ + public static SimulateTransactionsRequestTronTx fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SimulateTransactionsRequestTronTx.class); + } + + /** + * Convert an instance of SimulateTransactionsRequestTronTx to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SortBy.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SortBy.java new file mode 100644 index 0000000..5f65663 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SortBy.java @@ -0,0 +1,79 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets sortBy */ +@JsonAdapter(SortBy.Adapter.class) +public enum SortBy { + SORT_BY_1("1"), + + SORT_BY_2("2"), + + SORT_BY_3("3"), + + SORT_BY_4("4"), + + SORT_BY_5("5"); + + private String value; + + SortBy(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SortBy fromValue(String value) { + for (SortBy b : SortBy.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SortBy enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SortBy read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SortBy.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SortBy.fromValue(value); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderRequest.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderRequest.java new file mode 100644 index 0000000..b96430a --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderRequest.java @@ -0,0 +1,452 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.JsonAdapter; +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.*; + +/** SubmitRfqOrderRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class SubmitRfqOrderRequest { + public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; + + @SerializedName(SERIALIZED_NAME_REQUEST_ID) + @jakarta.annotation.Nonnull + private String requestId; + + public static final String SERIALIZED_NAME_USER_SIGNATURE = "userSignature"; + + @SerializedName(SERIALIZED_NAME_USER_SIGNATURE) + @jakarta.annotation.Nonnull + private String userSignature; + + /** + * RFQ vendor name — must match `rfq.vendor` from the `/swap` response. The + * backend validates this against `quoteId` to prevent misrouted submissions. + */ + @JsonAdapter(VendorEnum.Adapter.class) + public enum VendorEnum { + InchFusion("InchFusion"), + + CowSwap("CowSwap"), + + PcsXRfq("PcsXRfq"); + + private String value; + + VendorEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VendorEnum fromValue(String value) { + for (VendorEnum b : VendorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final VendorEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VendorEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VendorEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + VendorEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + + @SerializedName(SERIALIZED_NAME_VENDOR) + @jakarta.annotation.Nonnull + private VendorEnum vendor; + + public static final String SERIALIZED_NAME_QUOTE_ID = "quoteId"; + + @SerializedName(SERIALIZED_NAME_QUOTE_ID) + @jakarta.annotation.Nonnull + private String quoteId; + + public static final String SERIALIZED_NAME_SIGNING_SCHEME = "signingScheme"; + + @SerializedName(SERIALIZED_NAME_SIGNING_SCHEME) + @jakarta.annotation.Nullable + private String signingScheme; + + public SubmitRfqOrderRequest() {} + + public SubmitRfqOrderRequest requestId(@jakarta.annotation.Nonnull String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Idempotency key (UUID v4). Within 30 minutes, re-submitting with the same + * `requestId` returns the original result without re-calling the vendor. Generate a + * new UUID for each new order; reuse the same UUID when retrying the same attempt. + * + * @return requestId + */ + @jakarta.annotation.Nonnull + @NotNull + public String getRequestId() { + return requestId; + } + + public void setRequestId(@jakarta.annotation.Nonnull String requestId) { + this.requestId = requestId; + } + + public SubmitRfqOrderRequest userSignature(@jakarta.annotation.Nonnull String userSignature) { + this.userSignature = userSignature; + return this; + } + + /** + * EIP-712 signature of `rfq.typedDataToSign` from the `/swap` response. + * Must be a hex string with `0x` prefix (132 chars = `0x` + 65 bytes). + * The signing wallet must match `userWalletAddress` used in `/quote`. The + * backend automatically corrects Ethereum `v` values `00`/`01` to + * `1b`/`1c`. + * + * @return userSignature + */ + @jakarta.annotation.Nonnull + @NotNull + public String getUserSignature() { + return userSignature; + } + + public void setUserSignature(@jakarta.annotation.Nonnull String userSignature) { + this.userSignature = userSignature; + } + + public SubmitRfqOrderRequest vendor(@jakarta.annotation.Nonnull VendorEnum vendor) { + this.vendor = vendor; + return this; + } + + /** + * RFQ vendor name — must match `rfq.vendor` from the `/swap` response. The + * backend validates this against `quoteId` to prevent misrouted submissions. + * + * @return vendor + */ + @jakarta.annotation.Nonnull + @NotNull + public VendorEnum getVendor() { + return vendor; + } + + public void setVendor(@jakarta.annotation.Nonnull VendorEnum vendor) { + this.vendor = vendor; + } + + public SubmitRfqOrderRequest quoteId(@jakarta.annotation.Nonnull String quoteId) { + this.quoteId = quoteId; + return this; + } + + /** + * `rfq.orderId` from the `/swap` response. The backend uses this to look up + * the vendor and chain context required to forward the signed order. + * + * @return quoteId + */ + @jakarta.annotation.Nonnull + @NotNull + public String getQuoteId() { + return quoteId; + } + + public void setQuoteId(@jakarta.annotation.Nonnull String quoteId) { + this.quoteId = quoteId; + } + + public SubmitRfqOrderRequest signingScheme(@jakarta.annotation.Nullable String signingScheme) { + this.signingScheme = signingScheme; + return this; + } + + /** + * Signing scheme from `rfq.signingScheme` in the `/swap` response. Optional + * — when omitted the backend infers the default per vendor. + * + * @return signingScheme + */ + @jakarta.annotation.Nullable + public String getSigningScheme() { + return signingScheme; + } + + public void setSigningScheme(@jakarta.annotation.Nullable String signingScheme) { + this.signingScheme = signingScheme; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubmitRfqOrderRequest submitRfqOrderRequest = (SubmitRfqOrderRequest) o; + return Objects.equals(this.requestId, submitRfqOrderRequest.requestId) + && Objects.equals(this.userSignature, submitRfqOrderRequest.userSignature) + && Objects.equals(this.vendor, submitRfqOrderRequest.vendor) + && Objects.equals(this.quoteId, submitRfqOrderRequest.quoteId) + && Objects.equals(this.signingScheme, submitRfqOrderRequest.signingScheme); + } + + @Override + public int hashCode() { + return Objects.hash(requestId, userSignature, vendor, quoteId, signingScheme); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubmitRfqOrderRequest {\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" userSignature: ").append(toIndentedString(userSignature)).append("\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" quoteId: ").append(toIndentedString(quoteId)).append("\n"); + sb.append(" signingScheme: ").append(toIndentedString(signingScheme)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object requestIdValue = getRequestId(); + String requestIdValueAsString = ""; + requestIdValueAsString = requestIdValue.toString(); + sb.append("requestId=").append(urlEncode(requestIdValueAsString)).append(""); + Object userSignatureValue = getUserSignature(); + String userSignatureValueAsString = ""; + userSignatureValueAsString = userSignatureValue.toString(); + sb.append("userSignature=").append(urlEncode(userSignatureValueAsString)).append(""); + Object vendorValue = getVendor(); + String vendorValueAsString = ""; + vendorValueAsString = vendorValue.toString(); + sb.append("vendor=").append(urlEncode(vendorValueAsString)).append(""); + Object quoteIdValue = getQuoteId(); + String quoteIdValueAsString = ""; + quoteIdValueAsString = quoteIdValue.toString(); + sb.append("quoteId=").append(urlEncode(quoteIdValueAsString)).append(""); + Object signingSchemeValue = getSigningScheme(); + String signingSchemeValueAsString = ""; + signingSchemeValueAsString = signingSchemeValue.toString(); + sb.append("signingScheme=").append(urlEncode(signingSchemeValueAsString)).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("requestId"); + openapiFields.add("userSignature"); + openapiFields.add("vendor"); + openapiFields.add("quoteId"); + openapiFields.add("signingScheme"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("requestId"); + openapiRequiredFields.add("userSignature"); + openapiRequiredFields.add("vendor"); + openapiRequiredFields.add("quoteId"); + } + + /** + * 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 SubmitRfqOrderRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubmitRfqOrderRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SubmitRfqOrderRequest is not found in" + + " the empty JSON string", + SubmitRfqOrderRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubmitRfqOrderRequest.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("requestId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `requestId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("requestId").toString())); + } + if (!jsonObj.get("userSignature").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `userSignature` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("userSignature").toString())); + } + if (!jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `vendor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("vendor").toString())); + } + // validate the required field `vendor` + VendorEnum.validateJsonElement(jsonObj.get("vendor")); + if (!jsonObj.get("quoteId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quoteId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("quoteId").toString())); + } + if ((jsonObj.get("signingScheme") != null && !jsonObj.get("signingScheme").isJsonNull()) + && !jsonObj.get("signingScheme").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `signingScheme` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("signingScheme").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubmitRfqOrderRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubmitRfqOrderRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SubmitRfqOrderRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SubmitRfqOrderRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubmitRfqOrderRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SubmitRfqOrderRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubmitRfqOrderRequest + * @throws IOException if the JSON string is invalid with respect to SubmitRfqOrderRequest + */ + public static SubmitRfqOrderRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubmitRfqOrderRequest.class); + } + + /** + * Convert an instance of SubmitRfqOrderRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderResponse.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderResponse.java new file mode 100644 index 0000000..0590739 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderResponse.java @@ -0,0 +1,345 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** SubmitRfqOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class SubmitRfqOrderResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Integer code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private SubmitRfqOrderResponseData data; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + @jakarta.annotation.Nullable + private Long timestamp; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public SubmitRfqOrderResponse() {} + + public SubmitRfqOrderResponse code(@jakarta.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Integer code) { + this.code = code; + } + + public SubmitRfqOrderResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + public SubmitRfqOrderResponse data( + @jakarta.annotation.Nullable SubmitRfqOrderResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public SubmitRfqOrderResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable SubmitRfqOrderResponseData data) { + this.data = data; + } + + public SubmitRfqOrderResponse timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * + * @return timestamp + */ + @jakarta.annotation.Nullable + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + public SubmitRfqOrderResponse 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; + } + SubmitRfqOrderResponse submitRfqOrderResponse = (SubmitRfqOrderResponse) o; + return Objects.equals(this.code, submitRfqOrderResponse.code) + && Objects.equals(this.msg, submitRfqOrderResponse.msg) + && Objects.equals(this.data, submitRfqOrderResponse.data) + && Objects.equals(this.timestamp, submitRfqOrderResponse.timestamp) + && Objects.equals(this.success, submitRfqOrderResponse.success); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg, data, timestamp, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubmitRfqOrderResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + Object timestampValue = getTimestamp(); + String timestampValueAsString = ""; + timestampValueAsString = timestampValue.toString(); + sb.append("timestamp=").append(urlEncode(timestampValueAsString)).append(""); + 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("code"); + openapiFields.add("msg"); + openapiFields.add("data"); + openapiFields.add("timestamp"); + 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 SubmitRfqOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubmitRfqOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SubmitRfqOrderResponse is not found in" + + " the empty JSON string", + SubmitRfqOrderResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + SubmitRfqOrderResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubmitRfqOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubmitRfqOrderResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SubmitRfqOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SubmitRfqOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubmitRfqOrderResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SubmitRfqOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubmitRfqOrderResponse + * @throws IOException if the JSON string is invalid with respect to SubmitRfqOrderResponse + */ + public static SubmitRfqOrderResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubmitRfqOrderResponse.class); + } + + /** + * Convert an instance of SubmitRfqOrderResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderResponseData.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderResponseData.java new file mode 100644 index 0000000..3b0bdb5 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/SubmitRfqOrderResponseData.java @@ -0,0 +1,285 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.binance.connector.client.web3_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.*; + +/** Submitted order details. */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.22.0") +public class SubmitRfqOrderResponseData { + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private String orderId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @jakarta.annotation.Nullable + private Long createdAt; + + public SubmitRfqOrderResponseData() {} + + public SubmitRfqOrderResponseData orderId(@jakarta.annotation.Nullable String orderId) { + this.orderId = orderId; + return this; + } + + /** + * Platform-generated order ID. Use this to poll `GET /order/{orderId}` for the final + * settlement status. + * + * @return orderId + */ + @jakarta.annotation.Nullable + public String getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable String orderId) { + this.orderId = orderId; + } + + public SubmitRfqOrderResponseData status(@jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Initial order status after submission. Typical value: `PENDING_VENDOR` (forwarded + * to vendor, awaiting settlement). + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + public SubmitRfqOrderResponseData createdAt(@jakarta.annotation.Nullable Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Order creation timestamp (Unix epoch milliseconds). + * + * @return createdAt + */ + @jakarta.annotation.Nullable + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@jakarta.annotation.Nullable Long createdAt) { + this.createdAt = createdAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubmitRfqOrderResponseData submitRfqOrderResponseData = (SubmitRfqOrderResponseData) o; + return Objects.equals(this.orderId, submitRfqOrderResponseData.orderId) + && Objects.equals(this.status, submitRfqOrderResponseData.status) + && Objects.equals(this.createdAt, submitRfqOrderResponseData.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, status, createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubmitRfqOrderResponseData {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object createdAtValue = getCreatedAt(); + String createdAtValueAsString = ""; + createdAtValueAsString = createdAtValue.toString(); + sb.append("createdAt=").append(urlEncode(createdAtValueAsString)).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("orderId"); + openapiFields.add("status"); + openapiFields.add("createdAt"); + + // 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 SubmitRfqOrderResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubmitRfqOrderResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SubmitRfqOrderResponseData is not" + + " found in the empty JSON string", + SubmitRfqOrderResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("orderId") != null && !jsonObj.get("orderId").isJsonNull()) + && !jsonObj.get("orderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("orderId").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 (!SubmitRfqOrderResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubmitRfqOrderResponseData' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SubmitRfqOrderResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SubmitRfqOrderResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubmitRfqOrderResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SubmitRfqOrderResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubmitRfqOrderResponseData + * @throws IOException if the JSON string is invalid with respect to SubmitRfqOrderResponseData + */ + public static SubmitRfqOrderResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubmitRfqOrderResponseData.class); + } + + /** + * Convert an instance of SubmitRfqOrderResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/TimeFrame.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/TimeFrame.java new file mode 100644 index 0000000..0263be3 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/TimeFrame.java @@ -0,0 +1,75 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets timeFrame */ +@JsonAdapter(TimeFrame.Adapter.class) +public enum TimeFrame { + TIME_FRAME_1("1"), + + TIME_FRAME_2("2"), + + TIME_FRAME_3("3"); + + private String value; + + TimeFrame(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TimeFrame fromValue(String value) { + for (TimeFrame b : TimeFrame.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TimeFrame enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TimeFrame read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TimeFrame.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TimeFrame.fromValue(value); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/TrackerType.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/TrackerType.java new file mode 100644 index 0000000..acbc5e6 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/TrackerType.java @@ -0,0 +1,75 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets trackerType */ +@JsonAdapter(TrackerType.Adapter.class) +public enum TrackerType { + TRACKER_TYPE_1("1"), + + TRACKER_TYPE_2("2"), + + TRACKER_TYPE_3("3"); + + private String value; + + TrackerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TrackerType fromValue(String value) { + for (TrackerType b : TrackerType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TrackerType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TrackerType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TrackerType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TrackerType.fromValue(value); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/Vendor.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/Vendor.java new file mode 100644 index 0000000..947ab90 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/Vendor.java @@ -0,0 +1,71 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets vendor */ +@JsonAdapter(Vendor.Adapter.class) +public enum Vendor { + LiquidMesh("LiquidMesh"); + + private String value; + + Vendor(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Vendor fromValue(String value) { + for (Vendor b : Vendor.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Vendor enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Vendor read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Vendor.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Vendor.fromValue(value); + } +} diff --git a/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/WalletType.java b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/WalletType.java new file mode 100644 index 0000000..f1041b4 --- /dev/null +++ b/clients/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/model/WalletType.java @@ -0,0 +1,75 @@ +/* + * Binance Web3 API + * Cross-chain wallet, market, trading, and transaction APIs for the Binance Web3 API platform. + * + * 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.web3_wallet.rest.model; + +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import org.hibernate.validator.constraints.*; + +/** Gets or Sets walletType */ +@JsonAdapter(WalletType.Adapter.class) +public enum WalletType { + WALLET_TYPE_1("1"), + + WALLET_TYPE_2("2"), + + WALLET_TYPE_3("3"); + + private String value; + + WalletType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WalletType fromValue(String value) { + for (WalletType b : WalletType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WalletType enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WalletType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WalletType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WalletType.fromValue(value); + } +} diff --git a/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/MarketApiTest.java b/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/GeneralDataApiTest.java similarity index 92% rename from clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/MarketApiTest.java rename to clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/GeneralDataApiTest.java index eed00b8..3eb57a8 100644 --- a/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/MarketApiTest.java +++ b/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/GeneralDataApiTest.java @@ -33,11 +33,11 @@ import static org.junit.Assert.assertEquals; /** - * API tests for MarketApi + * API tests for GeneralDataApi */ -public class MarketApiTest { +public class GeneralDataApiTest { - private MarketApi api; + private GeneralDataApi api; private ApiClient apiClientSpy; private SignatureGenerator signatureGeneratorSpy; @@ -73,7 +73,7 @@ public void initApiClient() throws ApiException { Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); - api = new MarketApi(apiClientSpy); + api = new GeneralDataApi(apiClientSpy); } /** @@ -94,8 +94,8 @@ public void getCandlesTest() throws ApiException, CryptoException { Long before = 1748000000000L; Integer limit = 100; - MarketApi.GetCandlesRequest request = - new MarketApi.GetCandlesRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetCandlesRequest request = + new GeneralDataApi.GetCandlesRequest(binanceChainId, tokenContractAddress); ApiResponse response = api.getCandles(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -130,8 +130,8 @@ public void getHoldersRankingTest() throws ApiException, CryptoException { String nonce = "unique-nonce-string"; Integer tagFilter = null; - MarketApi.GetHoldersRankingRequest request = - new MarketApi.GetHoldersRankingRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetHoldersRankingRequest request = + new GeneralDataApi.GetHoldersRankingRequest(binanceChainId, tokenContractAddress); ApiResponse response = api.getHoldersRanking(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -215,7 +215,7 @@ public void getHotTokenListTest() throws ApiException, CryptoException { Integer pageId = 1; Integer size = 100; - MarketApi.GetHotTokenListRequest request = new MarketApi.GetHotTokenListRequest(); + GeneralDataApi.GetHotTokenListRequest request = new GeneralDataApi.GetHotTokenListRequest("abc123"); ApiResponse response = api.getHotTokenList(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -228,9 +228,9 @@ public void getHotTokenListTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("timestamp=1736393892000", signInputCaptor.getValue()); + assertEquals("binanceChainId=abc123×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "53668e00dc92eb93de0b253c301e9fc0c20042b13db384a0ad94b38688a5a84c", actualRequest.url().queryParameter("signature")); + "7b51156be298e64c0d4a145bdaf590fda8263cc7df3faa0699c3a28be4a4a143", actualRequest.url().queryParameter("signature")); assertEquals("/api/v1/dex/market/token/hot-token", actualRequest.url().encodedPath()); } @@ -246,7 +246,7 @@ public void getSupportedChainsTest() throws ApiException, CryptoException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetSupportedChainsRequest request = new MarketApi.GetSupportedChainsRequest(); + GeneralDataApi.GetSupportedChainsRequest request = new GeneralDataApi.GetSupportedChainsRequest(); ApiResponse response = api.getSupportedChains(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -280,8 +280,8 @@ public void getTokenAdvancedInfoTest() throws ApiException, CryptoException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTokenAdvancedInfoRequest request = - new MarketApi.GetTokenAdvancedInfoRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTokenAdvancedInfoRequest request = + new GeneralDataApi.GetTokenAdvancedInfoRequest(binanceChainId, tokenContractAddress); ApiResponse response = api.getTokenAdvancedInfo(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -316,8 +316,8 @@ public void getTokenBasicInfoTest() throws ApiException, CryptoException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTokenBasicInfoRequest request = - new MarketApi.GetTokenBasicInfoRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTokenBasicInfoRequest request = + new GeneralDataApi.GetTokenBasicInfoRequest(binanceChainId, tokenContractAddress); ApiResponse response = api.getTokenBasicInfo(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -348,7 +348,7 @@ public void getTokenPriceTest() throws ApiException, CryptoException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTokenPriceRequest request = new MarketApi.GetTokenPriceRequest(); + GeneralDataApi.GetTokenPriceRequest request = new GeneralDataApi.GetTokenPriceRequest(); ApiResponse response = api.getTokenPrice(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -385,8 +385,8 @@ public void getTokenTradesTest() throws ApiException, CryptoException { Integer tagFilter = null; String walletAddressFilter = "0x28c6c06298d514db089934071355e5743bf21d60"; - MarketApi.GetTokenTradesRequest request = - new MarketApi.GetTokenTradesRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTokenTradesRequest request = + new GeneralDataApi.GetTokenTradesRequest(binanceChainId, tokenContractAddress); ApiResponse response = api.getTokenTrades(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -417,7 +417,7 @@ public void getTokenTradingInfoTest() throws ApiException, CryptoException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTokenTradingInfoRequest request = new MarketApi.GetTokenTradingInfoRequest(); + GeneralDataApi.GetTokenTradingInfoRequest request = new GeneralDataApi.GetTokenTradingInfoRequest(); ApiResponse response = api.getTokenTradingInfo(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -451,8 +451,8 @@ public void getTopLiquidityPoolsTest() throws ApiException, CryptoException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTopLiquidityPoolsRequest request = - new MarketApi.GetTopLiquidityPoolsRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTopLiquidityPoolsRequest request = + new GeneralDataApi.GetTopLiquidityPoolsRequest(binanceChainId, tokenContractAddress); ApiResponse response = api.getTopLiquidityPools(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -489,8 +489,8 @@ public void getTopTradersTest() throws ApiException, CryptoException { String nonce = "unique-nonce-string"; Integer tagFilter = null; - MarketApi.GetTopTradersRequest request = - new MarketApi.GetTopTradersRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTopTradersRequest request = + new GeneralDataApi.GetTopTradersRequest(binanceChainId, tokenContractAddress); ApiResponse response = api.getTopTraders(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); @@ -522,7 +522,7 @@ public void searchTokenTest() throws ApiException, CryptoException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.SearchTokenRequest request = new MarketApi.SearchTokenRequest(chains, search); + GeneralDataApi.SearchTokenRequest request = new GeneralDataApi.SearchTokenRequest(chains, search); ApiResponse response = api.searchToken(request); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); diff --git a/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/TradingApiTest.java b/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/TradingApiTest.java index b768c50..e8baaea 100644 --- a/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/TradingApiTest.java +++ b/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/TradingApiTest.java @@ -114,7 +114,6 @@ public void buildSwapTransactionTest() throws ApiException, CryptoException { amount, fromTokenAddress, toTokenAddress, - slippagePercent, userWalletAddress, quoteId); ApiResponse response = api.buildSwapTransaction(request); @@ -129,9 +128,9 @@ public void buildSwapTransactionTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("binanceChainId=56&amount=1000000&fromTokenAddress=0x55d398326f99059fF775485246999027B3197955&toTokenAddress=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&slippagePercent=0.5&userWalletAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"eId=a1b2c3d4e5f64a8b9c0d1e2f3a4b5c6d×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals("binanceChainId=56&amount=1000000&fromTokenAddress=0x55d398326f99059fF775485246999027B3197955&toTokenAddress=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&userWalletAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"eId=a1b2c3d4e5f64a8b9c0d1e2f3a4b5c6d×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "fbb6ec18ac54ed188292b0a8f4e42b959c6e32bba96cbca842f7fd4cc740357d", + "3deb8de6611cc31df83d4013faf6b718c3bdf41105355eeea2aafc926cdce95c", actualRequest.url().queryParameter("signature")); assertEquals("/api/v1/dex/aggregator/swap", actualRequest.url().encodedPath()); } diff --git a/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/TransactionApiTest.java b/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/TransactionApiTest.java index a2edac9..524854c 100644 --- a/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/TransactionApiTest.java +++ b/clients/web3-wallet/src/test/java/com/binance/connector/client/web3_wallet/rest/api/TransactionApiTest.java @@ -149,6 +149,20 @@ public void getBroadcastOrdersTest() throws ApiException, CryptoException { public void getGasLimitTest() throws ApiException, CryptoException { GetGasLimitRequest getGasLimitRequest = new GetGasLimitRequest(); getGasLimitRequest.binanceChainId("1"); + GetGasLimitRequestEvmTx getGasLimitRequestEvmTx = new GetGasLimitRequestEvmTx(); + getGasLimitRequestEvmTx.data("123"); + getGasLimitRequestEvmTx.value("abc"); + getGasLimitRequestEvmTx.to("to"); + getGasLimitRequestEvmTx.from("from"); + getGasLimitRequest.evmTx(getGasLimitRequestEvmTx); + GetGasLimitRequestSolTx getGasLimitRequestSolTx = new GetGasLimitRequestSolTx(); + getGasLimitRequestSolTx.base64Tx("abc123"); + getGasLimitRequest.solTx(getGasLimitRequestSolTx); + GetGasLimitRequestTronTx getGasLimitRequestTronTx = new GetGasLimitRequestTronTx(); + getGasLimitRequestTronTx.setFrom("from"); + getGasLimitRequestTronTx.setTxType(GetGasLimitRequestTronTx.TxTypeEnum.TRANSFER_CONTRACT); + + getGasLimitRequest.tronTx(getGasLimitRequestTronTx); Long recvWindow = 5000L; String nonce = "unique-nonce-string"; @@ -163,8 +177,8 @@ public void getGasLimitTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("timestamp=1736393892000binanceChainId=1", signInputCaptor.getValue()); - assertEquals("0708456ff0bebe4504a390eba1cdb4a23e3d7efc004bbc03345597b275ce0a21", actualRequest.url().queryParameter("signature")); + assertEquals("timestamp=1736393892000evmTx=%7B%22from%22%3A%22from%22%2C%22to%22%3A%22to%22%2C%22value%22%3A%22abc%22%2C%22data%22%3A%22123%22%7D&binanceChainId=1&solTx=%7B%22base64Tx%22%3A%22abc123%22%7D&tronTx=%7B%22from%22%3A%22from%22%2C%22txType%22%3A%22TRANSFER_CONTRACT%22%7D", signInputCaptor.getValue()); + assertEquals("c6047dad58e8404a6da4dc7e017f55d93039aae17515da45beabf88cc8a99f12", actualRequest.url().queryParameter("signature")); assertEquals("/api/v1/dex/pre-transaction/gas-limit", actualRequest.url().encodedPath()); } @@ -236,7 +250,21 @@ public void getTransactionSupportedChainsTest() throws ApiException, CryptoExcep public void simulateTransactionsTest() throws ApiException, CryptoException { SimulateTransactionsRequest simulateTransactionsRequest = new SimulateTransactionsRequest(); simulateTransactionsRequest.binanceChainId("1"); - + SimulateTransactionsRequestSolTx simulateTransactionsRequestSolTx = new SimulateTransactionsRequestSolTx(); + simulateTransactionsRequestSolTx.address("abc"); + simulateTransactionsRequestSolTx.base64Tx("abc123"); + + simulateTransactionsRequest.solTx(simulateTransactionsRequestSolTx); + SimulateTransactionsRequestTronTx transactionsRequestTronTx = new SimulateTransactionsRequestTronTx(); + transactionsRequestTronTx.setFrom("from"); + transactionsRequestTronTx.setTxType(SimulateTransactionsRequestTronTx.TxTypeEnum.TRANSFER_CONTRACT); + simulateTransactionsRequest.tronTx(transactionsRequestTronTx); + SimulateTransactionsRequestEvmTx transactionsRequestEvmTx = new SimulateTransactionsRequestEvmTx(); + transactionsRequestEvmTx.data("abc"); + transactionsRequestEvmTx.value("abc"); + transactionsRequestEvmTx.to("to"); + transactionsRequestEvmTx.from("from"); + simulateTransactionsRequest.evmTx(transactionsRequestEvmTx); Long recvWindow = 5000L; String nonce = "unique-nonce-string"; ApiResponse response = api.simulateTransactions(simulateTransactionsRequest, recvWindow, nonce); @@ -250,8 +278,8 @@ public void simulateTransactionsTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("timestamp=1736393892000binanceChainId=1", signInputCaptor.getValue()); - assertEquals("0708456ff0bebe4504a390eba1cdb4a23e3d7efc004bbc03345597b275ce0a21", actualRequest.url().queryParameter("signature")); + assertEquals("timestamp=1736393892000evmTx=%7B%22from%22%3A%22from%22%2C%22to%22%3A%22to%22%2C%22value%22%3A%22abc%22%2C%22data%22%3A%22abc%22%7D&binanceChainId=1&solTx=%7B%22base64Tx%22%3A%22abc123%22%2C%22address%22%3A%22abc%22%7D&tronTx=%7B%22from%22%3A%22from%22%2C%22txType%22%3A%22TRANSFER_CONTRACT%22%7D", signInputCaptor.getValue()); + assertEquals("9a0ffaede39a39b82fdd291003ca0a590d637706a55fdc2303c4cfed80e2ade2", actualRequest.url().queryParameter("signature")); assertEquals("/api/v1/dex/pre-transaction/simulate", actualRequest.url().encodedPath()); } diff --git a/examples/web3-wallet/pom.xml b/examples/web3-wallet/pom.xml index 4d558c1..8f74a77 100644 --- a/examples/web3-wallet/pom.xml +++ b/examples/web3-wallet/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-web3-wallet - 2.0.0 + 3.0.0 \ No newline at end of file diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPnLForSpecificTokenExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPnLForSpecificTokenExample.java new file mode 100644 index 0000000..9e9620a --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPnLForSpecificTokenExample.java @@ -0,0 +1,50 @@ +package com.binance.connector.client.web3_wallet.rest.addressportfolio; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressPnLForSpecificTokenResponse; + +/** API examples for AddressPortfolioApi */ +public class GetAddressPnLForSpecificTokenExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Address PnL for Specific Token + * + *

Return the latest realized PnL detail for a specific token held by an address, including + * buy/sell stats, current balance, and holding duration. + * + * @throws ApiException if the Api call fails + */ + public void getAddressPnLForSpecificTokenExample() throws ApiException { + String binanceChainId = "1"; + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60"; + String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + AddressPortfolioApi.GetAddressPnLForSpecificTokenRequest request = + new AddressPortfolioApi.GetAddressPnLForSpecificTokenRequest( + binanceChainId, walletAddress, tokenContractAddress); + ApiResponse response = + getApi().getAddressPnLForSpecificToken(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPortfolioOverviewExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPortfolioOverviewExample.java new file mode 100644 index 0000000..d976c47 --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressPortfolioOverviewExample.java @@ -0,0 +1,51 @@ +package com.binance.connector.client.web3_wallet.rest.addressportfolio; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressPortfolioOverviewResponse; +import com.binance.connector.client.web3_wallet.rest.model.TimeFrame; + +/** API examples for AddressPortfolioApi */ +public class GetAddressPortfolioOverviewExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Address Portfolio Overview + * + *

Return trading performance overview for an address within the selected time frame, + * including realized PnL, daily PnL breakdown, win rate, and top 3 profitable tokens. + * + * @throws ApiException if the Api call fails + */ + public void getAddressPortfolioOverviewExample() throws ApiException { + String binanceChainId = "1"; + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60"; + TimeFrame timeFrame = TimeFrame.TIME_FRAME_1; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + AddressPortfolioApi.GetAddressPortfolioOverviewRequest request = + new AddressPortfolioApi.GetAddressPortfolioOverviewRequest( + binanceChainId, walletAddress, timeFrame); + ApiResponse response = + getApi().getAddressPortfolioOverview(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetWalletSupportedChainsExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressRecentPnLExample.java similarity index 58% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetWalletSupportedChainsExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressRecentPnLExample.java index 6743562..f47348b 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetWalletSupportedChainsExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetAddressRecentPnLExample.java @@ -1,16 +1,16 @@ -package com.binance.connector.client.web3_wallet.rest.wallet; +package com.binance.connector.client.web3_wallet.rest.addressportfolio; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.WalletApi; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; -import com.binance.connector.client.web3_wallet.rest.model.GetWalletSupportedChainsResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetAddressRecentPnLResponse; -/** API examples for WalletApi */ -public class GetWalletSupportedChainsExample { +/** API examples for AddressPortfolioApi */ +public class GetAddressRecentPnLExample { private Web3WalletRestApi api; public Web3WalletRestApi getApi() { @@ -27,22 +27,22 @@ public Web3WalletRestApi getApi() { } /** - * Get Wallet Supported Chains + * Get Address Recent PnL * - *

Return blockchain networks for which the Wallet service can return balances. The supported - * list is dynamically configured server-side and may change over time. Pass - * `binanceChainId` to filter to a single chain; omit to get the full list. + *

Return recent realized PnL list for an address. * * @throws ApiException if the Api call fails */ - public void getWalletSupportedChainsExample() throws ApiException { + public void getAddressRecentPnLExample() throws ApiException { + String binanceChainId = "1"; + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - String binanceChainId = "1"; - WalletApi.GetWalletSupportedChainsRequest request = - new WalletApi.GetWalletSupportedChainsRequest(); - ApiResponse response = - getApi().getWalletSupportedChains(request); + String cursor = ""; + String limit = "20"; + AddressPortfolioApi.GetAddressRecentPnLRequest request = + new AddressPortfolioApi.GetAddressRecentPnLRequest(binanceChainId, walletAddress); + ApiResponse response = getApi().getAddressRecentPnL(request); System.out.println(response.getData()); } } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetDexTradeHistoryExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetDexTradeHistoryExample.java new file mode 100644 index 0000000..f7d3ce7 --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetDexTradeHistoryExample.java @@ -0,0 +1,54 @@ +package com.binance.connector.client.web3_wallet.rest.addressportfolio; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetDexTradeHistoryResponse; +import com.binance.connector.client.web3_wallet.rest.model.OrderType; + +/** API examples for AddressPortfolioApi */ +public class GetDexTradeHistoryExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get DEX Trade History + * + *

Return swap trade history for a specific address. Supports filtering by time range, token, + * and trade type. + * + * @throws ApiException if the Api call fails + */ + public void getDexTradeHistoryExample() throws ApiException { + String binanceChainId = "1"; + String walletAddress = "0x28c6c06298d514db089934071355e5743bf21d60"; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + String begin = "1714000000000"; + String end = "1748601600000"; + String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; + OrderType type = OrderType.TYPE_1; + String cursor = ""; + String limit = "20"; + AddressPortfolioApi.GetDexTradeHistoryRequest request = + new AddressPortfolioApi.GetDexTradeHistoryRequest(binanceChainId, walletAddress); + ApiResponse response = getApi().getDexTradeHistory(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetLeaderboardExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetLeaderboardExample.java new file mode 100644 index 0000000..e4b7e6e --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetLeaderboardExample.java @@ -0,0 +1,62 @@ +package com.binance.connector.client.web3_wallet.rest.addressportfolio; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetLeaderboardResponse; +import com.binance.connector.client.web3_wallet.rest.model.SortBy; +import com.binance.connector.client.web3_wallet.rest.model.TimeFrame; +import com.binance.connector.client.web3_wallet.rest.model.WalletType; + +/** API examples for AddressPortfolioApi */ +public class GetLeaderboardExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Leaderboard + * + *

Return a leaderboard of top-performing wallets, with sorting and filtering by PnL, win + * rate, transaction count, and volume. + * + * @throws ApiException if the Api call fails + */ + public void getLeaderboardExample() throws ApiException { + String binanceChainId = "1"; + TimeFrame timeFrame = TimeFrame.TIME_FRAME_1; + SortBy sortBy = SortBy.SORT_BY_1; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + WalletType walletType = WalletType.WALLET_TYPE_1; + String minRealizedPnlUsd = "1000"; + String maxRealizedPnlUsd = "50000"; + String minWinRatePercent = "50"; + String maxWinRatePercent = "90"; + String minTxs = "10"; + String maxTxs = "1000"; + String minTxVolume = "5000"; + String maxTxVolume = "1000000"; + String cursor = ""; + String limit = "50"; + AddressPortfolioApi.GetLeaderboardRequest request = + new AddressPortfolioApi.GetLeaderboardRequest(binanceChainId, timeFrame, sortBy); + ApiResponse response = getApi().getLeaderboard(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetPortfolioSupportedChainsExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetPortfolioSupportedChainsExample.java new file mode 100644 index 0000000..d918d6a --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetPortfolioSupportedChainsExample.java @@ -0,0 +1,45 @@ +package com.binance.connector.client.web3_wallet.rest.addressportfolio; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetPortfolioSupportedChainsResponse; + +/** API examples for AddressPortfolioApi */ +public class GetPortfolioSupportedChainsExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Portfolio Supported Chains + * + *

Return the list of blockchains supported by address portfolio analysis. + * + * @throws ApiException if the Api call fails + */ + public void getPortfolioSupportedChainsExample() throws ApiException { + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + AddressPortfolioApi.GetPortfolioSupportedChainsRequest request = + new AddressPortfolioApi.GetPortfolioSupportedChainsRequest(); + ApiResponse response = + getApi().getPortfolioSupportedChains(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTransactionsByAddressExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetTrackedTradesExample.java similarity index 51% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTransactionsByAddressExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetTrackedTradesExample.java index 8d498c1..9de9f4b 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTransactionsByAddressExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/addressportfolio/GetTrackedTradesExample.java @@ -1,16 +1,17 @@ -package com.binance.connector.client.web3_wallet.rest.wallet; +package com.binance.connector.client.web3_wallet.rest.addressportfolio; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.WalletApi; +import com.binance.connector.client.web3_wallet.rest.api.AddressPortfolioApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; -import com.binance.connector.client.web3_wallet.rest.model.GetTransactionsByAddressResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetTrackedTradesResponse; +import com.binance.connector.client.web3_wallet.rest.model.TrackerType; -/** API examples for WalletApi */ -public class GetTransactionsByAddressExample { +/** API examples for AddressPortfolioApi */ +public class GetTrackedTradesExample { private Web3WalletRestApi api; public Web3WalletRestApi getApi() { @@ -27,28 +28,30 @@ public Web3WalletRestApi getApi() { } /** - * Get Transactions by Address + * Get Tracked Trades * - *

Return on-chain transaction history for a wallet address across one or more chains. - * Results are limited to the most recent 6 months and sorted by time (descending). Supports - * cursor pagination, time-range filtering, and token-contract filtering. + *

Return the latest swap trades from tracked addresses (smart money, KOL, or custom address + * list). * * @throws ApiException if the Api call fails */ - public void getTransactionsByAddressExample() throws ApiException { - String address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; - String chains = "1,56"; + public void getTrackedTradesExample() throws ApiException { + TrackerType trackerType = TrackerType.TRACKER_TYPE_1; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - String tokenContractAddress = "0xdAC17F958D2ee523a2206206994597C13D831ec7"; - Long begin = 1746000000000L; - Long end = 1748601600000L; - String cursor = "eyJ0aW1lIjoxNzQ4NjAwMDAwMDAwLCJpZCI6MTIzfQ=="; - Integer limit = 20; - WalletApi.GetTransactionsByAddressRequest request = - new WalletApi.GetTransactionsByAddressRequest(address, chains); - ApiResponse response = - getApi().getTransactionsByAddress(request); + String walletAddress = + "0x28c6c06298d514db089934071355e5743bf21d60,0xd8da6bf26964af9d7eed9e03e53415d37aa96045"; + String tradeType = "0"; + String binanceChainId = "1"; + String minVolume = "100"; + String maxVolume = "100000"; + String minMarketCap = "10000"; + String maxMarketCap = "10000000"; + Boolean isHideRiskToken = true; + Integer limit = 50; + AddressPortfolioApi.GetTrackedTradesRequest request = + new AddressPortfolioApi.GetTrackedTradesRequest(trackerType); + ApiResponse response = getApi().getTrackedTrades(request); System.out.println(response.getData()); } } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetCandlesExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetCandlesExample.java similarity index 85% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetCandlesExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetCandlesExample.java index 354f585..9b45b77 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetCandlesExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetCandlesExample.java @@ -1,16 +1,16 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.Bar; import com.binance.connector.client.web3_wallet.rest.model.GetCandlesResponse; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetCandlesExample { private Web3WalletRestApi api; @@ -43,8 +43,8 @@ public void getCandlesExample() throws ApiException { Long after = 1748600000000L; Long before = 1748000000000L; Integer limit = 100; - MarketApi.GetCandlesRequest request = - new MarketApi.GetCandlesRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetCandlesRequest request = + new GeneralDataApi.GetCandlesRequest(binanceChainId, tokenContractAddress); ApiResponse response = getApi().getCandles(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetHoldersRankingExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetHoldersRankingExample.java similarity index 85% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetHoldersRankingExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetHoldersRankingExample.java index 2ac5158..67db828 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetHoldersRankingExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetHoldersRankingExample.java @@ -1,16 +1,16 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetHoldersRankingResponse; import com.binance.connector.client.web3_wallet.rest.model.TagFilter; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetHoldersRankingExample { private Web3WalletRestApi api; @@ -42,8 +42,8 @@ public void getHoldersRankingExample() throws ApiException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; TagFilter tagFilter = TagFilter.TAG_FILTER_1; - MarketApi.GetHoldersRankingRequest request = - new MarketApi.GetHoldersRankingRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetHoldersRankingRequest request = + new GeneralDataApi.GetHoldersRankingRequest(binanceChainId, tokenContractAddress); ApiResponse response = getApi().getHoldersRanking(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetHotTokenListExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetHotTokenListExample.java similarity index 93% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetHotTokenListExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetHotTokenListExample.java index 0bb19c0..9b34848 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetHotTokenListExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetHotTokenListExample.java @@ -1,17 +1,17 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetHotTokenListResponse; import com.binance.connector.client.web3_wallet.rest.model.RankBy; import com.binance.connector.client.web3_wallet.rest.model.RankingTimeFrame; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetHotTokenListExample { private Web3WalletRestApi api; @@ -37,9 +37,9 @@ public Web3WalletRestApi getApi() { * @throws ApiException if the Api call fails */ public void getHotTokenListExample() throws ApiException { + String binanceChainId = "1"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - String binanceChainId = "1"; RankBy rankBy = RankBy.RANK_BY_1; RankingTimeFrame rankingTimeFrame = RankingTimeFrame.RANKING_TIME_FRAME_1; String priceChangePercentMin = "5"; @@ -91,7 +91,8 @@ public void getHotTokenListExample() throws ApiException { Boolean isHideInternalWashTradingTokens = true; Integer pageId = 1; Integer size = 100; - MarketApi.GetHotTokenListRequest request = new MarketApi.GetHotTokenListRequest(); + GeneralDataApi.GetHotTokenListRequest request = + new GeneralDataApi.GetHotTokenListRequest(binanceChainId); ApiResponse response = getApi().getHotTokenList(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetSupportedChainsExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetSupportedChainsExample.java similarity index 84% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetSupportedChainsExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetSupportedChainsExample.java index d963ed4..1bd909b 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetSupportedChainsExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetSupportedChainsExample.java @@ -1,15 +1,15 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetSupportedChainsResponse; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetSupportedChainsExample { private Web3WalletRestApi api; @@ -36,7 +36,8 @@ public Web3WalletRestApi getApi() { public void getSupportedChainsExample() throws ApiException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetSupportedChainsRequest request = new MarketApi.GetSupportedChainsRequest(); + GeneralDataApi.GetSupportedChainsRequest request = + new GeneralDataApi.GetSupportedChainsRequest(); ApiResponse response = getApi().getSupportedChains(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenAdvancedInfoExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenAdvancedInfoExample.java similarity index 83% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenAdvancedInfoExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenAdvancedInfoExample.java index 2079077..0c1cdb0 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenAdvancedInfoExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenAdvancedInfoExample.java @@ -1,15 +1,15 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetTokenAdvancedInfoResponse; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetTokenAdvancedInfoExample { private Web3WalletRestApi api; @@ -40,8 +40,9 @@ public void getTokenAdvancedInfoExample() throws ApiException { String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTokenAdvancedInfoRequest request = - new MarketApi.GetTokenAdvancedInfoRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTokenAdvancedInfoRequest request = + new GeneralDataApi.GetTokenAdvancedInfoRequest( + binanceChainId, tokenContractAddress); ApiResponse response = getApi().getTokenAdvancedInfo(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenBasicInfoExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenBasicInfoExample.java similarity index 84% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenBasicInfoExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenBasicInfoExample.java index 56d5064..ca04b95 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenBasicInfoExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenBasicInfoExample.java @@ -1,15 +1,15 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetTokenBasicInfoResponse; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetTokenBasicInfoExample { private Web3WalletRestApi api; @@ -39,8 +39,8 @@ public void getTokenBasicInfoExample() throws ApiException { String tokenContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTokenBasicInfoRequest request = - new MarketApi.GetTokenBasicInfoRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTokenBasicInfoRequest request = + new GeneralDataApi.GetTokenBasicInfoRequest(binanceChainId, tokenContractAddress); ApiResponse response = getApi().getTokenBasicInfo(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTokenBalancesByAddressExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenDevInfoExample.java similarity index 53% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTokenBalancesByAddressExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenDevInfoExample.java index aaa67d9..7edc441 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTokenBalancesByAddressExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenDevInfoExample.java @@ -1,16 +1,16 @@ -package com.binance.connector.client.web3_wallet.rest.wallet; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; -import com.binance.connector.client.web3_wallet.rest.model.GetTokenBalancesByAddressRequest; -import com.binance.connector.client.web3_wallet.rest.model.GetTokenBalancesByAddressResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetTokenDevInfoResponse; -/** API examples for WalletApi */ -public class GetTokenBalancesByAddressExample { +/** API examples for GeneralDataApi */ +public class GetTokenDevInfoExample { private Web3WalletRestApi api; public Web3WalletRestApi getApi() { @@ -27,24 +27,21 @@ public Web3WalletRestApi getApi() { } /** - * Get Token Balances by Address + * Get Token Dev Info * - *

Return token balances for a specific list of (chain, contract) pairs. Up to 20 entries per - * request. Set `excludeRiskToken=\"0\"` to exclude risk-flagged tokens - * (default), or `\"1\"` to include them. + *

Return developer profile for a token, including historical token launch stats, current + * holding percentage, and initial funding source. * * @throws ApiException if the Api call fails */ - public void getTokenBalancesByAddressExample() throws ApiException { - GetTokenBalancesByAddressRequest getTokenBalancesByAddressRequest = - new GetTokenBalancesByAddressRequest(); - getTokenBalancesByAddressRequest.address("0x50c476a139aab23fdaf9bca12614cdd54a4244e3"); - getTokenBalancesByAddressRequest.tokenContractAddresses(null); + public void getTokenDevInfoExample() throws ApiException { + String binanceChainId = "CT_501"; + String tokenContractAddress = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - ApiResponse response = - getApi().getTokenBalancesByAddress( - getTokenBalancesByAddressRequest, recvWindow, nonce); + GeneralDataApi.GetTokenDevInfoRequest request = + new GeneralDataApi.GetTokenDevInfoRequest(binanceChainId, tokenContractAddress); + ApiResponse response = getApi().getTokenDevInfo(request); System.out.println(response.getData()); } } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenPriceExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenPriceExample.java similarity index 85% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenPriceExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenPriceExample.java index 02b37e6..c7a05ae 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenPriceExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenPriceExample.java @@ -1,15 +1,15 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetTokenPriceResponse; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetTokenPriceExample { private Web3WalletRestApi api; @@ -36,7 +36,7 @@ public Web3WalletRestApi getApi() { public void getTokenPriceExample() throws ApiException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTokenPriceRequest request = new MarketApi.GetTokenPriceRequest(); + GeneralDataApi.GetTokenPriceRequest request = new GeneralDataApi.GetTokenPriceRequest(); ApiResponse response = getApi().getTokenPrice(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenTradesExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenTradesExample.java similarity index 86% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenTradesExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenTradesExample.java index 50bd9af..3f05cac 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenTradesExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenTradesExample.java @@ -1,16 +1,16 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetTokenTradesResponse; import com.binance.connector.client.web3_wallet.rest.model.TagFilter; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetTokenTradesExample { private Web3WalletRestApi api; @@ -44,8 +44,8 @@ public void getTokenTradesExample() throws ApiException { Integer limit = 100; TagFilter tagFilter = TagFilter.TAG_FILTER_1; String walletAddressFilter = "0x28c6c06298d514db089934071355e5743bf21d60"; - MarketApi.GetTokenTradesRequest request = - new MarketApi.GetTokenTradesRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTokenTradesRequest request = + new GeneralDataApi.GetTokenTradesRequest(binanceChainId, tokenContractAddress); ApiResponse response = getApi().getTokenTrades(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenTradingInfoExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenTradingInfoExample.java similarity index 85% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenTradingInfoExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenTradingInfoExample.java index 33ee06b..77f4e51 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTokenTradingInfoExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTokenTradingInfoExample.java @@ -1,15 +1,15 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetTokenTradingInfoResponse; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetTokenTradingInfoExample { private Web3WalletRestApi api; @@ -37,7 +37,8 @@ public Web3WalletRestApi getApi() { public void getTokenTradingInfoExample() throws ApiException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTokenTradingInfoRequest request = new MarketApi.GetTokenTradingInfoRequest(); + GeneralDataApi.GetTokenTradingInfoRequest request = + new GeneralDataApi.GetTokenTradingInfoRequest(); ApiResponse response = getApi().getTokenTradingInfo(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTopLiquidityPoolsExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTopLiquidityPoolsExample.java similarity index 83% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTopLiquidityPoolsExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTopLiquidityPoolsExample.java index dac7d5a..534d60f 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTopLiquidityPoolsExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTopLiquidityPoolsExample.java @@ -1,15 +1,15 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetTopLiquidityPoolsResponse; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetTopLiquidityPoolsExample { private Web3WalletRestApi api; @@ -39,8 +39,9 @@ public void getTopLiquidityPoolsExample() throws ApiException { String tokenContractAddress = "0x6982508145454ce325ddbe47a25d4ec3d2311933"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.GetTopLiquidityPoolsRequest request = - new MarketApi.GetTopLiquidityPoolsRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTopLiquidityPoolsRequest request = + new GeneralDataApi.GetTopLiquidityPoolsRequest( + binanceChainId, tokenContractAddress); ApiResponse response = getApi().getTopLiquidityPools(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTopTradersExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTopTradersExample.java similarity index 86% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTopTradersExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTopTradersExample.java index 531aaa4..fb48ab7 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/GetTopTradersExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/GetTopTradersExample.java @@ -1,16 +1,16 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.GetTopTradersResponse; import com.binance.connector.client.web3_wallet.rest.model.TagFilter; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class GetTopTradersExample { private Web3WalletRestApi api; @@ -42,8 +42,8 @@ public void getTopTradersExample() throws ApiException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; TagFilter tagFilter = TagFilter.TAG_FILTER_1; - MarketApi.GetTopTradersRequest request = - new MarketApi.GetTopTradersRequest(binanceChainId, tokenContractAddress); + GeneralDataApi.GetTopTradersRequest request = + new GeneralDataApi.GetTopTradersRequest(binanceChainId, tokenContractAddress); ApiResponse response = getApi().getTopTraders(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/SearchTokenExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/SearchTokenExample.java similarity index 84% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/SearchTokenExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/SearchTokenExample.java index f50f0fd..c0aed31 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/market/SearchTokenExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/generaldata/SearchTokenExample.java @@ -1,15 +1,15 @@ -package com.binance.connector.client.web3_wallet.rest.market; +package com.binance.connector.client.web3_wallet.rest.generaldata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.MarketApi; +import com.binance.connector.client.web3_wallet.rest.api.GeneralDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; import com.binance.connector.client.web3_wallet.rest.model.SearchTokenResponse; -/** API examples for MarketApi */ +/** API examples for GeneralDataApi */ public class SearchTokenExample { private Web3WalletRestApi api; @@ -38,7 +38,8 @@ public void searchTokenExample() throws ApiException { String search = "USDT"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - MarketApi.SearchTokenRequest request = new MarketApi.SearchTokenRequest(chains, search); + GeneralDataApi.SearchTokenRequest request = + new GeneralDataApi.SearchTokenRequest(chains, search); ApiResponse response = getApi().searchToken(request); System.out.println(response.getData()); } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetAllTokenBalancesByAddressExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenIssuancePlatformsExample.java similarity index 52% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetAllTokenBalancesByAddressExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenIssuancePlatformsExample.java index 7be473e..98a1e83 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetAllTokenBalancesByAddressExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenIssuancePlatformsExample.java @@ -1,16 +1,17 @@ -package com.binance.connector.client.web3_wallet.rest.wallet; +package com.binance.connector.client.web3_wallet.rest.rwadata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.WalletApi; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; -import com.binance.connector.client.web3_wallet.rest.model.GetAllTokenBalancesByAddressResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenIssuancePlatformsResponse; +import com.binance.connector.client.web3_wallet.rest.model.PlatformId; -/** API examples for WalletApi */ -public class GetAllTokenBalancesByAddressExample { +/** API examples for RwaDataApi */ +public class GetRwaTokenIssuancePlatformsExample { private Web3WalletRestApi api; public Web3WalletRestApi getApi() { @@ -27,26 +28,20 @@ public Web3WalletRestApi getApi() { } /** - * Get All Token Balances by Address + * Get RWA Token Issuance Platforms * - *

Return all token balances held by an address across one or more chains, with pagination - * support. Set `excludeRiskToken=true` to filter out airdrop-risk and honeypot - * tokens (honeypot detection currently applies only to ETH / BSC / SOL / BASE). + *

Return the list of supported RWA token issuance platforms and their basic info. * * @throws ApiException if the Api call fails */ - public void getAllTokenBalancesByAddressExample() throws ApiException { + public void getRwaTokenIssuancePlatformsExample() throws ApiException { Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - String address = "0xed0c6079229e2d407672a117c22b62064f4a4312"; - String chains = "1,56"; - Boolean excludeRiskToken = true; - Long page = 1L; - Integer pageSize = 20; - WalletApi.GetAllTokenBalancesByAddressRequest request = - new WalletApi.GetAllTokenBalancesByAddressRequest(); - ApiResponse response = - getApi().getAllTokenBalancesByAddress(request); + PlatformId platformId = PlatformId.ondo; + RwaDataApi.GetRwaTokenIssuancePlatformsRequest request = + new RwaDataApi.GetRwaTokenIssuancePlatformsRequest(); + ApiResponse response = + getApi().getRwaTokenIssuancePlatforms(request); System.out.println(response.getData()); } } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenListExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenListExample.java new file mode 100644 index 0000000..e41dd45 --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenListExample.java @@ -0,0 +1,48 @@ +package com.binance.connector.client.web3_wallet.rest.rwadata; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenListResponse; +import com.binance.connector.client.web3_wallet.rest.model.PlatformId; + +/** API examples for RwaDataApi */ +public class GetRwaTokenListExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWA Token List + * + *

Get the list of RWA tokens with underlying asset info. Supports filtering by platform and + * sector tab. + * + * @throws ApiException if the Api call fails + */ + public void getRwaTokenListExample() throws ApiException { + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + String binanceChainId = "56"; + PlatformId platformId = PlatformId.ondo; + Integer tabId = 9; + RwaDataApi.GetRwaTokenListRequest request = new RwaDataApi.GetRwaTokenListRequest(); + ApiResponse response = getApi().getRwaTokenList(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenPriceExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenPriceExample.java new file mode 100644 index 0000000..8dac187 --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaTokenPriceExample.java @@ -0,0 +1,46 @@ +package com.binance.connector.client.web3_wallet.rest.rwadata; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaTokenPriceResponse; + +/** API examples for RwaDataApi */ +public class GetRwaTokenPriceExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWA Token Price + * + *

Batch query RWA token prices, including on-chain price and underlying reference price. + * + * @throws ApiException if the Api call fails + */ + public void getRwaTokenPriceExample() throws ApiException { + String binanceChainId = "56"; + String tokenContractAddresses = "0x8755c5c39b1aa9053a83ac731242a2cf4d04b0fe"; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + RwaDataApi.GetRwaTokenPriceRequest request = + new RwaDataApi.GetRwaTokenPriceRequest(binanceChainId, tokenContractAddresses); + ApiResponse response = getApi().getRwaTokenPrice(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingInfoExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingInfoExample.java new file mode 100644 index 0000000..8742668 --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingInfoExample.java @@ -0,0 +1,46 @@ +package com.binance.connector.client.web3_wallet.rest.rwadata; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaUnderlyingInfoResponse; + +/** API examples for RwaDataApi */ +public class GetRwaUnderlyingInfoExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RWA Underlying Info + * + *

Get the underlying company information for an RWA token. + * + * @throws ApiException if the Api call fails + */ + public void getRwaUnderlyingInfoExample() throws ApiException { + String binanceChainId = "56"; + String tokenContractAddress = "0x8755c5c39b1aa9053a83ac731242a2cf4d04b0fe"; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + RwaDataApi.GetRwaUnderlyingInfoRequest request = + new RwaDataApi.GetRwaUnderlyingInfoRequest(binanceChainId, tokenContractAddress); + ApiResponse response = getApi().getRwaUnderlyingInfo(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTransactionDetailByHashExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingMarketDataExample.java similarity index 54% rename from examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTransactionDetailByHashExample.java rename to examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingMarketDataExample.java index 9c342f1..bac95cb 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/wallet/GetTransactionDetailByHashExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/GetRwaUnderlyingMarketDataExample.java @@ -1,16 +1,16 @@ -package com.binance.connector.client.web3_wallet.rest.wallet; +package com.binance.connector.client.web3_wallet.rest.rwadata; 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.web3_wallet.rest.Web3WalletRestApiUtil; -import com.binance.connector.client.web3_wallet.rest.api.WalletApi; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; -import com.binance.connector.client.web3_wallet.rest.model.GetTransactionDetailByHashResponse; +import com.binance.connector.client.web3_wallet.rest.model.GetRwaUnderlyingMarketDataResponse; -/** API examples for WalletApi */ -public class GetTransactionDetailByHashExample { +/** API examples for RwaDataApi */ +public class GetRwaUnderlyingMarketDataExample { private Web3WalletRestApi api; public Web3WalletRestApi getApi() { @@ -27,24 +27,22 @@ public Web3WalletRestApi getApi() { } /** - * Get Transaction Detail by Hash + * Get RWA Underlying Market Data * - *

Look up the full on-chain transaction detail by `binanceChainId` + - * `txHash`. Returns one or more entries describing transaction inputs, outputs, - * internal calls, and token transfers. + *

Get market data for the underlying asset of an RWA token. * * @throws ApiException if the Api call fails */ - public void getTransactionDetailByHashExample() throws ApiException { + public void getRwaUnderlyingMarketDataExample() throws ApiException { + String binanceChainId = "56"; + String tokenContractAddress = "0x8755c5c39b1aa9053a83ac731242a2cf4d04b0fe"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; - String binanceChainId = "1"; - String txHash = "0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890"; - String itype = "0"; - WalletApi.GetTransactionDetailByHashRequest request = - new WalletApi.GetTransactionDetailByHashRequest(); - ApiResponse response = - getApi().getTransactionDetailByHash(request); + RwaDataApi.GetRwaUnderlyingMarketDataRequest request = + new RwaDataApi.GetRwaUnderlyingMarketDataRequest( + binanceChainId, tokenContractAddress); + ApiResponse response = + getApi().getRwaUnderlyingMarketData(request); System.out.println(response.getData()); } } diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/SearchRwaTokenExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/SearchRwaTokenExample.java new file mode 100644 index 0000000..93e9b01 --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/rwadata/SearchRwaTokenExample.java @@ -0,0 +1,46 @@ +package com.binance.connector.client.web3_wallet.rest.rwadata; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.RwaDataApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.PlatformId; +import com.binance.connector.client.web3_wallet.rest.model.SearchRwaTokenResponse; + +/** API examples for RwaDataApi */ +public class SearchRwaTokenExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Search RWA Token + * + *

Search RWA tokens by keyword or contract address. + * + * @throws ApiException if the Api call fails + */ + public void searchRwaTokenExample() throws ApiException { + String keyword = "NVDA"; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + PlatformId platformId = PlatformId.ondo; + RwaDataApi.SearchRwaTokenRequest request = new RwaDataApi.SearchRwaTokenRequest(keyword); + ApiResponse response = getApi().searchRwaToken(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSolanaSwapInstructionsExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSolanaSwapInstructionsExample.java new file mode 100644 index 0000000..bb8069a --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSolanaSwapInstructionsExample.java @@ -0,0 +1,80 @@ +package com.binance.connector.client.web3_wallet.rest.trading; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.TradingApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.AutoSlippage; +import com.binance.connector.client.web3_wallet.rest.model.BinanceChainId; +import com.binance.connector.client.web3_wallet.rest.model.BuildSolanaSwapInstructionsResponse; +import com.binance.connector.client.web3_wallet.rest.model.GasLevel; + +/** API examples for TradingApi */ +public class BuildSolanaSwapInstructionsExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Build Solana Swap Instructions + * + *

Solana-only counterpart to `/swap`. Shares the full quote → route → vendor + * `buildSwapTx` → priceImpact → minReceive → instruction-assembly pipeline; the only + * difference is the response: instead of returning a signed-and-serialized base64 transaction, + * this endpoint returns the **uncompiled** instruction list plus the address-lookup-table (ALT) + * address list, leaving v0-transaction compilation, signing, and submission to the caller. Use + * this when the caller needs to: - prepend / append their own instructions (e.g. fee splitting, + * custom logging) before signing; - reuse the platform-curated route, slippage, PS-variant + * rewriting, ALT injection, ComputeBudget overwrite, and ATA batching while still controlling + * the final wire format. Only supports `binanceChainId=CT_501` (Solana). Other + * chains return `CHAIN_NOT_SUPPORTED` (40411). Parameters mirror the Solana subset of + * `/swap` (no EVM-only `approveTransaction` / `approveAmount` / + * `gasLimit`). + * + * @throws ApiException if the Api call fails + */ + public void buildSolanaSwapInstructionsExample() throws ApiException { + BinanceChainId binanceChainId = BinanceChainId.CT_501; + String amount = "12000000"; + String fromTokenAddress = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"; + String toTokenAddress = "So11111111111111111111111111111111111111112"; + String slippagePercent = "0.5"; + String userWalletAddress = "J5CBzXpcYn6WR2JBah8zU4Yxct985CAFGwXRcFaX2pbS"; + String quoteId = "a1b2c3d4e5f64a8b9c0d1e2f3a4b5c6d"; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + String priceImpactProtectionPercent = "90"; + AutoSlippage autoSlippage = AutoSlippage.TRUE; + String maxAutoSlippagePercent = "3"; + String computeUnitLimit = "1400000"; + String computeUnitPrice = "1000"; + GasLevel gasLevel = GasLevel.slow; + String tips = "0.001"; + TradingApi.BuildSolanaSwapInstructionsRequest request = + new TradingApi.BuildSolanaSwapInstructionsRequest( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + slippagePercent, + userWalletAddress, + quoteId); + ApiResponse response = + getApi().buildSolanaSwapInstructions(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSwapTransactionExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSwapTransactionExample.java index a4bc70f..3aa2c76 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSwapTransactionExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/BuildSwapTransactionExample.java @@ -44,11 +44,11 @@ public void buildSwapTransactionExample() throws ApiException { String amount = "1000000"; String fromTokenAddress = "0x55d398326f99059fF775485246999027B3197955"; String toTokenAddress = "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"; - String slippagePercent = "0.5"; String userWalletAddress = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; String quoteId = "a1b2c3d4e5f64a8b9c0d1e2f3a4b5c6d"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; + String slippagePercent = "0.5"; ApproveTransaction approveTransaction = ApproveTransaction.TRUE; String approveAmount = "1000000"; String gasLimit = "200000"; @@ -65,7 +65,6 @@ public void buildSwapTransactionExample() throws ApiException { amount, fromTokenAddress, toTokenAddress, - slippagePercent, userWalletAddress, quoteId); ApiResponse response = getApi().buildSwapTransaction(request); diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetAggregatedQuoteExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetAggregatedQuoteExample.java index 947359f..677dea1 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetAggregatedQuoteExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetAggregatedQuoteExample.java @@ -42,6 +42,7 @@ public void getAggregatedQuoteExample() throws ApiException { String toTokenAddress = "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; + String userWalletAddress = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; TradingApi.GetAggregatedQuoteRequest request = new TradingApi.GetAggregatedQuoteRequest( binanceChainId, amount, fromTokenAddress, toTokenAddress); diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetErc20ApproveTransactionExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetErc20ApproveTransactionExample.java index a66b8bc..99899d1 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetErc20ApproveTransactionExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetErc20ApproveTransactionExample.java @@ -41,6 +41,7 @@ public void getErc20ApproveTransactionExample() throws ApiException { String approveAmount = "1000000"; Long recvWindow = 5000L; String nonce = "unique-nonce-string"; + String vendor = "PcsXRfq"; TradingApi.GetErc20ApproveTransactionRequest request = new TradingApi.GetErc20ApproveTransactionRequest( binanceChainId, tokenContractAddress, approveAmount); diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetRfqOrderStatusExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetRfqOrderStatusExample.java new file mode 100644 index 0000000..6c5dafb --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/GetRfqOrderStatusExample.java @@ -0,0 +1,48 @@ +package com.binance.connector.client.web3_wallet.rest.trading; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.TradingApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.GetRfqOrderStatusResponse; + +/** API examples for TradingApi */ +public class GetRfqOrderStatusExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Get RFQ Order Status + * + *

Query the settlement status of an RFQ order by its platform `orderId` (returned + * by `POST /order/submit`). Poll this endpoint until `status` reaches a + * terminal state: `FILLED` (settled on-chain) or `FAILED` (settlement + * failed). + * + * @throws ApiException if the Api call fails + */ + public void getRfqOrderStatusExample() throws ApiException { + String orderId = "oc-o-abc123def456"; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + TradingApi.GetRfqOrderStatusRequest request = + new TradingApi.GetRfqOrderStatusRequest(orderId); + ApiResponse response = getApi().getRfqOrderStatus(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/QuoteAndBuildSwapTransactionExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/QuoteAndBuildSwapTransactionExample.java new file mode 100644 index 0000000..3eb090b --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/QuoteAndBuildSwapTransactionExample.java @@ -0,0 +1,78 @@ +package com.binance.connector.client.web3_wallet.rest.trading; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.TradingApi; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.ApproveTransaction; +import com.binance.connector.client.web3_wallet.rest.model.AutoSlippage; +import com.binance.connector.client.web3_wallet.rest.model.GasLevel; +import com.binance.connector.client.web3_wallet.rest.model.QuoteAndBuildSwapTransactionResponse; +import com.binance.connector.client.web3_wallet.rest.model.Vendor; + +/** API examples for TradingApi */ +public class QuoteAndBuildSwapTransactionExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Quote and Build Swap Transaction (Flash API) + * + *

Combines quoting and swap-transaction construction into a single call. Unlike the two-step + * `/quote` + `/swap` flow, this endpoint does not require a prior + * `/quote` call or a `quoteId` — it returns the executable calldata / + * swapTransaction directly, eliminating one HTTP round-trip. Use this endpoint for + * latency-sensitive trading when the vendor is known upfront. The response shape is identical + * to `/swap`, so clients can reuse the same response parsing logic for both + * endpoints. + * + * @throws ApiException if the Api call fails + */ + public void quoteAndBuildSwapTransactionExample() throws ApiException { + String binanceChainId = "56"; + String amount = "1000000"; + String fromTokenAddress = "0x55d398326f99059fF775485246999027B3197955"; + String toTokenAddress = "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"; + String userWalletAddress = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; + Vendor vendor = Vendor.LiquidMesh; + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + String slippagePercent = "0.5"; + ApproveTransaction approveTransaction = ApproveTransaction.TRUE; + String approveAmount = "1000000"; + String gasLimit = "200000"; + GasLevel gasLevel = GasLevel.slow; + String priceImpactProtectionPercent = "90"; + AutoSlippage autoSlippage = AutoSlippage.TRUE; + String maxAutoSlippagePercent = "3"; + String computeUnitLimit = "1400000"; + String computeUnitPrice = "1000"; + String tips = "0.001"; + TradingApi.QuoteAndBuildSwapTransactionRequest request = + new TradingApi.QuoteAndBuildSwapTransactionRequest( + binanceChainId, + amount, + fromTokenAddress, + toTokenAddress, + userWalletAddress, + vendor); + ApiResponse response = + getApi().quoteAndBuildSwapTransaction(request); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/SubmitRfqOrderExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/SubmitRfqOrderExample.java new file mode 100644 index 0000000..1200cb9 --- /dev/null +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/trading/SubmitRfqOrderExample.java @@ -0,0 +1,56 @@ +package com.binance.connector.client.web3_wallet.rest.trading; + +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.web3_wallet.rest.Web3WalletRestApiUtil; +import com.binance.connector.client.web3_wallet.rest.api.Web3WalletRestApi; +import com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderRequest; +import com.binance.connector.client.web3_wallet.rest.model.SubmitRfqOrderResponse; + +/** API examples for TradingApi */ +public class SubmitRfqOrderExample { + private Web3WalletRestApi api; + + public Web3WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + Web3WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setSecretKey("secretKey"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new Web3WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Submit RFQ Order + * + *

Submit a signed RFQ order to the backend for on-chain settlement via the corresponding + * vendor relayer. Only used when `executionMode=RFQ` (equity / RWA tokens such + * as Ondo and BStock). **Flow**: `GET /quote` → pick an RFQ route → `GET + * /swap` → sign `rfq.typedDataToSign` with EIP-712 + * (`eth_signTypedData_v4`) → call this endpoint → poll `GET + * /order/{orderId}` until `FILLED` or `FAILED`. **Idempotency**: + * Submitting with the same `requestId` within 30 minutes returns the original result + * without re-calling the vendor. Use a new UUID for each distinct order; reuse the same UUID + * when retrying. + * + * @throws ApiException if the Api call fails + */ + public void submitRfqOrderExample() throws ApiException { + SubmitRfqOrderRequest submitRfqOrderRequest = new SubmitRfqOrderRequest(); + submitRfqOrderRequest.requestId("550e8400-e29b-41d4-a716-446655440000"); + submitRfqOrderRequest.userSignature("0x1234abcd...5678ef"); + submitRfqOrderRequest.vendor("PcsXRfq"); + submitRfqOrderRequest.quoteId("a1b2c3d4e5f64a8b9c0d1e2f3a4b5c6d"); + Long recvWindow = 5000L; + String nonce = "unique-nonce-string"; + ApiResponse response = + getApi().submitRfqOrder(submitRfqOrderRequest, recvWindow, nonce); + System.out.println(response.getData()); + } +} diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/BroadcastTransactionsExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/BroadcastTransactionsExample.java index 89b3b15..06e4241 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/BroadcastTransactionsExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/BroadcastTransactionsExample.java @@ -32,7 +32,8 @@ public Web3WalletRestApi getApi() { *

Broadcast a client-signed transaction to the chain via the Binance Web3 API relay. Returns * the transaction hash and an internal `orderId` you can use to track on-chain status * via the post-transaction service. Optional MEV protection (EVM chains only) routes the - * transaction through a private mempool to mitigate front-running and sandwich attacks. + * transaction through a private mempool to mitigate front-running and sandwich attacks. Tron + * and Solana do not support MEV protection; the flag is ignored on these chains. * * @throws ApiException if the Api call fails */ diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasLimitExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasLimitExample.java index a0e90c9..4be5975 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasLimitExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasLimitExample.java @@ -30,14 +30,20 @@ public Web3WalletRestApi getApi() { * Get Gas Limit * *

Estimate the gas limit (or compute-unit ceiling on Solana) for an unsigned transaction. - * Provide either `evmTx` for EVM chains or `solTx` for Solana, matching the - * value of `binanceChainId`. + * Provide either `evmTx` for EVM chains, `solTx` for Solana, or + * `tronTx` for Tron (\"CT_195\"), matching the value of + * `binanceChainId`. On Tron the response carries energy/bandwidth fields instead of a + * single gas limit; `gasLimit` is the fee limit (in sun) and the energy/bandwidth + * fields describe resource consumption and pricing. * * @throws ApiException if the Api call fails */ public void getGasLimitExample() throws ApiException { GetGasLimitRequest getGasLimitRequest = new GetGasLimitRequest(); getGasLimitRequest.binanceChainId("1"); + getGasLimitRequest.evmTx(null); + getGasLimitRequest.solTx(null); + getGasLimitRequest.tronTx(null); Long recvWindow = 5000L; String nonce = "unique-nonce-string"; ApiResponse response = diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasPriceExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasPriceExample.java index e96884f..648f418 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasPriceExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/GetGasPriceExample.java @@ -32,8 +32,10 @@ public Web3WalletRestApi getApi() { *

Query the current network gas price for the specified chain. The response shape varies by * chain family: - EVM chains return both `evmLegacyGasPrice` (legacy gasPrice) and * `eip1559GasPrice` (baseFee + priority/max fees) when EIP-1559 is supported. - - * Solana returns `solanaGasPrice` (compute-unit prices and Jito tips). Fields not - * applicable to the chain family are returned as `null`. + * Solana returns `solanaGasPrice` (compute-unit prices and Jito tips). - Tron + * (\"CT_195\") returns an empty `data` object because Tron has no on-chain + * gas-price concept; use the gas-limit endpoint instead. Fields not applicable to the chain + * family are returned as `null`. * * @throws ApiException if the Api call fails */ diff --git a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/SimulateTransactionsExample.java b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/SimulateTransactionsExample.java index 3b556d0..1964779 100644 --- a/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/SimulateTransactionsExample.java +++ b/examples/web3-wallet/src/main/java/com/binance/connector/client/web3_wallet/rest/transaction/SimulateTransactionsExample.java @@ -31,14 +31,19 @@ public Web3WalletRestApi getApi() { * *

Simulate transaction execution off-chain to predict its outcome before broadcasting. The * response includes the predicted execution status, balance changes per affected account/token, - * and ERC-20 allowance changes (EVM chains). Provide either `evmTx` (EVM chains) or - * `solTx` (Solana) matching `binanceChainId`. + * and ERC-20 allowance changes (EVM chains). Provide either `evmTx` (EVM chains), + * `solTx` (Solana), or `tronTx` (Tron \"CT_195\") matching + * `binanceChainId`. On Tron, `allowanceChanges` is returned as an empty + * array. Note: Metis (chainId 1088) is not supported by this endpoint. * * @throws ApiException if the Api call fails */ public void simulateTransactionsExample() throws ApiException { SimulateTransactionsRequest simulateTransactionsRequest = new SimulateTransactionsRequest(); simulateTransactionsRequest.binanceChainId("1"); + simulateTransactionsRequest.evmTx(null); + simulateTransactionsRequest.solTx(null); + simulateTransactionsRequest.tronTx(null); Long recvWindow = 5000L; String nonce = "unique-nonce-string"; ApiResponse response =