diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index b9e31156..548eeecb 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -321,6 +321,8 @@ docs/NetworkIdRoutingPolicyValue.md docs/NetworkRecord.md docs/NewAddress.md docs/NftsApi.md +docs/NonWalletQuoteFee.md +docs/NonWalletQuoteResponse.md docs/NoneNetworkRoutingDest.md docs/NotFoundException.md docs/Notification.md @@ -383,9 +385,14 @@ docs/PolicyStatus.md docs/PolicyValidation.md docs/PreScreening.md docs/Provider.md +docs/ProviderAdditionalData.md +docs/ProviderCategoryEnum.md docs/PublicKeyInformation.md docs/PublishDraftRequest.md docs/PublishResult.md +docs/QuoteFee.md +docs/QuoteRequest.md +docs/QuoteResponse.md docs/ReadAbiFunction.md docs/ReadCallFunctionDto.md docs/ReadCallFunctionDtoAbiFunction.md @@ -490,6 +497,16 @@ docs/StakingApi.md docs/StakingProvider.md docs/Status.md docs/StellarRippleCreateParamsDto.md +docs/SwapBetaApi.md +docs/SwapFlowError.md +docs/SwapOperation.md +docs/SwapOperationRequest.md +docs/SwapOperationsPaginatedResponse.md +docs/SwapProvider.md +docs/SwapProviderProtocolsEnum.md +docs/SwapProvidersPaginatedResponse.md +docs/SwapRequiredAction.md +docs/SwapRequiredActionsEnum.md docs/SystemMessageInfo.md docs/Task.md docs/TemplatesPaginatedResponse.md @@ -613,6 +630,7 @@ docs/VendorDto.md docs/Version.md docs/WalletAsset.md docs/WalletAssetAdditionalInfo.md +docs/WalletQuoteResponse.md docs/Web3ConnectionsApi.md docs/Webhook.md docs/WebhookEvent.md @@ -685,6 +703,7 @@ src/main/java/com/fireblocks/sdk/api/PolicyEditorBetaApi.java src/main/java/com/fireblocks/sdk/api/ResetDeviceApi.java src/main/java/com/fireblocks/sdk/api/SmartTransferApi.java src/main/java/com/fireblocks/sdk/api/StakingApi.java +src/main/java/com/fireblocks/sdk/api/SwapBetaApi.java src/main/java/com/fireblocks/sdk/api/TokenizationApi.java src/main/java/com/fireblocks/sdk/api/TransactionsApi.java src/main/java/com/fireblocks/sdk/api/TravelRuleApi.java @@ -987,6 +1006,8 @@ src/main/java/com/fireblocks/sdk/model/NetworkIdResponse.java src/main/java/com/fireblocks/sdk/model/NetworkIdRoutingPolicyValue.java src/main/java/com/fireblocks/sdk/model/NetworkRecord.java src/main/java/com/fireblocks/sdk/model/NewAddress.java +src/main/java/com/fireblocks/sdk/model/NonWalletQuoteFee.java +src/main/java/com/fireblocks/sdk/model/NonWalletQuoteResponse.java src/main/java/com/fireblocks/sdk/model/NoneNetworkRoutingDest.java src/main/java/com/fireblocks/sdk/model/NotFoundException.java src/main/java/com/fireblocks/sdk/model/Notification.java @@ -1045,9 +1066,14 @@ src/main/java/com/fireblocks/sdk/model/PolicyStatus.java src/main/java/com/fireblocks/sdk/model/PolicyValidation.java src/main/java/com/fireblocks/sdk/model/PreScreening.java src/main/java/com/fireblocks/sdk/model/Provider.java +src/main/java/com/fireblocks/sdk/model/ProviderAdditionalData.java +src/main/java/com/fireblocks/sdk/model/ProviderCategoryEnum.java src/main/java/com/fireblocks/sdk/model/PublicKeyInformation.java src/main/java/com/fireblocks/sdk/model/PublishDraftRequest.java src/main/java/com/fireblocks/sdk/model/PublishResult.java +src/main/java/com/fireblocks/sdk/model/QuoteFee.java +src/main/java/com/fireblocks/sdk/model/QuoteRequest.java +src/main/java/com/fireblocks/sdk/model/QuoteResponse.java src/main/java/com/fireblocks/sdk/model/ReadAbiFunction.java src/main/java/com/fireblocks/sdk/model/ReadCallFunctionDto.java src/main/java/com/fireblocks/sdk/model/ReadCallFunctionDtoAbiFunction.java @@ -1149,6 +1175,15 @@ src/main/java/com/fireblocks/sdk/model/StakeResponse.java src/main/java/com/fireblocks/sdk/model/StakingProvider.java src/main/java/com/fireblocks/sdk/model/Status.java src/main/java/com/fireblocks/sdk/model/StellarRippleCreateParamsDto.java +src/main/java/com/fireblocks/sdk/model/SwapFlowError.java +src/main/java/com/fireblocks/sdk/model/SwapOperation.java +src/main/java/com/fireblocks/sdk/model/SwapOperationRequest.java +src/main/java/com/fireblocks/sdk/model/SwapOperationsPaginatedResponse.java +src/main/java/com/fireblocks/sdk/model/SwapProvider.java +src/main/java/com/fireblocks/sdk/model/SwapProviderProtocolsEnum.java +src/main/java/com/fireblocks/sdk/model/SwapProvidersPaginatedResponse.java +src/main/java/com/fireblocks/sdk/model/SwapRequiredAction.java +src/main/java/com/fireblocks/sdk/model/SwapRequiredActionsEnum.java src/main/java/com/fireblocks/sdk/model/SystemMessageInfo.java src/main/java/com/fireblocks/sdk/model/Task.java src/main/java/com/fireblocks/sdk/model/TemplatesPaginatedResponse.java @@ -1266,6 +1301,7 @@ src/main/java/com/fireblocks/sdk/model/VendorDto.java src/main/java/com/fireblocks/sdk/model/Version.java src/main/java/com/fireblocks/sdk/model/WalletAsset.java src/main/java/com/fireblocks/sdk/model/WalletAssetAdditionalInfo.java +src/main/java/com/fireblocks/sdk/model/WalletQuoteResponse.java src/main/java/com/fireblocks/sdk/model/Webhook.java src/main/java/com/fireblocks/sdk/model/WebhookEvent.java src/main/java/com/fireblocks/sdk/model/WebhookPaginatedResponse.java @@ -1314,6 +1350,7 @@ src/test/java/com/fireblocks/sdk/api/PolicyEditorBetaApiTest.java src/test/java/com/fireblocks/sdk/api/ResetDeviceApiTest.java src/test/java/com/fireblocks/sdk/api/SmartTransferApiTest.java src/test/java/com/fireblocks/sdk/api/StakingApiTest.java +src/test/java/com/fireblocks/sdk/api/SwapBetaApiTest.java src/test/java/com/fireblocks/sdk/api/TokenizationApiTest.java src/test/java/com/fireblocks/sdk/api/TransactionsApiTest.java src/test/java/com/fireblocks/sdk/api/TravelRuleApiTest.java @@ -1615,6 +1652,8 @@ src/test/java/com/fireblocks/sdk/model/NetworkIdRoutingPolicyValueTest.java src/test/java/com/fireblocks/sdk/model/NetworkIdTest.java src/test/java/com/fireblocks/sdk/model/NetworkRecordTest.java src/test/java/com/fireblocks/sdk/model/NewAddressTest.java +src/test/java/com/fireblocks/sdk/model/NonWalletQuoteFeeTest.java +src/test/java/com/fireblocks/sdk/model/NonWalletQuoteResponseTest.java src/test/java/com/fireblocks/sdk/model/NoneNetworkRoutingDestTest.java src/test/java/com/fireblocks/sdk/model/NotFoundExceptionTest.java src/test/java/com/fireblocks/sdk/model/NotificationAttemptTest.java @@ -1672,10 +1711,15 @@ src/test/java/com/fireblocks/sdk/model/PolicySrcOrDestTypeTest.java src/test/java/com/fireblocks/sdk/model/PolicyStatusTest.java src/test/java/com/fireblocks/sdk/model/PolicyValidationTest.java src/test/java/com/fireblocks/sdk/model/PreScreeningTest.java +src/test/java/com/fireblocks/sdk/model/ProviderAdditionalDataTest.java +src/test/java/com/fireblocks/sdk/model/ProviderCategoryEnumTest.java src/test/java/com/fireblocks/sdk/model/ProviderTest.java src/test/java/com/fireblocks/sdk/model/PublicKeyInformationTest.java src/test/java/com/fireblocks/sdk/model/PublishDraftRequestTest.java src/test/java/com/fireblocks/sdk/model/PublishResultTest.java +src/test/java/com/fireblocks/sdk/model/QuoteFeeTest.java +src/test/java/com/fireblocks/sdk/model/QuoteRequestTest.java +src/test/java/com/fireblocks/sdk/model/QuoteResponseTest.java src/test/java/com/fireblocks/sdk/model/ReadAbiFunctionTest.java src/test/java/com/fireblocks/sdk/model/ReadCallFunctionDtoAbiFunctionTest.java src/test/java/com/fireblocks/sdk/model/ReadCallFunctionDtoTest.java @@ -1777,6 +1821,15 @@ src/test/java/com/fireblocks/sdk/model/StakeResponseTest.java src/test/java/com/fireblocks/sdk/model/StakingProviderTest.java src/test/java/com/fireblocks/sdk/model/StatusTest.java src/test/java/com/fireblocks/sdk/model/StellarRippleCreateParamsDtoTest.java +src/test/java/com/fireblocks/sdk/model/SwapFlowErrorTest.java +src/test/java/com/fireblocks/sdk/model/SwapOperationRequestTest.java +src/test/java/com/fireblocks/sdk/model/SwapOperationTest.java +src/test/java/com/fireblocks/sdk/model/SwapOperationsPaginatedResponseTest.java +src/test/java/com/fireblocks/sdk/model/SwapProviderProtocolsEnumTest.java +src/test/java/com/fireblocks/sdk/model/SwapProviderTest.java +src/test/java/com/fireblocks/sdk/model/SwapProvidersPaginatedResponseTest.java +src/test/java/com/fireblocks/sdk/model/SwapRequiredActionTest.java +src/test/java/com/fireblocks/sdk/model/SwapRequiredActionsEnumTest.java src/test/java/com/fireblocks/sdk/model/SystemMessageInfoTest.java src/test/java/com/fireblocks/sdk/model/TaskTest.java src/test/java/com/fireblocks/sdk/model/TemplatesPaginatedResponseTest.java @@ -1894,6 +1947,7 @@ src/test/java/com/fireblocks/sdk/model/VendorDtoTest.java src/test/java/com/fireblocks/sdk/model/VersionTest.java src/test/java/com/fireblocks/sdk/model/WalletAssetAdditionalInfoTest.java src/test/java/com/fireblocks/sdk/model/WalletAssetTest.java +src/test/java/com/fireblocks/sdk/model/WalletQuoteResponseTest.java src/test/java/com/fireblocks/sdk/model/WebhookEventTest.java src/test/java/com/fireblocks/sdk/model/WebhookPaginatedResponseTest.java src/test/java/com/fireblocks/sdk/model/WebhookTest.java diff --git a/README.md b/README.md index c08bda92..212fe1cc 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Add this dependency to your project's POM: com.fireblocks.sdk fireblocks-sdk - 10.3.0 + 0.0.0 compile ``` @@ -42,7 +42,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "com.fireblocks.sdk:fireblocks-sdk:10.3.0" +compile "com.fireblocks.sdk:fireblocks-sdk:0.0.0" ``` ### Others @@ -55,7 +55,7 @@ mvn clean package Then manually install the following JARs: -- `target/fireblocks-sdk-10.3.0.jar` +- `target/fireblocks-sdk-0.0.0.jar` - `target/lib/*.jar` @@ -332,11 +332,17 @@ Class | Method | HTTP request | Description *StakingApi* | [**getProviders**](docs/StakingApi.md#getProviders) | **GET** /staking/providers | List staking providers details *StakingApi* | [**getSummary**](docs/StakingApi.md#getSummary) | **GET** /staking/positions/summary | Get staking summary details *StakingApi* | [**getSummaryByVault**](docs/StakingApi.md#getSummaryByVault) | **GET** /staking/positions/summary/vaults | Get staking summary details by vault -*StakingApi* | [**mergeStakeAccounts**](docs/StakingApi.md#mergeStakeAccounts) | **POST** /staking/chains/{chainDescriptor}/merge | Execute a Merge operation on SOL/SOL_TEST stake accounts +*StakingApi* | [**mergeStakeAccounts**](docs/StakingApi.md#mergeStakeAccounts) | **POST** /staking/chains/{chainDescriptor}/merge | Merge Solana on stake accounts *StakingApi* | [**split**](docs/StakingApi.md#split) | **POST** /staking/chains/{chainDescriptor}/split | Execute a Split operation on SOL/SOL_TEST stake account *StakingApi* | [**stake**](docs/StakingApi.md#stake) | **POST** /staking/chains/{chainDescriptor}/stake | Initiate Stake Operation *StakingApi* | [**unstake**](docs/StakingApi.md#unstake) | **POST** /staking/chains/{chainDescriptor}/unstake | Execute an Unstake operation *StakingApi* | [**withdraw**](docs/StakingApi.md#withdraw) | **POST** /staking/chains/{chainDescriptor}/withdraw | Execute a Withdraw operation +*SwapBetaApi* | [**approveTermsOfService**](docs/SwapBetaApi.md#approveTermsOfService) | **POST** /swap/providers/{providerId}/approve_terms | Approve terms of service +*SwapBetaApi* | [**createQuote**](docs/SwapBetaApi.md#createQuote) | **POST** /swap/providers/{providerId}/quote | Create a quote +*SwapBetaApi* | [**createSwapOperation**](docs/SwapBetaApi.md#createSwapOperation) | **POST** /swap/operations | Create swap operation +*SwapBetaApi* | [**getSwapOperationById**](docs/SwapBetaApi.md#getSwapOperationById) | **GET** /swap/operations/{operationId} | Get operation details +*SwapBetaApi* | [**getSwapOperations**](docs/SwapBetaApi.md#getSwapOperations) | **GET** /swap/operations | Get Operations list +*SwapBetaApi* | [**getSwapProviders**](docs/SwapBetaApi.md#getSwapProviders) | **GET** /swap/providers | Get Providers List *TokenizationApi* | [**burnCollectionToken**](docs/TokenizationApi.md#burnCollectionToken) | **POST** /tokenization/collections/{id}/tokens/burn | Burn tokens *TokenizationApi* | [**createNewCollection**](docs/TokenizationApi.md#createNewCollection) | **POST** /tokenization/collections | Create a new collection *TokenizationApi* | [**fetchCollectionTokenDetails**](docs/TokenizationApi.md#fetchCollectionTokenDetails) | **GET** /tokenization/collections/{id}/tokens/{tokenId} | Get collection token details @@ -716,6 +722,8 @@ Class | Method | HTTP request | Description - [NetworkIdRoutingPolicyValue](docs/NetworkIdRoutingPolicyValue.md) - [NetworkRecord](docs/NetworkRecord.md) - [NewAddress](docs/NewAddress.md) + - [NonWalletQuoteFee](docs/NonWalletQuoteFee.md) + - [NonWalletQuoteResponse](docs/NonWalletQuoteResponse.md) - [NoneNetworkRoutingDest](docs/NoneNetworkRoutingDest.md) - [NotFoundException](docs/NotFoundException.md) - [Notification](docs/Notification.md) @@ -774,9 +782,14 @@ Class | Method | HTTP request | Description - [PolicyValidation](docs/PolicyValidation.md) - [PreScreening](docs/PreScreening.md) - [Provider](docs/Provider.md) + - [ProviderAdditionalData](docs/ProviderAdditionalData.md) + - [ProviderCategoryEnum](docs/ProviderCategoryEnum.md) - [PublicKeyInformation](docs/PublicKeyInformation.md) - [PublishDraftRequest](docs/PublishDraftRequest.md) - [PublishResult](docs/PublishResult.md) + - [QuoteFee](docs/QuoteFee.md) + - [QuoteRequest](docs/QuoteRequest.md) + - [QuoteResponse](docs/QuoteResponse.md) - [ReadAbiFunction](docs/ReadAbiFunction.md) - [ReadCallFunctionDto](docs/ReadCallFunctionDto.md) - [ReadCallFunctionDtoAbiFunction](docs/ReadCallFunctionDtoAbiFunction.md) @@ -878,6 +891,15 @@ Class | Method | HTTP request | Description - [StakingProvider](docs/StakingProvider.md) - [Status](docs/Status.md) - [StellarRippleCreateParamsDto](docs/StellarRippleCreateParamsDto.md) + - [SwapFlowError](docs/SwapFlowError.md) + - [SwapOperation](docs/SwapOperation.md) + - [SwapOperationRequest](docs/SwapOperationRequest.md) + - [SwapOperationsPaginatedResponse](docs/SwapOperationsPaginatedResponse.md) + - [SwapProvider](docs/SwapProvider.md) + - [SwapProviderProtocolsEnum](docs/SwapProviderProtocolsEnum.md) + - [SwapProvidersPaginatedResponse](docs/SwapProvidersPaginatedResponse.md) + - [SwapRequiredAction](docs/SwapRequiredAction.md) + - [SwapRequiredActionsEnum](docs/SwapRequiredActionsEnum.md) - [SystemMessageInfo](docs/SystemMessageInfo.md) - [Task](docs/Task.md) - [TemplatesPaginatedResponse](docs/TemplatesPaginatedResponse.md) @@ -995,6 +1017,7 @@ Class | Method | HTTP request | Description - [Version](docs/Version.md) - [WalletAsset](docs/WalletAsset.md) - [WalletAssetAdditionalInfo](docs/WalletAssetAdditionalInfo.md) + - [WalletQuoteResponse](docs/WalletQuoteResponse.md) - [Webhook](docs/Webhook.md) - [WebhookEvent](docs/WebhookEvent.md) - [WebhookPaginatedResponse](docs/WebhookPaginatedResponse.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 87f20d47..dae101de 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -16217,7 +16217,10 @@ paths: x-accepts: application/json /staking/chains/{chainDescriptor}/merge: post: - description: Perform a Solana Merge of two active stake accounts into one. + description: |- + Perform a Solana Merge of two active stake accounts into one. + + Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. operationId: mergeStakeAccounts parameters: - description: The protocol identifier (e.g. "SOL"/"SOL_TEST") to use @@ -16269,7 +16272,7 @@ paths: headers: X-Request-ID: $ref: '#/components/headers/X-Request-ID' - summary: Execute a Merge operation on SOL/SOL_TEST stake accounts + summary: Merge Solana on stake accounts tags: - Staking x-readme: @@ -16665,32 +16668,466 @@ paths: headers: X-Request-ID: $ref: '#/components/headers/X-Request-ID' - summary: Approve staking terms of service + summary: Approve staking terms of service + tags: + - Staking + x-rate-limit-category: write + x-readme: + code-samples: + - language: typescript + code: "const response: Promise> = fireblocks.staking.approveTermsOfServiceByProviderId(stakingApiApproveTermsOfServiceByProviderIdRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response = fireblocks.staking().approveTermsOfServiceByProviderId(providerId,\ + \ idempotencyKey);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.staking.approve_terms_of_service_by_provider_id(provider_id,\ + \ idempotency_key);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise> = fireblocks.staking.approveTermsOfServiceByProviderId(stakingApiApproveTermsOfServiceByProviderIdRequest);" + - lang: Java + source: "CompletableFuture> response = fireblocks.staking().approveTermsOfServiceByProviderId(providerId,\ + \ idempotencyKey);" + - lang: Python + source: "response = fireblocks.staking.approve_terms_of_service_by_provider_id(provider_id,\ + \ idempotency_key);" + x-accepts: application/json + /swap/providers: + get: + description: |- + Return a list of all supported swap providers. + + Note: These endpoints are currently in beta and might be subject to changes. + + If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. + + Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + operationId: getSwapProviders + parameters: + - description: Cursor of the required page + explode: true + in: query + name: pageCursor + required: false + schema: + type: string + style: form + - description: "Number of items in a page, Acceptable values are 1-100. Maximum\ + \ value is 100" + example: 10 + explode: true + in: query + name: pageSize + required: false + schema: + default: 10 + maximum: 100 + minimum: 1 + type: number + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SwapProvidersPaginatedResponse' + description: A paginated response containing ProviderDto objects + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + summary: Get Providers List + tags: + - Swap (Beta) + x-readme: + code-samples: + - language: typescript + code: "const response: Promise>\ + \ = fireblocks.swapBeta.getSwapProviders(swapBetaApiGetSwapProvidersRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response\ + \ = fireblocks.swapBeta().getSwapProviders(pageCursor, pageSize);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.swap_beta.get_swap_providers(page_cursor, page_size);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise>\ + \ = fireblocks.swapBeta.getSwapProviders(swapBetaApiGetSwapProvidersRequest);" + - lang: Java + source: "CompletableFuture> response\ + \ = fireblocks.swapBeta().getSwapProviders(pageCursor, pageSize);" + - lang: Python + source: "response = fireblocks.swap_beta.get_swap_providers(page_cursor, page_size);" + x-accepts: application/json + /swap/providers/{providerId}/approve_terms: + post: + description: |- + Approve the terms of service for a swap provider. + Some providers require this approval before performing a swap action for the first time. + + Note: These endpoints are currently in beta and might be subject to changes. + + If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. + + Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. + operationId: approveTermsOfService + parameters: + - explode: false + in: path + name: providerId + required: true + schema: + type: string + style: simple + - description: "A unique identifier for the request. If the request is sent\ + \ multiple times with the same idempotency key, the server will return the\ + \ same response as the first request. The idempotency key is valid for 24\ + \ hours." + explode: false + in: header + name: Idempotency-Key + required: false + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SwapProvider' + description: successfully approve terms of service + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + summary: Approve terms of service + tags: + - Swap (Beta) + x-readme: + code-samples: + - language: typescript + code: "const response: Promise> = fireblocks.swapBeta.approveTermsOfService(swapBetaApiApproveTermsOfServiceRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response = fireblocks.swapBeta().approveTermsOfService(providerId,\ + \ idempotencyKey);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.swap_beta.approve_terms_of_service(provider_id,\ + \ idempotency_key);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise> = fireblocks.swapBeta.approveTermsOfService(swapBetaApiApproveTermsOfServiceRequest);" + - lang: Java + source: "CompletableFuture> response = fireblocks.swapBeta().approveTermsOfService(providerId,\ + \ idempotencyKey);" + - lang: Python + source: "response = fireblocks.swap_beta.approve_terms_of_service(provider_id,\ + \ idempotency_key);" + x-accepts: application/json + /swap/providers/{providerId}/quote: + post: + description: |- + Create a quote from specific swap provider. + + Note: These endpoints are currently in beta and might be subject to changes. + + If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. + + Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + operationId: createQuote + parameters: + - explode: false + in: path + name: providerId + required: true + schema: + type: string + style: simple + - description: "A unique identifier for the request. If the request is sent\ + \ multiple times with the same idempotency key, the server will return the\ + \ same response as the first request. The idempotency key is valid for 24\ + \ hours." + explode: false + in: header + name: Idempotency-Key + required: false + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QuoteRequest' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/QuoteResponse' + description: "The response can be one of two possible DTOs, depending if\ + \ the request contains the accountId property." + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + summary: Create a quote + tags: + - Swap (Beta) + x-readme: + code-samples: + - language: typescript + code: "const response: Promise> = fireblocks.swapBeta.createQuote(swapBetaApiCreateQuoteRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response = fireblocks.swapBeta().createQuote(quoteRequest,\ + \ providerId, idempotencyKey);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.swap_beta.create_quote(quote_request, provider_id,\ + \ idempotency_key);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise> = fireblocks.swapBeta.createQuote(swapBetaApiCreateQuoteRequest);" + - lang: Java + source: "CompletableFuture> response = fireblocks.swapBeta().createQuote(quoteRequest,\ + \ providerId, idempotencyKey);" + - lang: Python + source: "response = fireblocks.swap_beta.create_quote(quote_request, provider_id,\ + \ idempotency_key);" + x-content-type: application/json + x-accepts: application/json + /swap/operations: + get: + description: |- + Return a list of swap operations for the specific workspace + The operations are sorted by creation date in descending order, meaning the most recent operation appears first. + + Note:These endpoints are currently in beta and might be subject to changes. + + If you want to participate and learn more about the Fireblocks TAP, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. + + Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + operationId: getSwapOperations + parameters: + - description: Cursor of the required page + explode: true + in: query + name: pageCursor + required: false + schema: + type: string + style: form + - description: "Number of items in a page, Acceptable values are 1-100. Maximum\ + \ value is 100" + example: 10 + explode: true + in: query + name: pageSize + required: false + schema: + default: 10 + maximum: 100 + minimum: 1 + type: number + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SwapOperationsPaginatedResponse' + description: A paginated response containing OperationDto objects + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + summary: Get Operations list + tags: + - Swap (Beta) + x-readme: + code-samples: + - language: typescript + code: "const response: Promise>\ + \ = fireblocks.swapBeta.getSwapOperations(swapBetaApiGetSwapOperationsRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response\ + \ = fireblocks.swapBeta().getSwapOperations(pageCursor, pageSize);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.swap_beta.get_swap_operations(page_cursor,\ + \ page_size);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise>\ + \ = fireblocks.swapBeta.getSwapOperations(swapBetaApiGetSwapOperationsRequest);" + - lang: Java + source: "CompletableFuture> response\ + \ = fireblocks.swapBeta().getSwapOperations(pageCursor, pageSize);" + - lang: Python + source: "response = fireblocks.swap_beta.get_swap_operations(page_cursor,\ + \ page_size);" + x-accepts: application/json + post: + description: |- + Create swap operation based on a provided quote Id + + Note: These endpoints are currently in beta and might be subject to changes. + + If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. + + Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. + operationId: createSwapOperation + parameters: + - description: "A unique identifier for the request. If the request is sent\ + \ multiple times with the same idempotency key, the server will return the\ + \ same response as the first request. The idempotency key is valid for 24\ + \ hours." + explode: false + in: header + name: Idempotency-Key + required: false + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SwapOperationRequest' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/SwapOperation' + description: "" + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + summary: Create swap operation + tags: + - Swap (Beta) + x-readme: + code-samples: + - language: typescript + code: "const response: Promise> = fireblocks.swapBeta.createSwapOperation(swapBetaApiCreateSwapOperationRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response = fireblocks.swapBeta().createSwapOperation(swapOperationRequest,\ + \ idempotencyKey);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.swap_beta.create_swap_operation(swap_operation_request,\ + \ idempotency_key);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise> = fireblocks.swapBeta.createSwapOperation(swapBetaApiCreateSwapOperationRequest);" + - lang: Java + source: "CompletableFuture> response = fireblocks.swapBeta().createSwapOperation(swapOperationRequest,\ + \ idempotencyKey);" + - lang: Python + source: "response = fireblocks.swap_beta.create_swap_operation(swap_operation_request,\ + \ idempotency_key);" + x-content-type: application/json + x-accepts: application/json + /swap/operations/{operationId}: + get: + description: |- + Get swap operation Details by ID. + + Note:These endpoints are currently in beta and might be subject to changes. + + If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. + + Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + operationId: getSwapOperationById + parameters: + - explode: false + in: path + name: operationId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SwapOperation' + description: "" + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + summary: Get operation details tags: - - Staking - x-rate-limit-category: write + - Swap (Beta) x-readme: code-samples: - language: typescript - code: "const response: Promise> = fireblocks.staking.approveTermsOfServiceByProviderId(stakingApiApproveTermsOfServiceByProviderIdRequest);" + code: "const response: Promise> = fireblocks.swapBeta.getSwapOperationById(swapBetaApiGetSwapOperationByIdRequest);" name: Fireblocks SDK TypeScript example - language: java - code: "CompletableFuture> response = fireblocks.staking().approveTermsOfServiceByProviderId(providerId,\ - \ idempotencyKey);" + code: CompletableFuture> response = fireblocks.swapBeta().getSwapOperationById(operationId); name: Fireblocks SDK Java example - language: python - code: "response = fireblocks.staking.approve_terms_of_service_by_provider_id(provider_id,\ - \ idempotency_key);" + code: response = fireblocks.swap_beta.get_swap_operation_by_id(operation_id); name: Fireblocks SDK Python example x-codeSamples: - lang: TypeScript - source: "const response: Promise> = fireblocks.staking.approveTermsOfServiceByProviderId(stakingApiApproveTermsOfServiceByProviderIdRequest);" + source: "const response: Promise> = fireblocks.swapBeta.getSwapOperationById(swapBetaApiGetSwapOperationByIdRequest);" - lang: Java - source: "CompletableFuture> response = fireblocks.staking().approveTermsOfServiceByProviderId(providerId,\ - \ idempotencyKey);" + source: CompletableFuture> response = fireblocks.swapBeta().getSwapOperationById(operationId); - lang: Python - source: "response = fireblocks.staking.approve_terms_of_service_by_provider_id(provider_id,\ - \ idempotency_key);" + source: response = fireblocks.swap_beta.get_swap_operation_by_id(operation_id); x-accepts: application/json /admin_quorum: put: @@ -40401,6 +40838,653 @@ components: items: $ref: '#/components/schemas/Provider' type: array + SwapProviderProtocolsEnum: + description: Protocol options supported by each provider. `UNISWAP` supports + `UNISWAP_CLASSIC` and `UNISWAPX`. `WRAP_UNWRAP` supports `WRAP` and `UNWRAP.` + enum: + - UNISWAP_CLASSIC + - UNISWAPX + - WRAP + - UNWRAP + example: UNISWAP_CLASSIC + type: string + ProviderCategoryEnum: + description: "Category that classify the provider, Supported categories are:\ + \ `DEX`, `CEX`, `OTC`" + enum: + - DEX + - CEX + - OTC + - WRAP_UNWRAP + example: DEX + type: string + SwapProvider: + example: + termsOfServiceUrl: https://uniswap.org/terms-of-service + isTermsApprovalRequired: true + name: Uniswap + id: UNISWAP + protocols: + - UNISWAP_CLASSIC + - UNISWAPX + category: DEX + isTermsOfServiceApproved: true + properties: + id: + description: The ID of the provider + example: UNISWAP + type: string + name: + description: Name of the provider + example: Uniswap + type: string + protocols: + description: List of supported protocols. Protocols are specific per provider + example: + - UNISWAP_CLASSIC + - UNISWAPX + items: + $ref: '#/components/schemas/SwapProviderProtocolsEnum' + type: array + category: + $ref: '#/components/schemas/ProviderCategoryEnum' + isTermsApprovalRequired: + description: "Indicates whether the terms of service are required for the\ + \ provider. if `true`, the user must approve the terms of service before\ + \ using the provider. otherwise, `termsOfServiceUrl` and `isTermsOfServiceApproved`\ + \ are not shown under the provider data." + example: true + type: boolean + termsOfServiceUrl: + description: URL to the terms of service + example: https://uniswap.org/terms-of-service + type: string + isTermsOfServiceApproved: + description: Indicates whether the terms of service are approved by the + user + example: true + type: boolean + required: + - category + - id + - isTermsApprovalRequired + - name + - protocols + type: object + SwapProvidersPaginatedResponse: + example: + next: MjAyMy0xMi0xMyA====TNjowOC4zMDI=:MTEwMA== + data: + - termsOfServiceUrl: https://uniswap.org/terms-of-service + isTermsApprovalRequired: true + name: Uniswap + id: UNISWAP + protocols: + - UNISWAP_CLASSIC + - UNISWAPX + category: DEX + isTermsOfServiceApproved: true + - termsOfServiceUrl: https://uniswap.org/terms-of-service + isTermsApprovalRequired: true + name: Uniswap + id: UNISWAP + protocols: + - UNISWAP_CLASSIC + - UNISWAPX + category: DEX + isTermsOfServiceApproved: true + properties: + data: + description: The data of the current page + items: + $ref: '#/components/schemas/SwapProvider' + type: array + next: + description: "The cursor to fetch the next page of results, if absent or\ + \ null, there are no additional results." + example: MjAyMy0xMi0xMyA====TNjowOC4zMDI=:MTEwMA== + nullable: true + type: string + required: + - data + type: object + QuoteRequest: + example: + accountId: "1" + protocol: UNISWAP_CLASSIC + inputAsset: WETH + inputAmount: "10" + outputAsset: DAI + slippageTolerance: 0.5 + properties: + accountId: + description: The id of the vault account or account id + example: "1" + type: string + inputAmount: + description: "The amount of tokens the swapper will provide, positive number,\ + \ can be a decimal." + example: "10" + type: string + inputAsset: + description: The id of the asset the swapper will provide + example: WETH + type: string + outputAsset: + description: The id of the asset the swapper will receive + example: DAI + type: string + slippageTolerance: + description: The slippage tolerance is a percentage. The slippage tolerance + is the maximum amount the price can change between the time the transaction + is submitted and the time it is executed + example: 0.5 + maximum: 100 + minimum: 0 + type: number + protocol: + $ref: '#/components/schemas/SwapProviderProtocolsEnum' + required: + - inputAmount + - inputAsset + - outputAsset + - protocol + - slippageTolerance + type: object + ProviderAdditionalData: + description: Provider specific additional data + example: + priceImpact: "0.01" + properties: + priceImpact: + example: "0.01" + type: string + required: + - priceImpact + type: object + SwapRequiredActionsEnum: + enum: + - APPROVE + - PERMIT + - CONTRACT_CALL + example: APPROVE + type: string + QuoteFee: + example: + networkFeeAssetId: ETH + providerFee: "5742266" + providerFeeAssetId: DAI + providerFeeRate: 0.25 + networkApproveFee: "1478987585080628" + networkExecutionFee: "1478987585080628" + properties: + networkExecutionFee: + description: The gas fee in the asset unit. + example: "1478987585080628" + type: string + networkFeeAssetId: + description: The network fee in Fireblocks asset representation + example: ETH + type: string + providerFee: + description: The provider fee in the asset unit. + example: "5742266" + type: string + providerFeeAssetId: + description: The provider fee in Fireblocks asset representation + example: DAI + type: string + providerFeeRate: + description: Percentages of the provider fee out of the gross amount + example: 0.25 + type: number + networkApproveFee: + description: The gas fee in the asset unit. + example: "1478987585080628" + type: string + required: + - networkExecutionFee + - networkFeeAssetId + - providerFee + - providerFeeAssetId + - providerFeeRate + type: object + WalletQuoteResponse: + description: Return a quote with id that can be used for swap operation. + example: + expiredAt: 2023-07-13T15:55:34.256Z + protocol: UNISWAP_CLASSIC + requiredActions: + - APPROVE + - APPROVE + outputMinAmount: "10" + inputAsset: WETH + inputAmount: "10" + slippageTolerance: 0.5 + outputAsset: DAI + estimatedFees: + networkFeeAssetId: ETH + providerFee: "5742266" + providerFeeAssetId: DAI + providerFeeRate: 0.25 + networkApproveFee: "1478987585080628" + networkExecutionFee: "1478987585080628" + additionalData: + priceImpact: "0.01" + outputMaxAmount: "20" + providerQuoteId: 550e8400-e29b-41d4-a716-446655440000 + properties: + protocol: + $ref: '#/components/schemas/SwapProviderProtocolsEnum' + inputAmount: + description: The amount of tokens the swapper will provide + example: "10" + type: string + inputAsset: + description: The id of the asset the swapper will provide + example: WETH + type: string + slippageTolerance: + description: The slippage tolerance is a percentage. The slippage tolerance + is the maximum amount the price can change between the time the transaction + is submitted and the time it is executed + example: 0.5 + type: number + outputMinAmount: + description: The minimum amount of tokens the swapper will receive + example: "10" + type: string + outputMaxAmount: + description: Maximum amount of tokens that the swapper will receive + example: "20" + type: string + outputAsset: + description: The id of the asset the swapper will receive + example: DAI + type: string + additionalData: + $ref: '#/components/schemas/ProviderAdditionalData' + providerQuoteId: + description: An identifier that uniquely identifies the received quote + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + expiredAt: + description: When was the received `providerQuoteId` is expired (ISO Date + time). + example: 2023-07-13T15:55:34.256Z + format: date-time + type: string + requiredActions: + description: The required actions for completing a swap operation + items: + $ref: '#/components/schemas/SwapRequiredActionsEnum' + type: array + estimatedFees: + $ref: '#/components/schemas/QuoteFee' + required: + - additionalData + - estimatedFees + - expiredAt + - inputAmount + - inputAsset + - outputAsset + - outputMaxAmount + - outputMinAmount + - protocol + - providerQuoteId + - requiredActions + - slippageTolerance + type: object + NonWalletQuoteFee: + description: The estimated fees for the swap operation. + properties: + networkExecutionFee: + description: The gas fee in the asset unit. + example: "1478987585080628" + type: string + networkFeeAssetId: + description: The network fee in Fireblocks asset representation + example: ETH + type: string + providerFee: + description: The provider fee in the asset unit. + example: "5742266" + type: string + providerFeeAssetId: + description: The provider fee in Fireblocks asset representation + example: DAI + type: string + providerFeeRate: + description: Percentages of the provider fee out of the gross amount + example: 0.25 + type: number + required: + - networkExecutionFee + - networkFeeAssetId + - providerFee + - providerFeeAssetId + - providerFeeRate + type: object + NonWalletQuoteResponse: + description: Return a quote that cannot be used for a swap operation. + properties: + protocol: + $ref: '#/components/schemas/SwapProviderProtocolsEnum' + inputAmount: + description: The amount of tokens the swapper will provide + example: "10" + type: string + inputAsset: + description: The id of the asset the swapper will provide + example: WETH + type: string + slippageTolerance: + description: The slippage tolerance is a percentage. The slippage tolerance + is the maximum amount the price can change between the time the transaction + is submitted and the time it is executed + example: 0.5 + type: number + outputMinAmount: + description: The minimum amount of tokens the swapper will receive + example: "10" + type: string + outputMaxAmount: + description: Maximum amount of tokens that the swapper will receive + example: "20" + type: string + outputAsset: + description: The id of the asset the swapper will receive + example: DAI + type: string + additionalData: + $ref: '#/components/schemas/ProviderAdditionalData' + estimatedFees: + $ref: '#/components/schemas/NonWalletQuoteFee' + required: + - additionalData + - estimatedFees + - inputAmount + - inputAsset + - outputAsset + - outputMaxAmount + - outputMinAmount + - protocol + - slippageTolerance + type: object + QuoteResponse: + oneOf: + - $ref: '#/components/schemas/WalletQuoteResponse' + - $ref: '#/components/schemas/NonWalletQuoteResponse' + SwapRequiredAction: + example: + txId: fc69381c-1e35-48c2-8415-484d1c2f55cx + type: APPROVE + status: PENDING + properties: + type: + $ref: '#/components/schemas/SwapRequiredActionsEnum' + status: + description: The status of the required action + enum: + - WAITING + - PROCESSING + - COMPLETED + - FAILED + - CANCELED + example: PENDING + type: string + txId: + description: The transaction id of the required action + example: fc69381c-1e35-48c2-8415-484d1c2f55cx + type: string + required: + - status + - type + type: object + SwapFlowError: + description: The error message for the swap + example: expired + nullable: true + properties: + code: + description: The code representing the error + example: "123" + type: string + message: + description: Error message + example: Failed to swap + type: string + required: + - code + - message + type: object + SwapOperation: + example: + outputFinalAmount: "15" + outputMinAmount: "10" + inputAmount: "10" + error: expired + outputMaxAmount: "20" + accountId: "1" + createdAt: 2023-07-13T15:55:34.256Z + protocol: UNISWAP_CLASSIC + requiredActions: + - txId: fc69381c-1e35-48c2-8415-484d1c2f55cx + type: APPROVE + status: PENDING + - txId: fc69381c-1e35-48c2-8415-484d1c2f55cx + type: APPROVE + status: PENDING + createdBy: 15a8f89f-f562-46ca-bcd3-56f8dd124816 + providerId: UNISWAP + inputAsset: WETH + slippageTolerance: 0.5 + outputAsset: DAI + id: 51cfb2c1-126d-4ff6-8512-ffba48f4b296 + category: DEX + status: CREATED + updatedAt: 2023-07-13T15:55:34.256Z + properties: + id: + description: The id of the swap operation + example: 51cfb2c1-126d-4ff6-8512-ffba48f4b296 + type: string + accountId: + description: The id of the vault account or account id + example: "1" + type: string + providerId: + description: The ID of the provider + example: UNISWAP + type: string + category: + $ref: '#/components/schemas/ProviderCategoryEnum' + protocol: + $ref: '#/components/schemas/SwapProviderProtocolsEnum' + status: + description: |- + **CREATED** – The swap request has been created but not yet started. + **PENDING_USER_ACTION** – Awaiting a user action (e.g. signature or approval). + **PENDING_PROVIDER_ACTION** – Awaiting the provider to process the request. + **PROCESSING** – The swap is actively being executed on‐chain. + **COMPLETED** – The swap has finished successfully. + **CANCELED** – The swap was cancelled by user or provider before completion. + **FAILED** – The swap attempted but encountered an error. + enum: + - CREATED + - TRANSACTION_IN_PROGRESS + - PENDING_PROVIDER_ACTION + - COMPLETED + - CANCELED + - FAILED + example: CREATED + type: string + inputAmount: + description: The amount of tokens the swapper will provide + example: "10" + type: string + inputAsset: + description: The id of the asset the swapper will provide + example: WETH + type: string + slippageTolerance: + description: The slippage tolerance is a percentage. The slippage tolerance + is the maximum amount the price can change between the time the transaction + is submitted and the time it is executed + example: 0.5 + type: number + outputMinAmount: + description: The minimum amount of tokens the swapper will receive + example: "10" + type: string + outputMaxAmount: + description: Maximum amount of tokens that the swapper will receive + example: "20" + type: string + outputAsset: + description: The id of the asset the swapper will receive + example: DAI + type: string + outputFinalAmount: + description: Final amount of tokens that the swapper will receive + example: "15" + nullable: true + type: string + requiredActions: + description: "The required actions for the swap, including the type of action,\ + \ the status of the action, and the transaction id" + items: + $ref: '#/components/schemas/SwapRequiredAction' + type: array + error: + $ref: '#/components/schemas/SwapFlowError' + createdAt: + description: The creation time of the swap operation (ISO Date time). + example: 2023-07-13T15:55:34.256Z + format: date-time + type: string + updatedAt: + description: The last update time of the swap operation (ISO Date time). + example: 2023-07-13T15:55:34.256Z + format: date-time + type: string + createdBy: + description: Fireblocks user id that issued the swap + example: 15a8f89f-f562-46ca-bcd3-56f8dd124816 + format: uuid + type: string + required: + - accountId + - category + - createdAt + - createdBy + - id + - inputAmount + - inputAsset + - outputAsset + - outputMaxAmount + - outputMinAmount + - protocol + - providerId + - requiredActions + - slippageTolerance + - status + - updatedAt + type: object + SwapOperationsPaginatedResponse: + example: + next: MjAyMy0xMi0xMyA====TNjowOC4zMDI=:MTEwMA== + data: + - outputFinalAmount: "15" + outputMinAmount: "10" + inputAmount: "10" + error: expired + outputMaxAmount: "20" + accountId: "1" + createdAt: 2023-07-13T15:55:34.256Z + protocol: UNISWAP_CLASSIC + requiredActions: + - txId: fc69381c-1e35-48c2-8415-484d1c2f55cx + type: APPROVE + status: PENDING + - txId: fc69381c-1e35-48c2-8415-484d1c2f55cx + type: APPROVE + status: PENDING + createdBy: 15a8f89f-f562-46ca-bcd3-56f8dd124816 + providerId: UNISWAP + inputAsset: WETH + slippageTolerance: 0.5 + outputAsset: DAI + id: 51cfb2c1-126d-4ff6-8512-ffba48f4b296 + category: DEX + status: CREATED + updatedAt: 2023-07-13T15:55:34.256Z + - outputFinalAmount: "15" + outputMinAmount: "10" + inputAmount: "10" + error: expired + outputMaxAmount: "20" + accountId: "1" + createdAt: 2023-07-13T15:55:34.256Z + protocol: UNISWAP_CLASSIC + requiredActions: + - txId: fc69381c-1e35-48c2-8415-484d1c2f55cx + type: APPROVE + status: PENDING + - txId: fc69381c-1e35-48c2-8415-484d1c2f55cx + type: APPROVE + status: PENDING + createdBy: 15a8f89f-f562-46ca-bcd3-56f8dd124816 + providerId: UNISWAP + inputAsset: WETH + slippageTolerance: 0.5 + outputAsset: DAI + id: 51cfb2c1-126d-4ff6-8512-ffba48f4b296 + category: DEX + status: CREATED + updatedAt: 2023-07-13T15:55:34.256Z + properties: + data: + description: The data of the current page + items: + $ref: '#/components/schemas/SwapOperation' + type: array + next: + description: "The cursor to fetch the next page of results, if absent or\ + \ null, there are no additional results." + example: MjAyMy0xMi0xMyA====TNjowOC4zMDI=:MTEwMA== + nullable: true + type: string + required: + - data + type: object + SwapOperationRequest: + example: + txNote: request id b70701f4-d7b1-4795-a8ee-b09cdb5b850d + feeLevel: MEDIUM + providerQuoteId: 550e8400-e29b-41d4-a716-446655440000 + properties: + providerQuoteId: + description: An identifier that uniquely identifies the received quote + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + feeLevel: + description: The fee level of the transaction + enum: + - LOW + - MEDIUM + - HIGH + example: MEDIUM + type: string + txNote: + description: user note on the transaction + example: request id b70701f4-d7b1-4795-a8ee-b09cdb5b850d + type: string + required: + - providerQuoteId + type: object SetAdminQuorumThresholdRequest: properties: adminQuorumThreshold: diff --git a/build.gradle b/build.gradle index 2a87a948..358eefb7 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'eclipse' apply plugin: 'com.diffplug.spotless' group = 'com.fireblocks.sdk' -version = '10.3.0' +version = '0.0.0' buildscript { repositories { diff --git a/docs/NonWalletQuoteFee.md b/docs/NonWalletQuoteFee.md new file mode 100644 index 00000000..44f7413e --- /dev/null +++ b/docs/NonWalletQuoteFee.md @@ -0,0 +1,18 @@ + + +# NonWalletQuoteFee + +The estimated fees for the swap operation. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**networkExecutionFee** | **String** | The gas fee in the asset unit. | | +|**networkFeeAssetId** | **String** | The network fee in Fireblocks asset representation | | +|**providerFee** | **String** | The provider fee in the asset unit. | | +|**providerFeeAssetId** | **String** | The provider fee in Fireblocks asset representation | | +|**providerFeeRate** | **BigDecimal** | Percentages of the provider fee out of the gross amount | | + + + diff --git a/docs/NonWalletQuoteResponse.md b/docs/NonWalletQuoteResponse.md new file mode 100644 index 00000000..4053c9b6 --- /dev/null +++ b/docs/NonWalletQuoteResponse.md @@ -0,0 +1,22 @@ + + +# NonWalletQuoteResponse + +Return a quote that cannot be used for a swap operation. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**protocol** | **SwapProviderProtocolsEnum** | | | +|**inputAmount** | **String** | The amount of tokens the swapper will provide | | +|**inputAsset** | **String** | The id of the asset the swapper will provide | | +|**slippageTolerance** | **BigDecimal** | The slippage tolerance is a percentage. The slippage tolerance is the maximum amount the price can change between the time the transaction is submitted and the time it is executed | | +|**outputMinAmount** | **String** | The minimum amount of tokens the swapper will receive | | +|**outputMaxAmount** | **String** | Maximum amount of tokens that the swapper will receive | | +|**outputAsset** | **String** | The id of the asset the swapper will receive | | +|**additionalData** | [**ProviderAdditionalData**](ProviderAdditionalData.md) | | | +|**estimatedFees** | [**NonWalletQuoteFee**](NonWalletQuoteFee.md) | | | + + + diff --git a/docs/ProviderAdditionalData.md b/docs/ProviderAdditionalData.md new file mode 100644 index 00000000..6495986c --- /dev/null +++ b/docs/ProviderAdditionalData.md @@ -0,0 +1,14 @@ + + +# ProviderAdditionalData + +Provider specific additional data + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**priceImpact** | **String** | | | + + + diff --git a/docs/ProviderCategoryEnum.md b/docs/ProviderCategoryEnum.md new file mode 100644 index 00000000..c60a4059 --- /dev/null +++ b/docs/ProviderCategoryEnum.md @@ -0,0 +1,17 @@ + + +# ProviderCategoryEnum + +## Enum + + +* `DEX` (value: `"DEX"`) + +* `CEX` (value: `"CEX"`) + +* `OTC` (value: `"OTC"`) + +* `WRAP_UNWRAP` (value: `"WRAP_UNWRAP"`) + + + diff --git a/docs/QuoteFee.md b/docs/QuoteFee.md new file mode 100644 index 00000000..4e15ed55 --- /dev/null +++ b/docs/QuoteFee.md @@ -0,0 +1,18 @@ + + +# QuoteFee + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**networkExecutionFee** | **String** | The gas fee in the asset unit. | | +|**networkFeeAssetId** | **String** | The network fee in Fireblocks asset representation | | +|**providerFee** | **String** | The provider fee in the asset unit. | | +|**providerFeeAssetId** | **String** | The provider fee in Fireblocks asset representation | | +|**providerFeeRate** | **BigDecimal** | Percentages of the provider fee out of the gross amount | | +|**networkApproveFee** | **String** | The gas fee in the asset unit. | [optional] | + + + diff --git a/docs/QuoteRequest.md b/docs/QuoteRequest.md new file mode 100644 index 00000000..bfff6e89 --- /dev/null +++ b/docs/QuoteRequest.md @@ -0,0 +1,18 @@ + + +# QuoteRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accountId** | **String** | The id of the vault account or account id | [optional] | +|**inputAmount** | **String** | The amount of tokens the swapper will provide, positive number, can be a decimal. | | +|**inputAsset** | **String** | The id of the asset the swapper will provide | | +|**outputAsset** | **String** | The id of the asset the swapper will receive | | +|**slippageTolerance** | **BigDecimal** | The slippage tolerance is a percentage. The slippage tolerance is the maximum amount the price can change between the time the transaction is submitted and the time it is executed | | +|**protocol** | **SwapProviderProtocolsEnum** | | | + + + diff --git a/docs/QuoteResponse.md b/docs/QuoteResponse.md new file mode 100644 index 00000000..fcc392e0 --- /dev/null +++ b/docs/QuoteResponse.md @@ -0,0 +1,37 @@ + + +# QuoteResponse + +## oneOf schemas +* [NonWalletQuoteResponse](NonWalletQuoteResponse.md) +* [WalletQuoteResponse](WalletQuoteResponse.md) + +## Example +```java +// Import classes: +import com.fireblocks.sdk.model.QuoteResponse; +import com.fireblocks.sdk.model.NonWalletQuoteResponse; +import com.fireblocks.sdk.model.WalletQuoteResponse; + +public class Example { + public static void main(String[] args) { + QuoteResponse exampleQuoteResponse = new QuoteResponse(); + + // create a new NonWalletQuoteResponse + NonWalletQuoteResponse exampleNonWalletQuoteResponse = new NonWalletQuoteResponse(); + // set QuoteResponse to NonWalletQuoteResponse + exampleQuoteResponse.setActualInstance(exampleNonWalletQuoteResponse); + // to get back the NonWalletQuoteResponse set earlier + NonWalletQuoteResponse testNonWalletQuoteResponse = (NonWalletQuoteResponse) exampleQuoteResponse.getActualInstance(); + + // create a new WalletQuoteResponse + WalletQuoteResponse exampleWalletQuoteResponse = new WalletQuoteResponse(); + // set QuoteResponse to WalletQuoteResponse + exampleQuoteResponse.setActualInstance(exampleWalletQuoteResponse); + // to get back the WalletQuoteResponse set earlier + WalletQuoteResponse testWalletQuoteResponse = (WalletQuoteResponse) exampleQuoteResponse.getActualInstance(); + } +} +``` + + diff --git a/docs/StakingApi.md b/docs/StakingApi.md index 9741022c..d9a303cf 100644 --- a/docs/StakingApi.md +++ b/docs/StakingApi.md @@ -13,7 +13,7 @@ All URIs are relative to https://developers.fireblocks.com/reference/ | [**getProviders**](StakingApi.md#getProviders) | **GET** /staking/providers | List staking providers details | | [**getSummary**](StakingApi.md#getSummary) | **GET** /staking/positions/summary | Get staking summary details | | [**getSummaryByVault**](StakingApi.md#getSummaryByVault) | **GET** /staking/positions/summary/vaults | Get staking summary details by vault | -| [**mergeStakeAccounts**](StakingApi.md#mergeStakeAccounts) | **POST** /staking/chains/{chainDescriptor}/merge | Execute a Merge operation on SOL/SOL_TEST stake accounts | +| [**mergeStakeAccounts**](StakingApi.md#mergeStakeAccounts) | **POST** /staking/chains/{chainDescriptor}/merge | Merge Solana on stake accounts | | [**split**](StakingApi.md#split) | **POST** /staking/chains/{chainDescriptor}/split | Execute a Split operation on SOL/SOL_TEST stake account | | [**stake**](StakingApi.md#stake) | **POST** /staking/chains/{chainDescriptor}/stake | Initiate Stake Operation | | [**unstake**](StakingApi.md#unstake) | **POST** /staking/chains/{chainDescriptor}/unstake | Execute an Unstake operation | @@ -760,9 +760,9 @@ No authorization required > CompletableFuture> mergeStakeAccounts mergeStakeAccounts(mergeStakeAccountsRequest, chainDescriptor, idempotencyKey) -Execute a Merge operation on SOL/SOL_TEST stake accounts +Merge Solana on stake accounts -Perform a Solana Merge of two active stake accounts into one. +Perform a Solana Merge of two active stake accounts into one. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. ### Example diff --git a/docs/SwapBetaApi.md b/docs/SwapBetaApi.md new file mode 100644 index 00000000..860cd2fa --- /dev/null +++ b/docs/SwapBetaApi.md @@ -0,0 +1,524 @@ +# SwapBetaApi + +All URIs are relative to https://developers.fireblocks.com/reference/ + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**approveTermsOfService**](SwapBetaApi.md#approveTermsOfService) | **POST** /swap/providers/{providerId}/approve_terms | Approve terms of service | +| [**createQuote**](SwapBetaApi.md#createQuote) | **POST** /swap/providers/{providerId}/quote | Create a quote | +| [**createSwapOperation**](SwapBetaApi.md#createSwapOperation) | **POST** /swap/operations | Create swap operation | +| [**getSwapOperationById**](SwapBetaApi.md#getSwapOperationById) | **GET** /swap/operations/{operationId} | Get operation details | +| [**getSwapOperations**](SwapBetaApi.md#getSwapOperations) | **GET** /swap/operations | Get Operations list | +| [**getSwapProviders**](SwapBetaApi.md#getSwapProviders) | **GET** /swap/providers | Get Providers List | + + + +## approveTermsOfService + +> CompletableFuture> approveTermsOfService approveTermsOfService(providerId, idempotencyKey) + +Approve terms of service + +Approve the terms of service for a swap provider. Some providers require this approval before performing a swap action for the first time. Note: These endpoints are currently in beta and might be subject to changes. If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. + +### Example + +```java +// Import classes: +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.BasePath; +import com.fireblocks.sdk.Fireblocks; +import com.fireblocks.sdk.ConfigurationOptions; +import com.fireblocks.sdk.model.*; +import com.fireblocks.sdk.api.SwapBetaApi; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class Example { + public static void main(String[] args) { + ConfigurationOptions configurationOptions = new ConfigurationOptions() + .basePath(BasePath.Sandbox) + .apiKey("my-api-key") + .secretKey("my-secret-key"); + Fireblocks fireblocks = new Fireblocks(configurationOptions); + + String providerId = "providerId_example"; // String | + String idempotencyKey = "idempotencyKey_example"; // String | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. + try { + CompletableFuture> response = fireblocks.swapBeta().approveTermsOfService(providerId, idempotencyKey); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SwapBetaApi#approveTermsOfService"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SwapBetaApi#approveTermsOfService"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **providerId** | **String**| | | +| **idempotencyKey** | **String**| A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successfully approve terms of service | - | +| **0** | Error Response | * X-Request-ID -
| + + +## createQuote + +> CompletableFuture> createQuote createQuote(quoteRequest, providerId, idempotencyKey) + +Create a quote + +Create a quote from specific swap provider. Note: These endpoints are currently in beta and might be subject to changes. If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + +### Example + +```java +// Import classes: +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.BasePath; +import com.fireblocks.sdk.Fireblocks; +import com.fireblocks.sdk.ConfigurationOptions; +import com.fireblocks.sdk.model.*; +import com.fireblocks.sdk.api.SwapBetaApi; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class Example { + public static void main(String[] args) { + ConfigurationOptions configurationOptions = new ConfigurationOptions() + .basePath(BasePath.Sandbox) + .apiKey("my-api-key") + .secretKey("my-secret-key"); + Fireblocks fireblocks = new Fireblocks(configurationOptions); + + QuoteRequest quoteRequest = new QuoteRequest(); // QuoteRequest | + String providerId = "providerId_example"; // String | + String idempotencyKey = "idempotencyKey_example"; // String | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. + try { + CompletableFuture> response = fireblocks.swapBeta().createQuote(quoteRequest, providerId, idempotencyKey); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SwapBetaApi#createQuote"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SwapBetaApi#createQuote"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **quoteRequest** | [**QuoteRequest**](QuoteRequest.md)| | | +| **providerId** | **String**| | | +| **idempotencyKey** | **String**| A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | The response can be one of two possible DTOs, depending if the request contains the accountId property. | - | +| **0** | Error Response | * X-Request-ID -
| + + +## createSwapOperation + +> CompletableFuture> createSwapOperation createSwapOperation(swapOperationRequest, idempotencyKey) + +Create swap operation + +Create swap operation based on a provided quote Id Note: These endpoints are currently in beta and might be subject to changes. If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. + +### Example + +```java +// Import classes: +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.BasePath; +import com.fireblocks.sdk.Fireblocks; +import com.fireblocks.sdk.ConfigurationOptions; +import com.fireblocks.sdk.model.*; +import com.fireblocks.sdk.api.SwapBetaApi; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class Example { + public static void main(String[] args) { + ConfigurationOptions configurationOptions = new ConfigurationOptions() + .basePath(BasePath.Sandbox) + .apiKey("my-api-key") + .secretKey("my-secret-key"); + Fireblocks fireblocks = new Fireblocks(configurationOptions); + + SwapOperationRequest swapOperationRequest = new SwapOperationRequest(); // SwapOperationRequest | + String idempotencyKey = "idempotencyKey_example"; // String | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. + try { + CompletableFuture> response = fireblocks.swapBeta().createSwapOperation(swapOperationRequest, idempotencyKey); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SwapBetaApi#createSwapOperation"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SwapBetaApi#createSwapOperation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **swapOperationRequest** | [**SwapOperationRequest**](SwapOperationRequest.md)| | | +| **idempotencyKey** | **String**| A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | | - | +| **0** | Error Response | * X-Request-ID -
| + + +## getSwapOperationById + +> CompletableFuture> getSwapOperationById getSwapOperationById(operationId) + +Get operation details + +Get swap operation Details by ID. Note:These endpoints are currently in beta and might be subject to changes. If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + +### Example + +```java +// Import classes: +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.BasePath; +import com.fireblocks.sdk.Fireblocks; +import com.fireblocks.sdk.ConfigurationOptions; +import com.fireblocks.sdk.model.*; +import com.fireblocks.sdk.api.SwapBetaApi; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class Example { + public static void main(String[] args) { + ConfigurationOptions configurationOptions = new ConfigurationOptions() + .basePath(BasePath.Sandbox) + .apiKey("my-api-key") + .secretKey("my-secret-key"); + Fireblocks fireblocks = new Fireblocks(configurationOptions); + + String operationId = "operationId_example"; // String | + try { + CompletableFuture> response = fireblocks.swapBeta().getSwapOperationById(operationId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SwapBetaApi#getSwapOperationById"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SwapBetaApi#getSwapOperationById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **operationId** | **String**| | | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **0** | Error Response | * X-Request-ID -
| + + +## getSwapOperations + +> CompletableFuture> getSwapOperations getSwapOperations(pageCursor, pageSize) + +Get Operations list + +Return a list of swap operations for the specific workspace The operations are sorted by creation date in descending order, meaning the most recent operation appears first. Note:These endpoints are currently in beta and might be subject to changes. If you want to participate and learn more about the Fireblocks TAP, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + +### Example + +```java +// Import classes: +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.BasePath; +import com.fireblocks.sdk.Fireblocks; +import com.fireblocks.sdk.ConfigurationOptions; +import com.fireblocks.sdk.model.*; +import com.fireblocks.sdk.api.SwapBetaApi; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class Example { + public static void main(String[] args) { + ConfigurationOptions configurationOptions = new ConfigurationOptions() + .basePath(BasePath.Sandbox) + .apiKey("my-api-key") + .secretKey("my-secret-key"); + Fireblocks fireblocks = new Fireblocks(configurationOptions); + + String pageCursor = "pageCursor_example"; // String | Cursor of the required page + BigDecimal pageSize = new BigDecimal("10"); // BigDecimal | Number of items in a page, Acceptable values are 1-100. Maximum value is 100 + try { + CompletableFuture> response = fireblocks.swapBeta().getSwapOperations(pageCursor, pageSize); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SwapBetaApi#getSwapOperations"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SwapBetaApi#getSwapOperations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pageCursor** | **String**| Cursor of the required page | [optional] | +| **pageSize** | **BigDecimal**| Number of items in a page, Acceptable values are 1-100. Maximum value is 100 | [optional] [default to 10] | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A paginated response containing OperationDto objects | - | +| **0** | Error Response | * X-Request-ID -
| + + +## getSwapProviders + +> CompletableFuture> getSwapProviders getSwapProviders(pageCursor, pageSize) + +Get Providers List + +Return a list of all supported swap providers. Note: These endpoints are currently in beta and might be subject to changes. If you want to participate and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + +### Example + +```java +// Import classes: +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.BasePath; +import com.fireblocks.sdk.Fireblocks; +import com.fireblocks.sdk.ConfigurationOptions; +import com.fireblocks.sdk.model.*; +import com.fireblocks.sdk.api.SwapBetaApi; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class Example { + public static void main(String[] args) { + ConfigurationOptions configurationOptions = new ConfigurationOptions() + .basePath(BasePath.Sandbox) + .apiKey("my-api-key") + .secretKey("my-secret-key"); + Fireblocks fireblocks = new Fireblocks(configurationOptions); + + String pageCursor = "pageCursor_example"; // String | Cursor of the required page + BigDecimal pageSize = new BigDecimal("10"); // BigDecimal | Number of items in a page, Acceptable values are 1-100. Maximum value is 100 + try { + CompletableFuture> response = fireblocks.swapBeta().getSwapProviders(pageCursor, pageSize); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SwapBetaApi#getSwapProviders"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SwapBetaApi#getSwapProviders"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pageCursor** | **String**| Cursor of the required page | [optional] | +| **pageSize** | **BigDecimal**| Number of items in a page, Acceptable values are 1-100. Maximum value is 100 | [optional] [default to 10] | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A paginated response containing ProviderDto objects | - | +| **0** | Error Response | * X-Request-ID -
| + diff --git a/docs/SwapFlowError.md b/docs/SwapFlowError.md new file mode 100644 index 00000000..af1af3d2 --- /dev/null +++ b/docs/SwapFlowError.md @@ -0,0 +1,15 @@ + + +# SwapFlowError + +The error message for the swap + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **String** | The code representing the error | | +|**message** | **String** | Error message | | + + + diff --git a/docs/SwapOperation.md b/docs/SwapOperation.md new file mode 100644 index 00000000..ba270930 --- /dev/null +++ b/docs/SwapOperation.md @@ -0,0 +1,43 @@ + + +# SwapOperation + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The id of the swap operation | | +|**accountId** | **String** | The id of the vault account or account id | | +|**providerId** | **String** | The ID of the provider | | +|**category** | **ProviderCategoryEnum** | | | +|**protocol** | **SwapProviderProtocolsEnum** | | | +|**status** | [**StatusEnum**](#StatusEnum) | **CREATED** – The swap request has been created but not yet started. **PENDING_USER_ACTION** – Awaiting a user action (e.g. signature or approval). **PENDING_PROVIDER_ACTION** – Awaiting the provider to process the request. **PROCESSING** – The swap is actively being executed on‐chain. **COMPLETED** – The swap has finished successfully. **CANCELED** – The swap was cancelled by user or provider before completion. **FAILED** – The swap attempted but encountered an error. | | +|**inputAmount** | **String** | The amount of tokens the swapper will provide | | +|**inputAsset** | **String** | The id of the asset the swapper will provide | | +|**slippageTolerance** | **BigDecimal** | The slippage tolerance is a percentage. The slippage tolerance is the maximum amount the price can change between the time the transaction is submitted and the time it is executed | | +|**outputMinAmount** | **String** | The minimum amount of tokens the swapper will receive | | +|**outputMaxAmount** | **String** | Maximum amount of tokens that the swapper will receive | | +|**outputAsset** | **String** | The id of the asset the swapper will receive | | +|**outputFinalAmount** | **String** | Final amount of tokens that the swapper will receive | [optional] | +|**requiredActions** | [**List<SwapRequiredAction>**](SwapRequiredAction.md) | The required actions for the swap, including the type of action, the status of the action, and the transaction id | | +|**error** | [**SwapFlowError**](SwapFlowError.md) | | [optional] | +|**createdAt** | **OffsetDateTime** | The creation time of the swap operation (ISO Date time). | | +|**updatedAt** | **OffsetDateTime** | The last update time of the swap operation (ISO Date time). | | +|**createdBy** | **UUID** | Fireblocks user id that issued the swap | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| CREATED | "CREATED" | +| TRANSACTION_IN_PROGRESS | "TRANSACTION_IN_PROGRESS" | +| PENDING_PROVIDER_ACTION | "PENDING_PROVIDER_ACTION" | +| COMPLETED | "COMPLETED" | +| CANCELED | "CANCELED" | +| FAILED | "FAILED" | + + + diff --git a/docs/SwapOperationRequest.md b/docs/SwapOperationRequest.md new file mode 100644 index 00000000..11cc3d1e --- /dev/null +++ b/docs/SwapOperationRequest.md @@ -0,0 +1,25 @@ + + +# SwapOperationRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**providerQuoteId** | **UUID** | An identifier that uniquely identifies the received quote | | +|**feeLevel** | [**FeeLevelEnum**](#FeeLevelEnum) | The fee level of the transaction | [optional] | +|**txNote** | **String** | user note on the transaction | [optional] | + + + +## Enum: FeeLevelEnum + +| Name | Value | +|---- | -----| +| LOW | "LOW" | +| MEDIUM | "MEDIUM" | +| HIGH | "HIGH" | + + + diff --git a/docs/SwapOperationsPaginatedResponse.md b/docs/SwapOperationsPaginatedResponse.md new file mode 100644 index 00000000..9c40a831 --- /dev/null +++ b/docs/SwapOperationsPaginatedResponse.md @@ -0,0 +1,14 @@ + + +# SwapOperationsPaginatedResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<SwapOperation>**](SwapOperation.md) | The data of the current page | | +|**next** | **String** | The cursor to fetch the next page of results, if absent or null, there are no additional results. | [optional] | + + + diff --git a/docs/SwapProvider.md b/docs/SwapProvider.md new file mode 100644 index 00000000..7286c64f --- /dev/null +++ b/docs/SwapProvider.md @@ -0,0 +1,19 @@ + + +# SwapProvider + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The ID of the provider | | +|**name** | **String** | Name of the provider | | +|**protocols** | **List<SwapProviderProtocolsEnum>** | List of supported protocols. Protocols are specific per provider | | +|**category** | **ProviderCategoryEnum** | | | +|**isTermsApprovalRequired** | **Boolean** | Indicates whether the terms of service are required for the provider. if `true`, the user must approve the terms of service before using the provider. otherwise, `termsOfServiceUrl` and `isTermsOfServiceApproved` are not shown under the provider data. | | +|**termsOfServiceUrl** | **String** | URL to the terms of service | [optional] | +|**isTermsOfServiceApproved** | **Boolean** | Indicates whether the terms of service are approved by the user | [optional] | + + + diff --git a/docs/SwapProviderProtocolsEnum.md b/docs/SwapProviderProtocolsEnum.md new file mode 100644 index 00000000..c856a278 --- /dev/null +++ b/docs/SwapProviderProtocolsEnum.md @@ -0,0 +1,17 @@ + + +# SwapProviderProtocolsEnum + +## Enum + + +* `UNISWAP_CLASSIC` (value: `"UNISWAP_CLASSIC"`) + +* `UNISWAPX` (value: `"UNISWAPX"`) + +* `WRAP` (value: `"WRAP"`) + +* `UNWRAP` (value: `"UNWRAP"`) + + + diff --git a/docs/SwapProvidersPaginatedResponse.md b/docs/SwapProvidersPaginatedResponse.md new file mode 100644 index 00000000..7b28d369 --- /dev/null +++ b/docs/SwapProvidersPaginatedResponse.md @@ -0,0 +1,14 @@ + + +# SwapProvidersPaginatedResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<SwapProvider>**](SwapProvider.md) | The data of the current page | | +|**next** | **String** | The cursor to fetch the next page of results, if absent or null, there are no additional results. | [optional] | + + + diff --git a/docs/SwapRequiredAction.md b/docs/SwapRequiredAction.md new file mode 100644 index 00000000..4dbe597e --- /dev/null +++ b/docs/SwapRequiredAction.md @@ -0,0 +1,27 @@ + + +# SwapRequiredAction + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **SwapRequiredActionsEnum** | | | +|**status** | [**StatusEnum**](#StatusEnum) | The status of the required action | | +|**txId** | **String** | The transaction id of the required action | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| WAITING | "WAITING" | +| PROCESSING | "PROCESSING" | +| COMPLETED | "COMPLETED" | +| FAILED | "FAILED" | +| CANCELED | "CANCELED" | + + + diff --git a/docs/SwapRequiredActionsEnum.md b/docs/SwapRequiredActionsEnum.md new file mode 100644 index 00000000..e4c97157 --- /dev/null +++ b/docs/SwapRequiredActionsEnum.md @@ -0,0 +1,15 @@ + + +# SwapRequiredActionsEnum + +## Enum + + +* `APPROVE` (value: `"APPROVE"`) + +* `PERMIT` (value: `"PERMIT"`) + +* `CONTRACT_CALL` (value: `"CONTRACT_CALL"`) + + + diff --git a/docs/WalletQuoteResponse.md b/docs/WalletQuoteResponse.md new file mode 100644 index 00000000..e4f1e9b5 --- /dev/null +++ b/docs/WalletQuoteResponse.md @@ -0,0 +1,25 @@ + + +# WalletQuoteResponse + +Return a quote with id that can be used for swap operation. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**protocol** | **SwapProviderProtocolsEnum** | | | +|**inputAmount** | **String** | The amount of tokens the swapper will provide | | +|**inputAsset** | **String** | The id of the asset the swapper will provide | | +|**slippageTolerance** | **BigDecimal** | The slippage tolerance is a percentage. The slippage tolerance is the maximum amount the price can change between the time the transaction is submitted and the time it is executed | | +|**outputMinAmount** | **String** | The minimum amount of tokens the swapper will receive | | +|**outputMaxAmount** | **String** | Maximum amount of tokens that the swapper will receive | | +|**outputAsset** | **String** | The id of the asset the swapper will receive | | +|**additionalData** | [**ProviderAdditionalData**](ProviderAdditionalData.md) | | | +|**providerQuoteId** | **UUID** | An identifier that uniquely identifies the received quote | | +|**expiredAt** | **OffsetDateTime** | When was the received `providerQuoteId` is expired (ISO Date time). | | +|**requiredActions** | **List<SwapRequiredActionsEnum>** | The required actions for completing a swap operation | | +|**estimatedFees** | [**QuoteFee**](QuoteFee.md) | | | + + + diff --git a/pom.xml b/pom.xml index 9193dcf6..94938f50 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fireblocks-sdk jar fireblocks-sdk - 10.3.0 + 0.0.0 https://github.com/fireblocks/java-sdk The Fireblocks Official SDK is a comprehensive software development kit that enables seamless integration and interaction with the Fireblocks platform. Fireblocks is a cutting-edge blockchain infrastructure platform that provides secure and scalable solutions for managing digital assets and transactions. This SDK empowers developers to build robust applications that can interact with the Fireblocks platform's features, including creating and managing vault accounts, initiating secure transactions, managing assets, and more. It abstracts complex interactions with the Fireblocks API, making it easier for developers to leverage the platform's capabilities while adhering to best practices in security and efficiency. diff --git a/src/main/java/com/fireblocks/sdk/Configuration.java b/src/main/java/com/fireblocks/sdk/Configuration.java index 2aed4b82..9ec56d09 100644 --- a/src/main/java/com/fireblocks/sdk/Configuration.java +++ b/src/main/java/com/fireblocks/sdk/Configuration.java @@ -14,7 +14,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "10.3.0"; + public static final String VERSION = "0.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/fireblocks/sdk/Fireblocks.java b/src/main/java/com/fireblocks/sdk/Fireblocks.java index a42ce29e..4bc0a61d 100644 --- a/src/main/java/com/fireblocks/sdk/Fireblocks.java +++ b/src/main/java/com/fireblocks/sdk/Fireblocks.java @@ -66,6 +66,7 @@ public class Fireblocks { private ResetDeviceApi resetDevice; private SmartTransferApi smartTransfer; private StakingApi staking; + private SwapBetaApi swapBeta; private TokenizationApi tokenization; private TransactionsApi transactions; private TravelRuleApi travelRule; @@ -426,6 +427,13 @@ public StakingApi staking() { return staking; } + public SwapBetaApi swapBeta() { + if (swapBeta == null) { + swapBeta = new SwapBetaApi(apiClient); + } + return swapBeta; + } + public TokenizationApi tokenization() { if (tokenization == null) { tokenization = new TokenizationApi(apiClient); diff --git a/src/main/java/com/fireblocks/sdk/api/StakingApi.java b/src/main/java/com/fireblocks/sdk/api/StakingApi.java index e8f79fbb..818020da 100644 --- a/src/main/java/com/fireblocks/sdk/api/StakingApi.java +++ b/src/main/java/com/fireblocks/sdk/api/StakingApi.java @@ -703,8 +703,8 @@ private HttpRequest.Builder getSummaryByVaultRequestBuilder() throws ApiExceptio return localVarRequestBuilder; } /** - * Execute a Merge operation on SOL/SOL_TEST stake accounts Perform a Solana Merge of two active - * stake accounts into one. + * Merge Solana on stake accounts Perform a Solana Merge of two active stake accounts into one. + * Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * * @param mergeStakeAccountsRequest (required) * @param chainDescriptor The protocol identifier (e.g. diff --git a/src/main/java/com/fireblocks/sdk/api/SwapBetaApi.java b/src/main/java/com/fireblocks/sdk/api/SwapBetaApi.java new file mode 100644 index 00000000..d75ca343 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/api/SwapBetaApi.java @@ -0,0 +1,584 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.api; + + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.Pair; +import com.fireblocks.sdk.ValidationUtils; +import com.fireblocks.sdk.model.QuoteRequest; +import com.fireblocks.sdk.model.QuoteResponse; +import com.fireblocks.sdk.model.SwapOperation; +import com.fireblocks.sdk.model.SwapOperationRequest; +import com.fireblocks.sdk.model.SwapOperationsPaginatedResponse; +import com.fireblocks.sdk.model.SwapProvider; +import com.fireblocks.sdk.model.SwapProvidersPaginatedResponse; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SwapBetaApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public SwapBetaApi() { + this(new ApiClient()); + } + + public SwapBetaApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = + formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException( + response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Approve terms of service Approve the terms of service for a swap provider. Some providers + * require this approval before performing a swap action for the first time. Note: These + * endpoints are currently in beta and might be subject to changes. If you want to participate + * and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success + * Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, + * Non-Signing Admin, Signer, Editor. + * + * @param providerId (required) + * @param idempotencyKey A unique identifier for the request. If the request is sent multiple + * times with the same idempotency key, the server will return the same response as the + * first request. The idempotency key is valid for 24 hours. (optional) + * @return CompletableFuture<ApiResponse<SwapProvider>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> approveTermsOfService( + String providerId, String idempotencyKey) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + approveTermsOfServiceRequestBuilder(providerId, idempotencyKey); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException( + "approveTermsOfService", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference< + SwapProvider>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder approveTermsOfServiceRequestBuilder( + String providerId, String idempotencyKey) throws ApiException { + ValidationUtils.assertParamExistsAndNotEmpty( + "approveTermsOfService", "providerId", providerId); + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/swap/providers/{providerId}/approve_terms" + .replace("{providerId}", ApiClient.urlEncode(providerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (idempotencyKey != null) { + localVarRequestBuilder.header("Idempotency-Key", idempotencyKey.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Create a quote Create a quote from specific swap provider. Note: These endpoints are + * currently in beta and might be subject to changes. If you want to participate and learn more + * about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an + * email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, + * Approver, Editor, Viewer. + * + * @param quoteRequest (required) + * @param providerId (required) + * @param idempotencyKey A unique identifier for the request. If the request is sent multiple + * times with the same idempotency key, the server will return the same response as the + * first request. The idempotency key is valid for 24 hours. (optional) + * @return CompletableFuture<ApiResponse<QuoteResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createQuote( + QuoteRequest quoteRequest, String providerId, String idempotencyKey) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createQuoteRequestBuilder(quoteRequest, providerId, idempotencyKey); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createQuote", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference< + QuoteResponse>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createQuoteRequestBuilder( + QuoteRequest quoteRequest, String providerId, String idempotencyKey) + throws ApiException { + ValidationUtils.assertParamExists("createQuote", "quoteRequest", quoteRequest); + ValidationUtils.assertParamExistsAndNotEmpty("createQuote", "providerId", providerId); + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/swap/providers/{providerId}/quote" + .replace("{providerId}", ApiClient.urlEncode(providerId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (idempotencyKey != null) { + localVarRequestBuilder.header("Idempotency-Key", idempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(quoteRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Create swap operation Create swap operation based on a provided quote Id Note: These + * endpoints are currently in beta and might be subject to changes. If you want to participate + * and learn more about the Fireblocks Swap, please contact your Fireblocks Customer Success + * Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, + * Non-Signing Admin, Signer, Editor. + * + * @param swapOperationRequest (required) + * @param idempotencyKey A unique identifier for the request. If the request is sent multiple + * times with the same idempotency key, the server will return the same response as the + * first request. The idempotency key is valid for 24 hours. (optional) + * @return CompletableFuture<ApiResponse<SwapOperation>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createSwapOperation( + SwapOperationRequest swapOperationRequest, String idempotencyKey) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + createSwapOperationRequestBuilder(swapOperationRequest, idempotencyKey); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException( + "createSwapOperation", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference< + SwapOperation>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createSwapOperationRequestBuilder( + SwapOperationRequest swapOperationRequest, String idempotencyKey) throws ApiException { + ValidationUtils.assertParamExists( + "createSwapOperation", "swapOperationRequest", swapOperationRequest); + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/swap/operations"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (idempotencyKey != null) { + localVarRequestBuilder.header("Idempotency-Key", idempotencyKey.toString()); + } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(swapOperationRequest); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get operation details Get swap operation Details by ID. Note:These endpoints are currently in + * beta and might be subject to changes. If you want to participate and learn more about the + * Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email + * to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, + * Approver, Editor, Viewer. + * + * @param operationId (required) + * @return CompletableFuture<ApiResponse<SwapOperation>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getSwapOperationById(String operationId) + throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getSwapOperationByIdRequestBuilder(operationId); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException( + "getSwapOperationById", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference< + SwapOperation>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getSwapOperationByIdRequestBuilder(String operationId) + throws ApiException { + ValidationUtils.assertParamExistsAndNotEmpty( + "getSwapOperationById", "operationId", operationId); + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/swap/operations/{operationId}" + .replace("{operationId}", ApiClient.urlEncode(operationId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get Operations list Return a list of swap operations for the specific workspace The + * operations are sorted by creation date in descending order, meaning the most recent operation + * appears first. Note:These endpoints are currently in beta and might be subject to changes. If + * you want to participate and learn more about the Fireblocks TAP, please contact your + * Fireblocks Customer Success Manager or send an email to CSM@fireblocks.com. Endpoint + * Permission: Owner, Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + * + * @param pageCursor Cursor of the required page (optional) + * @param pageSize Number of items in a page, Acceptable values are 1-100. Maximum value is 100 + * (optional, default to 10) + * @return CompletableFuture<ApiResponse<SwapOperationsPaginatedResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getSwapOperations( + String pageCursor, BigDecimal pageSize) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getSwapOperationsRequestBuilder(pageCursor, pageSize); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getSwapOperations", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference< + SwapOperationsPaginatedResponse>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getSwapOperationsRequestBuilder( + String pageCursor, BigDecimal pageSize) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/swap/operations"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pageCursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageCursor", pageCursor)); + localVarQueryParameterBaseName = "pageSize"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageSize", pageSize)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get Providers List Return a list of all supported swap providers. Note: These endpoints are + * currently in beta and might be subject to changes. If you want to participate and learn more + * about the Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an + * email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, + * Approver, Editor, Viewer. + * + * @param pageCursor Cursor of the required page (optional) + * @param pageSize Number of items in a page, Acceptable values are 1-100. Maximum value is 100 + * (optional, default to 10) + * @return CompletableFuture<ApiResponse<SwapProvidersPaginatedResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getSwapProviders( + String pageCursor, BigDecimal pageSize) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getSwapProvidersRequestBuilder(pageCursor, pageSize); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("getSwapProviders", localVarResponse)); + } + try { + String responseBody = localVarResponse.body(); + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody == null || responseBody.isBlank() + ? null + : memberVarObjectMapper.readValue( + responseBody, + new TypeReference< + SwapProvidersPaginatedResponse>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getSwapProvidersRequestBuilder( + String pageCursor, BigDecimal pageSize) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/swap/providers"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pageCursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageCursor", pageCursor)); + localVarQueryParameterBaseName = "pageSize"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageSize", pageSize)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/NonWalletQuoteFee.java b/src/main/java/com/fireblocks/sdk/model/NonWalletQuoteFee.java new file mode 100644 index 00000000..fb1be254 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/NonWalletQuoteFee.java @@ -0,0 +1,323 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** The estimated fees for the swap operation. */ +@JsonPropertyOrder({ + NonWalletQuoteFee.JSON_PROPERTY_NETWORK_EXECUTION_FEE, + NonWalletQuoteFee.JSON_PROPERTY_NETWORK_FEE_ASSET_ID, + NonWalletQuoteFee.JSON_PROPERTY_PROVIDER_FEE, + NonWalletQuoteFee.JSON_PROPERTY_PROVIDER_FEE_ASSET_ID, + NonWalletQuoteFee.JSON_PROPERTY_PROVIDER_FEE_RATE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NonWalletQuoteFee { + public static final String JSON_PROPERTY_NETWORK_EXECUTION_FEE = "networkExecutionFee"; + private String networkExecutionFee; + + public static final String JSON_PROPERTY_NETWORK_FEE_ASSET_ID = "networkFeeAssetId"; + private String networkFeeAssetId; + + public static final String JSON_PROPERTY_PROVIDER_FEE = "providerFee"; + private String providerFee; + + public static final String JSON_PROPERTY_PROVIDER_FEE_ASSET_ID = "providerFeeAssetId"; + private String providerFeeAssetId; + + public static final String JSON_PROPERTY_PROVIDER_FEE_RATE = "providerFeeRate"; + private BigDecimal providerFeeRate; + + public NonWalletQuoteFee() {} + + public NonWalletQuoteFee networkExecutionFee(String networkExecutionFee) { + this.networkExecutionFee = networkExecutionFee; + return this; + } + + /** + * The gas fee in the asset unit. + * + * @return networkExecutionFee + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK_EXECUTION_FEE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNetworkExecutionFee() { + return networkExecutionFee; + } + + @JsonProperty(JSON_PROPERTY_NETWORK_EXECUTION_FEE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetworkExecutionFee(String networkExecutionFee) { + this.networkExecutionFee = networkExecutionFee; + } + + public NonWalletQuoteFee networkFeeAssetId(String networkFeeAssetId) { + this.networkFeeAssetId = networkFeeAssetId; + return this; + } + + /** + * The network fee in Fireblocks asset representation + * + * @return networkFeeAssetId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK_FEE_ASSET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNetworkFeeAssetId() { + return networkFeeAssetId; + } + + @JsonProperty(JSON_PROPERTY_NETWORK_FEE_ASSET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetworkFeeAssetId(String networkFeeAssetId) { + this.networkFeeAssetId = networkFeeAssetId; + } + + public NonWalletQuoteFee providerFee(String providerFee) { + this.providerFee = providerFee; + return this; + } + + /** + * The provider fee in the asset unit. + * + * @return providerFee + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderFee() { + return providerFee; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderFee(String providerFee) { + this.providerFee = providerFee; + } + + public NonWalletQuoteFee providerFeeAssetId(String providerFeeAssetId) { + this.providerFeeAssetId = providerFeeAssetId; + return this; + } + + /** + * The provider fee in Fireblocks asset representation + * + * @return providerFeeAssetId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE_ASSET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderFeeAssetId() { + return providerFeeAssetId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE_ASSET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderFeeAssetId(String providerFeeAssetId) { + this.providerFeeAssetId = providerFeeAssetId; + } + + public NonWalletQuoteFee providerFeeRate(BigDecimal providerFeeRate) { + this.providerFeeRate = providerFeeRate; + return this; + } + + /** + * Percentages of the provider fee out of the gross amount + * + * @return providerFeeRate + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE_RATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getProviderFeeRate() { + return providerFeeRate; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE_RATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderFeeRate(BigDecimal providerFeeRate) { + this.providerFeeRate = providerFeeRate; + } + + /** Return true if this NonWalletQuoteFee object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NonWalletQuoteFee nonWalletQuoteFee = (NonWalletQuoteFee) o; + return Objects.equals(this.networkExecutionFee, nonWalletQuoteFee.networkExecutionFee) + && Objects.equals(this.networkFeeAssetId, nonWalletQuoteFee.networkFeeAssetId) + && Objects.equals(this.providerFee, nonWalletQuoteFee.providerFee) + && Objects.equals(this.providerFeeAssetId, nonWalletQuoteFee.providerFeeAssetId) + && Objects.equals(this.providerFeeRate, nonWalletQuoteFee.providerFeeRate); + } + + @Override + public int hashCode() { + return Objects.hash( + networkExecutionFee, + networkFeeAssetId, + providerFee, + providerFeeAssetId, + providerFeeRate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NonWalletQuoteFee {\n"); + sb.append(" networkExecutionFee: ") + .append(toIndentedString(networkExecutionFee)) + .append("\n"); + sb.append(" networkFeeAssetId: ") + .append(toIndentedString(networkFeeAssetId)) + .append("\n"); + sb.append(" providerFee: ").append(toIndentedString(providerFee)).append("\n"); + sb.append(" providerFeeAssetId: ") + .append(toIndentedString(providerFeeAssetId)) + .append("\n"); + sb.append(" providerFeeRate: ").append(toIndentedString(providerFeeRate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `networkExecutionFee` to the URL query string + if (getNetworkExecutionFee() != null) { + joiner.add( + String.format( + "%snetworkExecutionFee%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getNetworkExecutionFee()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `networkFeeAssetId` to the URL query string + if (getNetworkFeeAssetId() != null) { + joiner.add( + String.format( + "%snetworkFeeAssetId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getNetworkFeeAssetId()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `providerFee` to the URL query string + if (getProviderFee() != null) { + joiner.add( + String.format( + "%sproviderFee%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderFee()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `providerFeeAssetId` to the URL query string + if (getProviderFeeAssetId() != null) { + joiner.add( + String.format( + "%sproviderFeeAssetId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderFeeAssetId()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `providerFeeRate` to the URL query string + if (getProviderFeeRate() != null) { + joiner.add( + String.format( + "%sproviderFeeRate%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderFeeRate()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/NonWalletQuoteResponse.java b/src/main/java/com/fireblocks/sdk/model/NonWalletQuoteResponse.java new file mode 100644 index 00000000..29e099ee --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/NonWalletQuoteResponse.java @@ -0,0 +1,473 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** Return a quote that cannot be used for a swap operation. */ +@JsonPropertyOrder({ + NonWalletQuoteResponse.JSON_PROPERTY_PROTOCOL, + NonWalletQuoteResponse.JSON_PROPERTY_INPUT_AMOUNT, + NonWalletQuoteResponse.JSON_PROPERTY_INPUT_ASSET, + NonWalletQuoteResponse.JSON_PROPERTY_SLIPPAGE_TOLERANCE, + NonWalletQuoteResponse.JSON_PROPERTY_OUTPUT_MIN_AMOUNT, + NonWalletQuoteResponse.JSON_PROPERTY_OUTPUT_MAX_AMOUNT, + NonWalletQuoteResponse.JSON_PROPERTY_OUTPUT_ASSET, + NonWalletQuoteResponse.JSON_PROPERTY_ADDITIONAL_DATA, + NonWalletQuoteResponse.JSON_PROPERTY_ESTIMATED_FEES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NonWalletQuoteResponse { + public static final String JSON_PROPERTY_PROTOCOL = "protocol"; + private SwapProviderProtocolsEnum protocol; + + public static final String JSON_PROPERTY_INPUT_AMOUNT = "inputAmount"; + private String inputAmount; + + public static final String JSON_PROPERTY_INPUT_ASSET = "inputAsset"; + private String inputAsset; + + public static final String JSON_PROPERTY_SLIPPAGE_TOLERANCE = "slippageTolerance"; + private BigDecimal slippageTolerance; + + public static final String JSON_PROPERTY_OUTPUT_MIN_AMOUNT = "outputMinAmount"; + private String outputMinAmount; + + public static final String JSON_PROPERTY_OUTPUT_MAX_AMOUNT = "outputMaxAmount"; + private String outputMaxAmount; + + public static final String JSON_PROPERTY_OUTPUT_ASSET = "outputAsset"; + private String outputAsset; + + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; + private ProviderAdditionalData additionalData; + + public static final String JSON_PROPERTY_ESTIMATED_FEES = "estimatedFees"; + private NonWalletQuoteFee estimatedFees; + + public NonWalletQuoteResponse() {} + + public NonWalletQuoteResponse protocol(SwapProviderProtocolsEnum protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SwapProviderProtocolsEnum getProtocol() { + return protocol; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProtocol(SwapProviderProtocolsEnum protocol) { + this.protocol = protocol; + } + + public NonWalletQuoteResponse inputAmount(String inputAmount) { + this.inputAmount = inputAmount; + return this; + } + + /** + * The amount of tokens the swapper will provide + * + * @return inputAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInputAmount() { + return inputAmount; + } + + @JsonProperty(JSON_PROPERTY_INPUT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputAmount(String inputAmount) { + this.inputAmount = inputAmount; + } + + public NonWalletQuoteResponse inputAsset(String inputAsset) { + this.inputAsset = inputAsset; + return this; + } + + /** + * The id of the asset the swapper will provide + * + * @return inputAsset + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInputAsset() { + return inputAsset; + } + + @JsonProperty(JSON_PROPERTY_INPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputAsset(String inputAsset) { + this.inputAsset = inputAsset; + } + + public NonWalletQuoteResponse slippageTolerance(BigDecimal slippageTolerance) { + this.slippageTolerance = slippageTolerance; + return this; + } + + /** + * The slippage tolerance is a percentage. The slippage tolerance is the maximum amount the + * price can change between the time the transaction is submitted and the time it is executed + * + * @return slippageTolerance + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SLIPPAGE_TOLERANCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getSlippageTolerance() { + return slippageTolerance; + } + + @JsonProperty(JSON_PROPERTY_SLIPPAGE_TOLERANCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSlippageTolerance(BigDecimal slippageTolerance) { + this.slippageTolerance = slippageTolerance; + } + + public NonWalletQuoteResponse outputMinAmount(String outputMinAmount) { + this.outputMinAmount = outputMinAmount; + return this; + } + + /** + * The minimum amount of tokens the swapper will receive + * + * @return outputMinAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_MIN_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputMinAmount() { + return outputMinAmount; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_MIN_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputMinAmount(String outputMinAmount) { + this.outputMinAmount = outputMinAmount; + } + + public NonWalletQuoteResponse outputMaxAmount(String outputMaxAmount) { + this.outputMaxAmount = outputMaxAmount; + return this; + } + + /** + * Maximum amount of tokens that the swapper will receive + * + * @return outputMaxAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_MAX_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputMaxAmount() { + return outputMaxAmount; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_MAX_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputMaxAmount(String outputMaxAmount) { + this.outputMaxAmount = outputMaxAmount; + } + + public NonWalletQuoteResponse outputAsset(String outputAsset) { + this.outputAsset = outputAsset; + return this; + } + + /** + * The id of the asset the swapper will receive + * + * @return outputAsset + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputAsset() { + return outputAsset; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputAsset(String outputAsset) { + this.outputAsset = outputAsset; + } + + public NonWalletQuoteResponse additionalData(ProviderAdditionalData additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Get additionalData + * + * @return additionalData + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProviderAdditionalData getAdditionalData() { + return additionalData; + } + + @JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAdditionalData(ProviderAdditionalData additionalData) { + this.additionalData = additionalData; + } + + public NonWalletQuoteResponse estimatedFees(NonWalletQuoteFee estimatedFees) { + this.estimatedFees = estimatedFees; + return this; + } + + /** + * Get estimatedFees + * + * @return estimatedFees + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ESTIMATED_FEES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NonWalletQuoteFee getEstimatedFees() { + return estimatedFees; + } + + @JsonProperty(JSON_PROPERTY_ESTIMATED_FEES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEstimatedFees(NonWalletQuoteFee estimatedFees) { + this.estimatedFees = estimatedFees; + } + + /** Return true if this NonWalletQuoteResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NonWalletQuoteResponse nonWalletQuoteResponse = (NonWalletQuoteResponse) o; + return Objects.equals(this.protocol, nonWalletQuoteResponse.protocol) + && Objects.equals(this.inputAmount, nonWalletQuoteResponse.inputAmount) + && Objects.equals(this.inputAsset, nonWalletQuoteResponse.inputAsset) + && Objects.equals(this.slippageTolerance, nonWalletQuoteResponse.slippageTolerance) + && Objects.equals(this.outputMinAmount, nonWalletQuoteResponse.outputMinAmount) + && Objects.equals(this.outputMaxAmount, nonWalletQuoteResponse.outputMaxAmount) + && Objects.equals(this.outputAsset, nonWalletQuoteResponse.outputAsset) + && Objects.equals(this.additionalData, nonWalletQuoteResponse.additionalData) + && Objects.equals(this.estimatedFees, nonWalletQuoteResponse.estimatedFees); + } + + @Override + public int hashCode() { + return Objects.hash( + protocol, + inputAmount, + inputAsset, + slippageTolerance, + outputMinAmount, + outputMaxAmount, + outputAsset, + additionalData, + estimatedFees); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NonWalletQuoteResponse {\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" inputAsset: ").append(toIndentedString(inputAsset)).append("\n"); + sb.append(" slippageTolerance: ") + .append(toIndentedString(slippageTolerance)) + .append("\n"); + sb.append(" outputMinAmount: ").append(toIndentedString(outputMinAmount)).append("\n"); + sb.append(" outputMaxAmount: ").append(toIndentedString(outputMaxAmount)).append("\n"); + sb.append(" outputAsset: ").append(toIndentedString(outputAsset)).append("\n"); + sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); + sb.append(" estimatedFees: ").append(toIndentedString(estimatedFees)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `protocol` to the URL query string + if (getProtocol() != null) { + joiner.add( + String.format( + "%sprotocol%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getProtocol()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `inputAmount` to the URL query string + if (getInputAmount() != null) { + joiner.add( + String.format( + "%sinputAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getInputAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `inputAsset` to the URL query string + if (getInputAsset() != null) { + joiner.add( + String.format( + "%sinputAsset%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getInputAsset()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `slippageTolerance` to the URL query string + if (getSlippageTolerance() != null) { + joiner.add( + String.format( + "%sslippageTolerance%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSlippageTolerance()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputMinAmount` to the URL query string + if (getOutputMinAmount() != null) { + joiner.add( + String.format( + "%soutputMinAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputMinAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputMaxAmount` to the URL query string + if (getOutputMaxAmount() != null) { + joiner.add( + String.format( + "%soutputMaxAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputMaxAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputAsset` to the URL query string + if (getOutputAsset() != null) { + joiner.add( + String.format( + "%soutputAsset%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputAsset()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `additionalData` to the URL query string + if (getAdditionalData() != null) { + joiner.add(getAdditionalData().toUrlQueryString(prefix + "additionalData" + suffix)); + } + + // add `estimatedFees` to the URL query string + if (getEstimatedFees() != null) { + joiner.add(getEstimatedFees().toUrlQueryString(prefix + "estimatedFees" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/ProviderAdditionalData.java b/src/main/java/com/fireblocks/sdk/model/ProviderAdditionalData.java new file mode 100644 index 00000000..a86f28b6 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/ProviderAdditionalData.java @@ -0,0 +1,141 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** Provider specific additional data */ +@JsonPropertyOrder({ProviderAdditionalData.JSON_PROPERTY_PRICE_IMPACT}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ProviderAdditionalData { + public static final String JSON_PROPERTY_PRICE_IMPACT = "priceImpact"; + private String priceImpact; + + public ProviderAdditionalData() {} + + public ProviderAdditionalData priceImpact(String priceImpact) { + this.priceImpact = priceImpact; + return this; + } + + /** + * Get priceImpact + * + * @return priceImpact + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRICE_IMPACT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPriceImpact() { + return priceImpact; + } + + @JsonProperty(JSON_PROPERTY_PRICE_IMPACT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPriceImpact(String priceImpact) { + this.priceImpact = priceImpact; + } + + /** Return true if this ProviderAdditionalData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProviderAdditionalData providerAdditionalData = (ProviderAdditionalData) o; + return Objects.equals(this.priceImpact, providerAdditionalData.priceImpact); + } + + @Override + public int hashCode() { + return Objects.hash(priceImpact); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProviderAdditionalData {\n"); + sb.append(" priceImpact: ").append(toIndentedString(priceImpact)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `priceImpact` to the URL query string + if (getPriceImpact() != null) { + joiner.add( + String.format( + "%spriceImpact%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getPriceImpact()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/ProviderCategoryEnum.java b/src/main/java/com/fireblocks/sdk/model/ProviderCategoryEnum.java new file mode 100644 index 00000000..21bbf7ed --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/ProviderCategoryEnum.java @@ -0,0 +1,71 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Category that classify the provider, Supported categories are: `DEX`, `CEX`, + * `OTC` + */ +public enum ProviderCategoryEnum { + DEX("DEX"), + + CEX("CEX"), + + OTC("OTC"), + + WRAP_UNWRAP("WRAP_UNWRAP"); + + private String value; + + ProviderCategoryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProviderCategoryEnum fromValue(String value) { + for (ProviderCategoryEnum b : ProviderCategoryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/QuoteFee.java b/src/main/java/com/fireblocks/sdk/model/QuoteFee.java new file mode 100644 index 00000000..4354ef98 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/QuoteFee.java @@ -0,0 +1,368 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** QuoteFee */ +@JsonPropertyOrder({ + QuoteFee.JSON_PROPERTY_NETWORK_EXECUTION_FEE, + QuoteFee.JSON_PROPERTY_NETWORK_FEE_ASSET_ID, + QuoteFee.JSON_PROPERTY_PROVIDER_FEE, + QuoteFee.JSON_PROPERTY_PROVIDER_FEE_ASSET_ID, + QuoteFee.JSON_PROPERTY_PROVIDER_FEE_RATE, + QuoteFee.JSON_PROPERTY_NETWORK_APPROVE_FEE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuoteFee { + public static final String JSON_PROPERTY_NETWORK_EXECUTION_FEE = "networkExecutionFee"; + private String networkExecutionFee; + + public static final String JSON_PROPERTY_NETWORK_FEE_ASSET_ID = "networkFeeAssetId"; + private String networkFeeAssetId; + + public static final String JSON_PROPERTY_PROVIDER_FEE = "providerFee"; + private String providerFee; + + public static final String JSON_PROPERTY_PROVIDER_FEE_ASSET_ID = "providerFeeAssetId"; + private String providerFeeAssetId; + + public static final String JSON_PROPERTY_PROVIDER_FEE_RATE = "providerFeeRate"; + private BigDecimal providerFeeRate; + + public static final String JSON_PROPERTY_NETWORK_APPROVE_FEE = "networkApproveFee"; + private String networkApproveFee; + + public QuoteFee() {} + + public QuoteFee networkExecutionFee(String networkExecutionFee) { + this.networkExecutionFee = networkExecutionFee; + return this; + } + + /** + * The gas fee in the asset unit. + * + * @return networkExecutionFee + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK_EXECUTION_FEE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNetworkExecutionFee() { + return networkExecutionFee; + } + + @JsonProperty(JSON_PROPERTY_NETWORK_EXECUTION_FEE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetworkExecutionFee(String networkExecutionFee) { + this.networkExecutionFee = networkExecutionFee; + } + + public QuoteFee networkFeeAssetId(String networkFeeAssetId) { + this.networkFeeAssetId = networkFeeAssetId; + return this; + } + + /** + * The network fee in Fireblocks asset representation + * + * @return networkFeeAssetId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NETWORK_FEE_ASSET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNetworkFeeAssetId() { + return networkFeeAssetId; + } + + @JsonProperty(JSON_PROPERTY_NETWORK_FEE_ASSET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetworkFeeAssetId(String networkFeeAssetId) { + this.networkFeeAssetId = networkFeeAssetId; + } + + public QuoteFee providerFee(String providerFee) { + this.providerFee = providerFee; + return this; + } + + /** + * The provider fee in the asset unit. + * + * @return providerFee + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderFee() { + return providerFee; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderFee(String providerFee) { + this.providerFee = providerFee; + } + + public QuoteFee providerFeeAssetId(String providerFeeAssetId) { + this.providerFeeAssetId = providerFeeAssetId; + return this; + } + + /** + * The provider fee in Fireblocks asset representation + * + * @return providerFeeAssetId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE_ASSET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderFeeAssetId() { + return providerFeeAssetId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE_ASSET_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderFeeAssetId(String providerFeeAssetId) { + this.providerFeeAssetId = providerFeeAssetId; + } + + public QuoteFee providerFeeRate(BigDecimal providerFeeRate) { + this.providerFeeRate = providerFeeRate; + return this; + } + + /** + * Percentages of the provider fee out of the gross amount + * + * @return providerFeeRate + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE_RATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getProviderFeeRate() { + return providerFeeRate; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_FEE_RATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderFeeRate(BigDecimal providerFeeRate) { + this.providerFeeRate = providerFeeRate; + } + + public QuoteFee networkApproveFee(String networkApproveFee) { + this.networkApproveFee = networkApproveFee; + return this; + } + + /** + * The gas fee in the asset unit. + * + * @return networkApproveFee + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NETWORK_APPROVE_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNetworkApproveFee() { + return networkApproveFee; + } + + @JsonProperty(JSON_PROPERTY_NETWORK_APPROVE_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworkApproveFee(String networkApproveFee) { + this.networkApproveFee = networkApproveFee; + } + + /** Return true if this QuoteFee object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuoteFee quoteFee = (QuoteFee) o; + return Objects.equals(this.networkExecutionFee, quoteFee.networkExecutionFee) + && Objects.equals(this.networkFeeAssetId, quoteFee.networkFeeAssetId) + && Objects.equals(this.providerFee, quoteFee.providerFee) + && Objects.equals(this.providerFeeAssetId, quoteFee.providerFeeAssetId) + && Objects.equals(this.providerFeeRate, quoteFee.providerFeeRate) + && Objects.equals(this.networkApproveFee, quoteFee.networkApproveFee); + } + + @Override + public int hashCode() { + return Objects.hash( + networkExecutionFee, + networkFeeAssetId, + providerFee, + providerFeeAssetId, + providerFeeRate, + networkApproveFee); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuoteFee {\n"); + sb.append(" networkExecutionFee: ") + .append(toIndentedString(networkExecutionFee)) + .append("\n"); + sb.append(" networkFeeAssetId: ") + .append(toIndentedString(networkFeeAssetId)) + .append("\n"); + sb.append(" providerFee: ").append(toIndentedString(providerFee)).append("\n"); + sb.append(" providerFeeAssetId: ") + .append(toIndentedString(providerFeeAssetId)) + .append("\n"); + sb.append(" providerFeeRate: ").append(toIndentedString(providerFeeRate)).append("\n"); + sb.append(" networkApproveFee: ") + .append(toIndentedString(networkApproveFee)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `networkExecutionFee` to the URL query string + if (getNetworkExecutionFee() != null) { + joiner.add( + String.format( + "%snetworkExecutionFee%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getNetworkExecutionFee()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `networkFeeAssetId` to the URL query string + if (getNetworkFeeAssetId() != null) { + joiner.add( + String.format( + "%snetworkFeeAssetId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getNetworkFeeAssetId()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `providerFee` to the URL query string + if (getProviderFee() != null) { + joiner.add( + String.format( + "%sproviderFee%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderFee()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `providerFeeAssetId` to the URL query string + if (getProviderFeeAssetId() != null) { + joiner.add( + String.format( + "%sproviderFeeAssetId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderFeeAssetId()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `providerFeeRate` to the URL query string + if (getProviderFeeRate() != null) { + joiner.add( + String.format( + "%sproviderFeeRate%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderFeeRate()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `networkApproveFee` to the URL query string + if (getNetworkApproveFee() != null) { + joiner.add( + String.format( + "%snetworkApproveFee%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getNetworkApproveFee()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/QuoteRequest.java b/src/main/java/com/fireblocks/sdk/model/QuoteRequest.java new file mode 100644 index 00000000..24beaeb8 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/QuoteRequest.java @@ -0,0 +1,355 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** QuoteRequest */ +@JsonPropertyOrder({ + QuoteRequest.JSON_PROPERTY_ACCOUNT_ID, + QuoteRequest.JSON_PROPERTY_INPUT_AMOUNT, + QuoteRequest.JSON_PROPERTY_INPUT_ASSET, + QuoteRequest.JSON_PROPERTY_OUTPUT_ASSET, + QuoteRequest.JSON_PROPERTY_SLIPPAGE_TOLERANCE, + QuoteRequest.JSON_PROPERTY_PROTOCOL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuoteRequest { + public static final String JSON_PROPERTY_ACCOUNT_ID = "accountId"; + private String accountId; + + public static final String JSON_PROPERTY_INPUT_AMOUNT = "inputAmount"; + private String inputAmount; + + public static final String JSON_PROPERTY_INPUT_ASSET = "inputAsset"; + private String inputAsset; + + public static final String JSON_PROPERTY_OUTPUT_ASSET = "outputAsset"; + private String outputAsset; + + public static final String JSON_PROPERTY_SLIPPAGE_TOLERANCE = "slippageTolerance"; + private BigDecimal slippageTolerance; + + public static final String JSON_PROPERTY_PROTOCOL = "protocol"; + private SwapProviderProtocolsEnum protocol; + + public QuoteRequest() {} + + public QuoteRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The id of the vault account or account id + * + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountId() { + return accountId; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public QuoteRequest inputAmount(String inputAmount) { + this.inputAmount = inputAmount; + return this; + } + + /** + * The amount of tokens the swapper will provide, positive number, can be a decimal. + * + * @return inputAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInputAmount() { + return inputAmount; + } + + @JsonProperty(JSON_PROPERTY_INPUT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputAmount(String inputAmount) { + this.inputAmount = inputAmount; + } + + public QuoteRequest inputAsset(String inputAsset) { + this.inputAsset = inputAsset; + return this; + } + + /** + * The id of the asset the swapper will provide + * + * @return inputAsset + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInputAsset() { + return inputAsset; + } + + @JsonProperty(JSON_PROPERTY_INPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputAsset(String inputAsset) { + this.inputAsset = inputAsset; + } + + public QuoteRequest outputAsset(String outputAsset) { + this.outputAsset = outputAsset; + return this; + } + + /** + * The id of the asset the swapper will receive + * + * @return outputAsset + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputAsset() { + return outputAsset; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputAsset(String outputAsset) { + this.outputAsset = outputAsset; + } + + public QuoteRequest slippageTolerance(BigDecimal slippageTolerance) { + this.slippageTolerance = slippageTolerance; + return this; + } + + /** + * The slippage tolerance is a percentage. The slippage tolerance is the maximum amount the + * price can change between the time the transaction is submitted and the time it is executed + * minimum: 0 maximum: 100 + * + * @return slippageTolerance + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SLIPPAGE_TOLERANCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getSlippageTolerance() { + return slippageTolerance; + } + + @JsonProperty(JSON_PROPERTY_SLIPPAGE_TOLERANCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSlippageTolerance(BigDecimal slippageTolerance) { + this.slippageTolerance = slippageTolerance; + } + + public QuoteRequest protocol(SwapProviderProtocolsEnum protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SwapProviderProtocolsEnum getProtocol() { + return protocol; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProtocol(SwapProviderProtocolsEnum protocol) { + this.protocol = protocol; + } + + /** Return true if this QuoteRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuoteRequest quoteRequest = (QuoteRequest) o; + return Objects.equals(this.accountId, quoteRequest.accountId) + && Objects.equals(this.inputAmount, quoteRequest.inputAmount) + && Objects.equals(this.inputAsset, quoteRequest.inputAsset) + && Objects.equals(this.outputAsset, quoteRequest.outputAsset) + && Objects.equals(this.slippageTolerance, quoteRequest.slippageTolerance) + && Objects.equals(this.protocol, quoteRequest.protocol); + } + + @Override + public int hashCode() { + return Objects.hash( + accountId, inputAmount, inputAsset, outputAsset, slippageTolerance, protocol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuoteRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" inputAsset: ").append(toIndentedString(inputAsset)).append("\n"); + sb.append(" outputAsset: ").append(toIndentedString(outputAsset)).append("\n"); + sb.append(" slippageTolerance: ") + .append(toIndentedString(slippageTolerance)) + .append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `accountId` to the URL query string + if (getAccountId() != null) { + joiner.add( + String.format( + "%saccountId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getAccountId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `inputAmount` to the URL query string + if (getInputAmount() != null) { + joiner.add( + String.format( + "%sinputAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getInputAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `inputAsset` to the URL query string + if (getInputAsset() != null) { + joiner.add( + String.format( + "%sinputAsset%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getInputAsset()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputAsset` to the URL query string + if (getOutputAsset() != null) { + joiner.add( + String.format( + "%soutputAsset%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputAsset()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `slippageTolerance` to the URL query string + if (getSlippageTolerance() != null) { + joiner.add( + String.format( + "%sslippageTolerance%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSlippageTolerance()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `protocol` to the URL query string + if (getProtocol() != null) { + joiner.add( + String.format( + "%sprotocol%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getProtocol()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/QuoteResponse.java b/src/main/java/com/fireblocks/sdk/model/QuoteResponse.java new file mode 100644 index 00000000..6c8a05af --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/QuoteResponse.java @@ -0,0 +1,321 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.fireblocks.sdk.JSON; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonDeserialize(using = QuoteResponse.QuoteResponseDeserializer.class) +@JsonSerialize(using = QuoteResponse.QuoteResponseSerializer.class) +public class QuoteResponse extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(QuoteResponse.class.getName()); + + public static class QuoteResponseSerializer extends StdSerializer { + public QuoteResponseSerializer(Class t) { + super(t); + } + + public QuoteResponseSerializer() { + this(null); + } + + @Override + public void serialize(QuoteResponse value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class QuoteResponseDeserializer extends StdDeserializer { + public QuoteResponseDeserializer() { + this(QuoteResponse.class); + } + + public QuoteResponseDeserializer(Class vc) { + super(vc); + } + + @Override + public QuoteResponse deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize NonWalletQuoteResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (NonWalletQuoteResponse.class.equals(Integer.class) + || NonWalletQuoteResponse.class.equals(Long.class) + || NonWalletQuoteResponse.class.equals(Float.class) + || NonWalletQuoteResponse.class.equals(Double.class) + || NonWalletQuoteResponse.class.equals(Boolean.class) + || NonWalletQuoteResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((NonWalletQuoteResponse.class.equals(Integer.class) + || NonWalletQuoteResponse.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((NonWalletQuoteResponse.class.equals(Float.class) + || NonWalletQuoteResponse.class.equals( + Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (NonWalletQuoteResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (NonWalletQuoteResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = + tree.traverse(jp.getCodec()).readValueAs(NonWalletQuoteResponse.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'NonWalletQuoteResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'NonWalletQuoteResponse'", + e); + } + + // deserialize WalletQuoteResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (WalletQuoteResponse.class.equals(Integer.class) + || WalletQuoteResponse.class.equals(Long.class) + || WalletQuoteResponse.class.equals(Float.class) + || WalletQuoteResponse.class.equals(Double.class) + || WalletQuoteResponse.class.equals(Boolean.class) + || WalletQuoteResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((WalletQuoteResponse.class.equals(Integer.class) + || WalletQuoteResponse.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((WalletQuoteResponse.class.equals(Float.class) + || WalletQuoteResponse.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (WalletQuoteResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (WalletQuoteResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = + tree.traverse(jp.getCodec()).readValueAs(WalletQuoteResponse.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'WalletQuoteResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'WalletQuoteResponse'", e); + } + + if (match == 1) { + QuoteResponse ret = new QuoteResponse(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException( + String.format( + "Failed deserialization for QuoteResponse: %d classes match result," + + " expected 1", + match)); + } + + /** Handle deserialization of the 'null' value. */ + @Override + public QuoteResponse getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "QuoteResponse cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public QuoteResponse() { + super("oneOf", Boolean.FALSE); + } + + public QuoteResponse(NonWalletQuoteResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public QuoteResponse(WalletQuoteResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("NonWalletQuoteResponse", NonWalletQuoteResponse.class); + schemas.put("WalletQuoteResponse", WalletQuoteResponse.class); + JSON.registerDescendants(QuoteResponse.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return QuoteResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: NonWalletQuoteResponse, WalletQuoteResponse + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(NonWalletQuoteResponse.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(WalletQuoteResponse.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be NonWalletQuoteResponse, WalletQuoteResponse"); + } + + /** + * Get the actual instance, which can be the following: NonWalletQuoteResponse, + * WalletQuoteResponse + * + * @return The actual instance (NonWalletQuoteResponse, WalletQuoteResponse) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `NonWalletQuoteResponse`. If the actual instance is not + * `NonWalletQuoteResponse`, the ClassCastException will be thrown. + * + * @return The actual instance of `NonWalletQuoteResponse` + * @throws ClassCastException if the instance is not `NonWalletQuoteResponse` + */ + public NonWalletQuoteResponse getNonWalletQuoteResponse() throws ClassCastException { + return (NonWalletQuoteResponse) super.getActualInstance(); + } + + /** + * Get the actual instance of `WalletQuoteResponse`. If the actual instance is not + * `WalletQuoteResponse`, the ClassCastException will be thrown. + * + * @return The actual instance of `WalletQuoteResponse` + * @throws ClassCastException if the instance is not `WalletQuoteResponse` + */ + public WalletQuoteResponse getWalletQuoteResponse() throws ClassCastException { + return (WalletQuoteResponse) super.getActualInstance(); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof WalletQuoteResponse) { + if (getActualInstance() != null) { + joiner.add( + ((WalletQuoteResponse) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof NonWalletQuoteResponse) { + if (getActualInstance() != null) { + joiner.add( + ((NonWalletQuoteResponse) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapFlowError.java b/src/main/java/com/fireblocks/sdk/model/SwapFlowError.java new file mode 100644 index 00000000..91987ee0 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapFlowError.java @@ -0,0 +1,178 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** The error message for the swap */ +@JsonPropertyOrder({SwapFlowError.JSON_PROPERTY_CODE, SwapFlowError.JSON_PROPERTY_MESSAGE}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SwapFlowError { + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public SwapFlowError() {} + + public SwapFlowError code(String code) { + this.code = code; + return this; + } + + /** + * The code representing the error + * + * @return code + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCode(String code) { + this.code = code; + } + + public SwapFlowError message(String message) { + this.message = message; + return this; + } + + /** + * Error message + * + * @return message + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(String message) { + this.message = message; + } + + /** Return true if this SwapFlowError object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapFlowError swapFlowError = (SwapFlowError) o; + return Objects.equals(this.code, swapFlowError.code) + && Objects.equals(this.message, swapFlowError.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapFlowError {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `code` to the URL query string + if (getCode() != null) { + joiner.add( + String.format( + "%scode%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getCode()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add( + String.format( + "%smessage%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getMessage()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapOperation.java b/src/main/java/com/fireblocks/sdk/model/SwapOperation.java new file mode 100644 index 00000000..b6c897f3 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapOperation.java @@ -0,0 +1,937 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +/** SwapOperation */ +@JsonPropertyOrder({ + SwapOperation.JSON_PROPERTY_ID, + SwapOperation.JSON_PROPERTY_ACCOUNT_ID, + SwapOperation.JSON_PROPERTY_PROVIDER_ID, + SwapOperation.JSON_PROPERTY_CATEGORY, + SwapOperation.JSON_PROPERTY_PROTOCOL, + SwapOperation.JSON_PROPERTY_STATUS, + SwapOperation.JSON_PROPERTY_INPUT_AMOUNT, + SwapOperation.JSON_PROPERTY_INPUT_ASSET, + SwapOperation.JSON_PROPERTY_SLIPPAGE_TOLERANCE, + SwapOperation.JSON_PROPERTY_OUTPUT_MIN_AMOUNT, + SwapOperation.JSON_PROPERTY_OUTPUT_MAX_AMOUNT, + SwapOperation.JSON_PROPERTY_OUTPUT_ASSET, + SwapOperation.JSON_PROPERTY_OUTPUT_FINAL_AMOUNT, + SwapOperation.JSON_PROPERTY_REQUIRED_ACTIONS, + SwapOperation.JSON_PROPERTY_ERROR, + SwapOperation.JSON_PROPERTY_CREATED_AT, + SwapOperation.JSON_PROPERTY_UPDATED_AT, + SwapOperation.JSON_PROPERTY_CREATED_BY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SwapOperation { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "accountId"; + private String accountId; + + public static final String JSON_PROPERTY_PROVIDER_ID = "providerId"; + private String providerId; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private ProviderCategoryEnum category; + + public static final String JSON_PROPERTY_PROTOCOL = "protocol"; + private SwapProviderProtocolsEnum protocol; + + /** + * **CREATED** – The swap request has been created but not yet started. **PENDING_USER_ACTION** + * – Awaiting a user action (e.g. signature or approval). **PENDING_PROVIDER_ACTION** – Awaiting + * the provider to process the request. **PROCESSING** – The swap is actively being executed + * on‐chain. **COMPLETED** – The swap has finished successfully. **CANCELED** – The swap was + * cancelled by user or provider before completion. **FAILED** – The swap attempted but + * encountered an error. + */ + public enum StatusEnum { + CREATED("CREATED"), + + TRANSACTION_IN_PROGRESS("TRANSACTION_IN_PROGRESS"), + + PENDING_PROVIDER_ACTION("PENDING_PROVIDER_ACTION"), + + COMPLETED("COMPLETED"), + + CANCELED("CANCELED"), + + FAILED("FAILED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_INPUT_AMOUNT = "inputAmount"; + private String inputAmount; + + public static final String JSON_PROPERTY_INPUT_ASSET = "inputAsset"; + private String inputAsset; + + public static final String JSON_PROPERTY_SLIPPAGE_TOLERANCE = "slippageTolerance"; + private BigDecimal slippageTolerance; + + public static final String JSON_PROPERTY_OUTPUT_MIN_AMOUNT = "outputMinAmount"; + private String outputMinAmount; + + public static final String JSON_PROPERTY_OUTPUT_MAX_AMOUNT = "outputMaxAmount"; + private String outputMaxAmount; + + public static final String JSON_PROPERTY_OUTPUT_ASSET = "outputAsset"; + private String outputAsset; + + public static final String JSON_PROPERTY_OUTPUT_FINAL_AMOUNT = "outputFinalAmount"; + private String outputFinalAmount; + + public static final String JSON_PROPERTY_REQUIRED_ACTIONS = "requiredActions"; + private List requiredActions = new ArrayList<>(); + + public static final String JSON_PROPERTY_ERROR = "error"; + private SwapFlowError error; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; + private OffsetDateTime updatedAt; + + public static final String JSON_PROPERTY_CREATED_BY = "createdBy"; + private UUID createdBy; + + public SwapOperation() {} + + public SwapOperation id(String id) { + this.id = id; + return this; + } + + /** + * The id of the swap operation + * + * @return id + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + public SwapOperation accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The id of the vault account or account id + * + * @return accountId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountId() { + return accountId; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public SwapOperation providerId(String providerId) { + this.providerId = providerId; + return this; + } + + /** + * The ID of the provider + * + * @return providerId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProviderId() { + return providerId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public SwapOperation category(ProviderCategoryEnum category) { + this.category = category; + return this; + } + + /** + * Get category + * + * @return category + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProviderCategoryEnum getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategory(ProviderCategoryEnum category) { + this.category = category; + } + + public SwapOperation protocol(SwapProviderProtocolsEnum protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SwapProviderProtocolsEnum getProtocol() { + return protocol; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProtocol(SwapProviderProtocolsEnum protocol) { + this.protocol = protocol; + } + + public SwapOperation status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * **CREATED** – The swap request has been created but not yet started. **PENDING_USER_ACTION** + * – Awaiting a user action (e.g. signature or approval). **PENDING_PROVIDER_ACTION** – Awaiting + * the provider to process the request. **PROCESSING** – The swap is actively being executed + * on‐chain. **COMPLETED** – The swap has finished successfully. **CANCELED** – The swap was + * cancelled by user or provider before completion. **FAILED** – The swap attempted but + * encountered an error. + * + * @return status + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public SwapOperation inputAmount(String inputAmount) { + this.inputAmount = inputAmount; + return this; + } + + /** + * The amount of tokens the swapper will provide + * + * @return inputAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInputAmount() { + return inputAmount; + } + + @JsonProperty(JSON_PROPERTY_INPUT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputAmount(String inputAmount) { + this.inputAmount = inputAmount; + } + + public SwapOperation inputAsset(String inputAsset) { + this.inputAsset = inputAsset; + return this; + } + + /** + * The id of the asset the swapper will provide + * + * @return inputAsset + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInputAsset() { + return inputAsset; + } + + @JsonProperty(JSON_PROPERTY_INPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputAsset(String inputAsset) { + this.inputAsset = inputAsset; + } + + public SwapOperation slippageTolerance(BigDecimal slippageTolerance) { + this.slippageTolerance = slippageTolerance; + return this; + } + + /** + * The slippage tolerance is a percentage. The slippage tolerance is the maximum amount the + * price can change between the time the transaction is submitted and the time it is executed + * + * @return slippageTolerance + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SLIPPAGE_TOLERANCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getSlippageTolerance() { + return slippageTolerance; + } + + @JsonProperty(JSON_PROPERTY_SLIPPAGE_TOLERANCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSlippageTolerance(BigDecimal slippageTolerance) { + this.slippageTolerance = slippageTolerance; + } + + public SwapOperation outputMinAmount(String outputMinAmount) { + this.outputMinAmount = outputMinAmount; + return this; + } + + /** + * The minimum amount of tokens the swapper will receive + * + * @return outputMinAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_MIN_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputMinAmount() { + return outputMinAmount; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_MIN_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputMinAmount(String outputMinAmount) { + this.outputMinAmount = outputMinAmount; + } + + public SwapOperation outputMaxAmount(String outputMaxAmount) { + this.outputMaxAmount = outputMaxAmount; + return this; + } + + /** + * Maximum amount of tokens that the swapper will receive + * + * @return outputMaxAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_MAX_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputMaxAmount() { + return outputMaxAmount; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_MAX_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputMaxAmount(String outputMaxAmount) { + this.outputMaxAmount = outputMaxAmount; + } + + public SwapOperation outputAsset(String outputAsset) { + this.outputAsset = outputAsset; + return this; + } + + /** + * The id of the asset the swapper will receive + * + * @return outputAsset + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputAsset() { + return outputAsset; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputAsset(String outputAsset) { + this.outputAsset = outputAsset; + } + + public SwapOperation outputFinalAmount(String outputFinalAmount) { + this.outputFinalAmount = outputFinalAmount; + return this; + } + + /** + * Final amount of tokens that the swapper will receive + * + * @return outputFinalAmount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTPUT_FINAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOutputFinalAmount() { + return outputFinalAmount; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_FINAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputFinalAmount(String outputFinalAmount) { + this.outputFinalAmount = outputFinalAmount; + } + + public SwapOperation requiredActions(List requiredActions) { + this.requiredActions = requiredActions; + return this; + } + + public SwapOperation addRequiredActionsItem(SwapRequiredAction requiredActionsItem) { + if (this.requiredActions == null) { + this.requiredActions = new ArrayList<>(); + } + this.requiredActions.add(requiredActionsItem); + return this; + } + + /** + * The required actions for the swap, including the type of action, the status of the action, + * and the transaction id + * + * @return requiredActions + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUIRED_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRequiredActions() { + return requiredActions; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequiredActions(List requiredActions) { + this.requiredActions = requiredActions; + } + + public SwapOperation error(SwapFlowError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SwapFlowError getError() { + return error; + } + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(SwapFlowError error) { + this.error = error; + } + + public SwapOperation createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The creation time of the swap operation (ISO Date time). + * + * @return createdAt + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public SwapOperation updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The last update time of the swap operation (ISO Date time). + * + * @return updatedAt + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + public SwapOperation createdBy(UUID createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Fireblocks user id that issued the swap + * + * @return createdBy + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getCreatedBy() { + return createdBy; + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedBy(UUID createdBy) { + this.createdBy = createdBy; + } + + /** Return true if this SwapOperation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapOperation swapOperation = (SwapOperation) o; + return Objects.equals(this.id, swapOperation.id) + && Objects.equals(this.accountId, swapOperation.accountId) + && Objects.equals(this.providerId, swapOperation.providerId) + && Objects.equals(this.category, swapOperation.category) + && Objects.equals(this.protocol, swapOperation.protocol) + && Objects.equals(this.status, swapOperation.status) + && Objects.equals(this.inputAmount, swapOperation.inputAmount) + && Objects.equals(this.inputAsset, swapOperation.inputAsset) + && Objects.equals(this.slippageTolerance, swapOperation.slippageTolerance) + && Objects.equals(this.outputMinAmount, swapOperation.outputMinAmount) + && Objects.equals(this.outputMaxAmount, swapOperation.outputMaxAmount) + && Objects.equals(this.outputAsset, swapOperation.outputAsset) + && Objects.equals(this.outputFinalAmount, swapOperation.outputFinalAmount) + && Objects.equals(this.requiredActions, swapOperation.requiredActions) + && Objects.equals(this.error, swapOperation.error) + && Objects.equals(this.createdAt, swapOperation.createdAt) + && Objects.equals(this.updatedAt, swapOperation.updatedAt) + && Objects.equals(this.createdBy, swapOperation.createdBy); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + accountId, + providerId, + category, + protocol, + status, + inputAmount, + inputAsset, + slippageTolerance, + outputMinAmount, + outputMaxAmount, + outputAsset, + outputFinalAmount, + requiredActions, + error, + createdAt, + updatedAt, + createdBy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapOperation {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" providerId: ").append(toIndentedString(providerId)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" inputAsset: ").append(toIndentedString(inputAsset)).append("\n"); + sb.append(" slippageTolerance: ") + .append(toIndentedString(slippageTolerance)) + .append("\n"); + sb.append(" outputMinAmount: ").append(toIndentedString(outputMinAmount)).append("\n"); + sb.append(" outputMaxAmount: ").append(toIndentedString(outputMaxAmount)).append("\n"); + sb.append(" outputAsset: ").append(toIndentedString(outputAsset)).append("\n"); + sb.append(" outputFinalAmount: ") + .append(toIndentedString(outputFinalAmount)) + .append("\n"); + sb.append(" requiredActions: ").append(toIndentedString(requiredActions)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `accountId` to the URL query string + if (getAccountId() != null) { + joiner.add( + String.format( + "%saccountId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getAccountId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `providerId` to the URL query string + if (getProviderId() != null) { + joiner.add( + String.format( + "%sproviderId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add( + String.format( + "%scategory%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getCategory()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `protocol` to the URL query string + if (getProtocol() != null) { + joiner.add( + String.format( + "%sprotocol%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getProtocol()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add( + String.format( + "%sstatus%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `inputAmount` to the URL query string + if (getInputAmount() != null) { + joiner.add( + String.format( + "%sinputAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getInputAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `inputAsset` to the URL query string + if (getInputAsset() != null) { + joiner.add( + String.format( + "%sinputAsset%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getInputAsset()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `slippageTolerance` to the URL query string + if (getSlippageTolerance() != null) { + joiner.add( + String.format( + "%sslippageTolerance%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSlippageTolerance()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputMinAmount` to the URL query string + if (getOutputMinAmount() != null) { + joiner.add( + String.format( + "%soutputMinAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputMinAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputMaxAmount` to the URL query string + if (getOutputMaxAmount() != null) { + joiner.add( + String.format( + "%soutputMaxAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputMaxAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputAsset` to the URL query string + if (getOutputAsset() != null) { + joiner.add( + String.format( + "%soutputAsset%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputAsset()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputFinalAmount` to the URL query string + if (getOutputFinalAmount() != null) { + joiner.add( + String.format( + "%soutputFinalAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputFinalAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `requiredActions` to the URL query string + if (getRequiredActions() != null) { + for (int i = 0; i < getRequiredActions().size(); i++) { + if (getRequiredActions().get(i) != null) { + joiner.add( + getRequiredActions() + .get(i) + .toUrlQueryString( + String.format( + "%srequiredActions%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + i, + containerSuffix)))); + } + } + } + + // add `error` to the URL query string + if (getError() != null) { + joiner.add(getError().toUrlQueryString(prefix + "error" + suffix)); + } + + // add `createdAt` to the URL query string + if (getCreatedAt() != null) { + joiner.add( + String.format( + "%screatedAt%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getCreatedAt()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `updatedAt` to the URL query string + if (getUpdatedAt() != null) { + joiner.add( + String.format( + "%supdatedAt%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getUpdatedAt()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `createdBy` to the URL query string + if (getCreatedBy() != null) { + joiner.add( + String.format( + "%screatedBy%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getCreatedBy()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapOperationRequest.java b/src/main/java/com/fireblocks/sdk/model/SwapOperationRequest.java new file mode 100644 index 00000000..45757fc2 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapOperationRequest.java @@ -0,0 +1,261 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +/** SwapOperationRequest */ +@JsonPropertyOrder({ + SwapOperationRequest.JSON_PROPERTY_PROVIDER_QUOTE_ID, + SwapOperationRequest.JSON_PROPERTY_FEE_LEVEL, + SwapOperationRequest.JSON_PROPERTY_TX_NOTE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SwapOperationRequest { + public static final String JSON_PROPERTY_PROVIDER_QUOTE_ID = "providerQuoteId"; + private UUID providerQuoteId; + + /** The fee level of the transaction */ + public enum FeeLevelEnum { + LOW("LOW"), + + MEDIUM("MEDIUM"), + + HIGH("HIGH"); + + private String value; + + FeeLevelEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FeeLevelEnum fromValue(String value) { + for (FeeLevelEnum b : FeeLevelEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_FEE_LEVEL = "feeLevel"; + private FeeLevelEnum feeLevel; + + public static final String JSON_PROPERTY_TX_NOTE = "txNote"; + private String txNote; + + public SwapOperationRequest() {} + + public SwapOperationRequest providerQuoteId(UUID providerQuoteId) { + this.providerQuoteId = providerQuoteId; + return this; + } + + /** + * An identifier that uniquely identifies the received quote + * + * @return providerQuoteId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_QUOTE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getProviderQuoteId() { + return providerQuoteId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_QUOTE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderQuoteId(UUID providerQuoteId) { + this.providerQuoteId = providerQuoteId; + } + + public SwapOperationRequest feeLevel(FeeLevelEnum feeLevel) { + this.feeLevel = feeLevel; + return this; + } + + /** + * The fee level of the transaction + * + * @return feeLevel + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEE_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FeeLevelEnum getFeeLevel() { + return feeLevel; + } + + @JsonProperty(JSON_PROPERTY_FEE_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFeeLevel(FeeLevelEnum feeLevel) { + this.feeLevel = feeLevel; + } + + public SwapOperationRequest txNote(String txNote) { + this.txNote = txNote; + return this; + } + + /** + * user note on the transaction + * + * @return txNote + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TX_NOTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTxNote() { + return txNote; + } + + @JsonProperty(JSON_PROPERTY_TX_NOTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTxNote(String txNote) { + this.txNote = txNote; + } + + /** Return true if this SwapOperationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapOperationRequest swapOperationRequest = (SwapOperationRequest) o; + return Objects.equals(this.providerQuoteId, swapOperationRequest.providerQuoteId) + && Objects.equals(this.feeLevel, swapOperationRequest.feeLevel) + && Objects.equals(this.txNote, swapOperationRequest.txNote); + } + + @Override + public int hashCode() { + return Objects.hash(providerQuoteId, feeLevel, txNote); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapOperationRequest {\n"); + sb.append(" providerQuoteId: ").append(toIndentedString(providerQuoteId)).append("\n"); + sb.append(" feeLevel: ").append(toIndentedString(feeLevel)).append("\n"); + sb.append(" txNote: ").append(toIndentedString(txNote)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `providerQuoteId` to the URL query string + if (getProviderQuoteId() != null) { + joiner.add( + String.format( + "%sproviderQuoteId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderQuoteId()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `feeLevel` to the URL query string + if (getFeeLevel() != null) { + joiner.add( + String.format( + "%sfeeLevel%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getFeeLevel()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `txNote` to the URL query string + if (getTxNote() != null) { + joiner.add( + String.format( + "%stxNote%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getTxNote()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapOperationsPaginatedResponse.java b/src/main/java/com/fireblocks/sdk/model/SwapOperationsPaginatedResponse.java new file mode 100644 index 00000000..e3fe1a92 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapOperationsPaginatedResponse.java @@ -0,0 +1,205 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** SwapOperationsPaginatedResponse */ +@JsonPropertyOrder({ + SwapOperationsPaginatedResponse.JSON_PROPERTY_DATA, + SwapOperationsPaginatedResponse.JSON_PROPERTY_NEXT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SwapOperationsPaginatedResponse { + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_NEXT = "next"; + private String next; + + public SwapOperationsPaginatedResponse() {} + + public SwapOperationsPaginatedResponse data(List data) { + this.data = data; + return this; + } + + public SwapOperationsPaginatedResponse addDataItem(SwapOperation dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * The data of the current page + * + * @return data + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setData(List data) { + this.data = data; + } + + public SwapOperationsPaginatedResponse next(String next) { + this.next = next; + return this; + } + + /** + * The cursor to fetch the next page of results, if absent or null, there are no additional + * results. + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNext() { + return next; + } + + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNext(String next) { + this.next = next; + } + + /** Return true if this SwapOperationsPaginatedResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapOperationsPaginatedResponse swapOperationsPaginatedResponse = + (SwapOperationsPaginatedResponse) o; + return Objects.equals(this.data, swapOperationsPaginatedResponse.data) + && Objects.equals(this.next, swapOperationsPaginatedResponse.next); + } + + @Override + public int hashCode() { + return Objects.hash(data, next); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapOperationsPaginatedResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add( + getData() + .get(i) + .toUrlQueryString( + String.format( + "%sdata%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + i, + containerSuffix)))); + } + } + } + + // add `next` to the URL query string + if (getNext() != null) { + joiner.add( + String.format( + "%snext%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getNext()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapProvider.java b/src/main/java/com/fireblocks/sdk/model/SwapProvider.java new file mode 100644 index 00000000..eb5f9f54 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapProvider.java @@ -0,0 +1,426 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** SwapProvider */ +@JsonPropertyOrder({ + SwapProvider.JSON_PROPERTY_ID, + SwapProvider.JSON_PROPERTY_NAME, + SwapProvider.JSON_PROPERTY_PROTOCOLS, + SwapProvider.JSON_PROPERTY_CATEGORY, + SwapProvider.JSON_PROPERTY_IS_TERMS_APPROVAL_REQUIRED, + SwapProvider.JSON_PROPERTY_TERMS_OF_SERVICE_URL, + SwapProvider.JSON_PROPERTY_IS_TERMS_OF_SERVICE_APPROVED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SwapProvider { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PROTOCOLS = "protocols"; + private List protocols = new ArrayList<>(); + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private ProviderCategoryEnum category; + + public static final String JSON_PROPERTY_IS_TERMS_APPROVAL_REQUIRED = "isTermsApprovalRequired"; + private Boolean isTermsApprovalRequired; + + public static final String JSON_PROPERTY_TERMS_OF_SERVICE_URL = "termsOfServiceUrl"; + private String termsOfServiceUrl; + + public static final String JSON_PROPERTY_IS_TERMS_OF_SERVICE_APPROVED = + "isTermsOfServiceApproved"; + private Boolean isTermsOfServiceApproved; + + public SwapProvider() {} + + public SwapProvider id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the provider + * + * @return id + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; + } + + public SwapProvider name(String name) { + this.name = name; + return this; + } + + /** + * Name of the provider + * + * @return name + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public SwapProvider protocols(List protocols) { + this.protocols = protocols; + return this; + } + + public SwapProvider addProtocolsItem(SwapProviderProtocolsEnum protocolsItem) { + if (this.protocols == null) { + this.protocols = new ArrayList<>(); + } + this.protocols.add(protocolsItem); + return this; + } + + /** + * List of supported protocols. Protocols are specific per provider + * + * @return protocols + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getProtocols() { + return protocols; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProtocols(List protocols) { + this.protocols = protocols; + } + + public SwapProvider category(ProviderCategoryEnum category) { + this.category = category; + return this; + } + + /** + * Get category + * + * @return category + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProviderCategoryEnum getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCategory(ProviderCategoryEnum category) { + this.category = category; + } + + public SwapProvider isTermsApprovalRequired(Boolean isTermsApprovalRequired) { + this.isTermsApprovalRequired = isTermsApprovalRequired; + return this; + } + + /** + * Indicates whether the terms of service are required for the provider. if `true`, + * the user must approve the terms of service before using the provider. otherwise, + * `termsOfServiceUrl` and `isTermsOfServiceApproved` are not shown under + * the provider data. + * + * @return isTermsApprovalRequired + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_TERMS_APPROVAL_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsTermsApprovalRequired() { + return isTermsApprovalRequired; + } + + @JsonProperty(JSON_PROPERTY_IS_TERMS_APPROVAL_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsTermsApprovalRequired(Boolean isTermsApprovalRequired) { + this.isTermsApprovalRequired = isTermsApprovalRequired; + } + + public SwapProvider termsOfServiceUrl(String termsOfServiceUrl) { + this.termsOfServiceUrl = termsOfServiceUrl; + return this; + } + + /** + * URL to the terms of service + * + * @return termsOfServiceUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TERMS_OF_SERVICE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTermsOfServiceUrl() { + return termsOfServiceUrl; + } + + @JsonProperty(JSON_PROPERTY_TERMS_OF_SERVICE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTermsOfServiceUrl(String termsOfServiceUrl) { + this.termsOfServiceUrl = termsOfServiceUrl; + } + + public SwapProvider isTermsOfServiceApproved(Boolean isTermsOfServiceApproved) { + this.isTermsOfServiceApproved = isTermsOfServiceApproved; + return this; + } + + /** + * Indicates whether the terms of service are approved by the user + * + * @return isTermsOfServiceApproved + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_TERMS_OF_SERVICE_APPROVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsTermsOfServiceApproved() { + return isTermsOfServiceApproved; + } + + @JsonProperty(JSON_PROPERTY_IS_TERMS_OF_SERVICE_APPROVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsTermsOfServiceApproved(Boolean isTermsOfServiceApproved) { + this.isTermsOfServiceApproved = isTermsOfServiceApproved; + } + + /** Return true if this SwapProvider object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapProvider swapProvider = (SwapProvider) o; + return Objects.equals(this.id, swapProvider.id) + && Objects.equals(this.name, swapProvider.name) + && Objects.equals(this.protocols, swapProvider.protocols) + && Objects.equals(this.category, swapProvider.category) + && Objects.equals( + this.isTermsApprovalRequired, swapProvider.isTermsApprovalRequired) + && Objects.equals(this.termsOfServiceUrl, swapProvider.termsOfServiceUrl) + && Objects.equals( + this.isTermsOfServiceApproved, swapProvider.isTermsOfServiceApproved); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + protocols, + category, + isTermsApprovalRequired, + termsOfServiceUrl, + isTermsOfServiceApproved); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapProvider {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" protocols: ").append(toIndentedString(protocols)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" isTermsApprovalRequired: ") + .append(toIndentedString(isTermsApprovalRequired)) + .append("\n"); + sb.append(" termsOfServiceUrl: ") + .append(toIndentedString(termsOfServiceUrl)) + .append("\n"); + sb.append(" isTermsOfServiceApproved: ") + .append(toIndentedString(isTermsOfServiceApproved)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `protocols` to the URL query string + if (getProtocols() != null) { + for (int i = 0; i < getProtocols().size(); i++) { + if (getProtocols().get(i) != null) { + joiner.add( + String.format( + "%sprotocols%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getProtocols().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + } + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add( + String.format( + "%scategory%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getCategory()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `isTermsApprovalRequired` to the URL query string + if (getIsTermsApprovalRequired() != null) { + joiner.add( + String.format( + "%sisTermsApprovalRequired%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getIsTermsApprovalRequired()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `termsOfServiceUrl` to the URL query string + if (getTermsOfServiceUrl() != null) { + joiner.add( + String.format( + "%stermsOfServiceUrl%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getTermsOfServiceUrl()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `isTermsOfServiceApproved` to the URL query string + if (getIsTermsOfServiceApproved() != null) { + joiner.add( + String.format( + "%sisTermsOfServiceApproved%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getIsTermsOfServiceApproved()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapProviderProtocolsEnum.java b/src/main/java/com/fireblocks/sdk/model/SwapProviderProtocolsEnum.java new file mode 100644 index 00000000..657266f9 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapProviderProtocolsEnum.java @@ -0,0 +1,72 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Protocol options supported by each provider. `UNISWAP` supports + * `UNISWAP_CLASSIC` and `UNISWAPX`. `WRAP_UNWRAP` supports + * `WRAP` and `UNWRAP.` + */ +public enum SwapProviderProtocolsEnum { + UNISWAP_CLASSIC("UNISWAP_CLASSIC"), + + UNISWAPX("UNISWAPX"), + + WRAP("WRAP"), + + UNWRAP("UNWRAP"); + + private String value; + + SwapProviderProtocolsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SwapProviderProtocolsEnum fromValue(String value) { + for (SwapProviderProtocolsEnum b : SwapProviderProtocolsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapProvidersPaginatedResponse.java b/src/main/java/com/fireblocks/sdk/model/SwapProvidersPaginatedResponse.java new file mode 100644 index 00000000..f6260075 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapProvidersPaginatedResponse.java @@ -0,0 +1,205 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; + +/** SwapProvidersPaginatedResponse */ +@JsonPropertyOrder({ + SwapProvidersPaginatedResponse.JSON_PROPERTY_DATA, + SwapProvidersPaginatedResponse.JSON_PROPERTY_NEXT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SwapProvidersPaginatedResponse { + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_NEXT = "next"; + private String next; + + public SwapProvidersPaginatedResponse() {} + + public SwapProvidersPaginatedResponse data(List data) { + this.data = data; + return this; + } + + public SwapProvidersPaginatedResponse addDataItem(SwapProvider dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * The data of the current page + * + * @return data + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setData(List data) { + this.data = data; + } + + public SwapProvidersPaginatedResponse next(String next) { + this.next = next; + return this; + } + + /** + * The cursor to fetch the next page of results, if absent or null, there are no additional + * results. + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNext() { + return next; + } + + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNext(String next) { + this.next = next; + } + + /** Return true if this SwapProvidersPaginatedResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapProvidersPaginatedResponse swapProvidersPaginatedResponse = + (SwapProvidersPaginatedResponse) o; + return Objects.equals(this.data, swapProvidersPaginatedResponse.data) + && Objects.equals(this.next, swapProvidersPaginatedResponse.next); + } + + @Override + public int hashCode() { + return Objects.hash(data, next); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapProvidersPaginatedResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add( + getData() + .get(i) + .toUrlQueryString( + String.format( + "%sdata%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + i, + containerSuffix)))); + } + } + } + + // add `next` to the URL query string + if (getNext() != null) { + joiner.add( + String.format( + "%snext%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getNext()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapRequiredAction.java b/src/main/java/com/fireblocks/sdk/model/SwapRequiredAction.java new file mode 100644 index 00000000..43fb5190 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapRequiredAction.java @@ -0,0 +1,262 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** SwapRequiredAction */ +@JsonPropertyOrder({ + SwapRequiredAction.JSON_PROPERTY_TYPE, + SwapRequiredAction.JSON_PROPERTY_STATUS, + SwapRequiredAction.JSON_PROPERTY_TX_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SwapRequiredAction { + public static final String JSON_PROPERTY_TYPE = "type"; + private SwapRequiredActionsEnum type; + + /** The status of the required action */ + public enum StatusEnum { + WAITING("WAITING"), + + PROCESSING("PROCESSING"), + + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + CANCELED("CANCELED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_TX_ID = "txId"; + private String txId; + + public SwapRequiredAction() {} + + public SwapRequiredAction type(SwapRequiredActionsEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SwapRequiredActionsEnum getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(SwapRequiredActionsEnum type) { + this.type = type; + } + + public SwapRequiredAction status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the required action + * + * @return status + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public SwapRequiredAction txId(String txId) { + this.txId = txId; + return this; + } + + /** + * The transaction id of the required action + * + * @return txId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TX_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTxId() { + return txId; + } + + @JsonProperty(JSON_PROPERTY_TX_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTxId(String txId) { + this.txId = txId; + } + + /** Return true if this SwapRequiredAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SwapRequiredAction swapRequiredAction = (SwapRequiredAction) o; + return Objects.equals(this.type, swapRequiredAction.type) + && Objects.equals(this.status, swapRequiredAction.status) + && Objects.equals(this.txId, swapRequiredAction.txId); + } + + @Override + public int hashCode() { + return Objects.hash(type, status, txId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SwapRequiredAction {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" txId: ").append(toIndentedString(txId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + joiner.add( + String.format( + "%stype%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add( + String.format( + "%sstatus%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `txId` to the URL query string + if (getTxId() != null) { + joiner.add( + String.format( + "%stxId%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getTxId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/SwapRequiredActionsEnum.java b/src/main/java/com/fireblocks/sdk/model/SwapRequiredActionsEnum.java new file mode 100644 index 00000000..15922f2b --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/SwapRequiredActionsEnum.java @@ -0,0 +1,66 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Gets or Sets SwapRequiredActionsEnum */ +public enum SwapRequiredActionsEnum { + APPROVE("APPROVE"), + + PERMIT("PERMIT"), + + CONTRACT_CALL("CONTRACT_CALL"); + + private String value; + + SwapRequiredActionsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SwapRequiredActionsEnum fromValue(String value) { + for (SwapRequiredActionsEnum b : SwapRequiredActionsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/WalletQuoteResponse.java b/src/main/java/com/fireblocks/sdk/model/WalletQuoteResponse.java new file mode 100644 index 00000000..3f1377e8 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/WalletQuoteResponse.java @@ -0,0 +1,621 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.UUID; + +/** Return a quote with id that can be used for swap operation. */ +@JsonPropertyOrder({ + WalletQuoteResponse.JSON_PROPERTY_PROTOCOL, + WalletQuoteResponse.JSON_PROPERTY_INPUT_AMOUNT, + WalletQuoteResponse.JSON_PROPERTY_INPUT_ASSET, + WalletQuoteResponse.JSON_PROPERTY_SLIPPAGE_TOLERANCE, + WalletQuoteResponse.JSON_PROPERTY_OUTPUT_MIN_AMOUNT, + WalletQuoteResponse.JSON_PROPERTY_OUTPUT_MAX_AMOUNT, + WalletQuoteResponse.JSON_PROPERTY_OUTPUT_ASSET, + WalletQuoteResponse.JSON_PROPERTY_ADDITIONAL_DATA, + WalletQuoteResponse.JSON_PROPERTY_PROVIDER_QUOTE_ID, + WalletQuoteResponse.JSON_PROPERTY_EXPIRED_AT, + WalletQuoteResponse.JSON_PROPERTY_REQUIRED_ACTIONS, + WalletQuoteResponse.JSON_PROPERTY_ESTIMATED_FEES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WalletQuoteResponse { + public static final String JSON_PROPERTY_PROTOCOL = "protocol"; + private SwapProviderProtocolsEnum protocol; + + public static final String JSON_PROPERTY_INPUT_AMOUNT = "inputAmount"; + private String inputAmount; + + public static final String JSON_PROPERTY_INPUT_ASSET = "inputAsset"; + private String inputAsset; + + public static final String JSON_PROPERTY_SLIPPAGE_TOLERANCE = "slippageTolerance"; + private BigDecimal slippageTolerance; + + public static final String JSON_PROPERTY_OUTPUT_MIN_AMOUNT = "outputMinAmount"; + private String outputMinAmount; + + public static final String JSON_PROPERTY_OUTPUT_MAX_AMOUNT = "outputMaxAmount"; + private String outputMaxAmount; + + public static final String JSON_PROPERTY_OUTPUT_ASSET = "outputAsset"; + private String outputAsset; + + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; + private ProviderAdditionalData additionalData; + + public static final String JSON_PROPERTY_PROVIDER_QUOTE_ID = "providerQuoteId"; + private UUID providerQuoteId; + + public static final String JSON_PROPERTY_EXPIRED_AT = "expiredAt"; + private OffsetDateTime expiredAt; + + public static final String JSON_PROPERTY_REQUIRED_ACTIONS = "requiredActions"; + private List requiredActions = new ArrayList<>(); + + public static final String JSON_PROPERTY_ESTIMATED_FEES = "estimatedFees"; + private QuoteFee estimatedFees; + + public WalletQuoteResponse() {} + + public WalletQuoteResponse protocol(SwapProviderProtocolsEnum protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SwapProviderProtocolsEnum getProtocol() { + return protocol; + } + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProtocol(SwapProviderProtocolsEnum protocol) { + this.protocol = protocol; + } + + public WalletQuoteResponse inputAmount(String inputAmount) { + this.inputAmount = inputAmount; + return this; + } + + /** + * The amount of tokens the swapper will provide + * + * @return inputAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInputAmount() { + return inputAmount; + } + + @JsonProperty(JSON_PROPERTY_INPUT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputAmount(String inputAmount) { + this.inputAmount = inputAmount; + } + + public WalletQuoteResponse inputAsset(String inputAsset) { + this.inputAsset = inputAsset; + return this; + } + + /** + * The id of the asset the swapper will provide + * + * @return inputAsset + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInputAsset() { + return inputAsset; + } + + @JsonProperty(JSON_PROPERTY_INPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputAsset(String inputAsset) { + this.inputAsset = inputAsset; + } + + public WalletQuoteResponse slippageTolerance(BigDecimal slippageTolerance) { + this.slippageTolerance = slippageTolerance; + return this; + } + + /** + * The slippage tolerance is a percentage. The slippage tolerance is the maximum amount the + * price can change between the time the transaction is submitted and the time it is executed + * + * @return slippageTolerance + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SLIPPAGE_TOLERANCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getSlippageTolerance() { + return slippageTolerance; + } + + @JsonProperty(JSON_PROPERTY_SLIPPAGE_TOLERANCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSlippageTolerance(BigDecimal slippageTolerance) { + this.slippageTolerance = slippageTolerance; + } + + public WalletQuoteResponse outputMinAmount(String outputMinAmount) { + this.outputMinAmount = outputMinAmount; + return this; + } + + /** + * The minimum amount of tokens the swapper will receive + * + * @return outputMinAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_MIN_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputMinAmount() { + return outputMinAmount; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_MIN_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputMinAmount(String outputMinAmount) { + this.outputMinAmount = outputMinAmount; + } + + public WalletQuoteResponse outputMaxAmount(String outputMaxAmount) { + this.outputMaxAmount = outputMaxAmount; + return this; + } + + /** + * Maximum amount of tokens that the swapper will receive + * + * @return outputMaxAmount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_MAX_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputMaxAmount() { + return outputMaxAmount; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_MAX_AMOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputMaxAmount(String outputMaxAmount) { + this.outputMaxAmount = outputMaxAmount; + } + + public WalletQuoteResponse outputAsset(String outputAsset) { + this.outputAsset = outputAsset; + return this; + } + + /** + * The id of the asset the swapper will receive + * + * @return outputAsset + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OUTPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOutputAsset() { + return outputAsset; + } + + @JsonProperty(JSON_PROPERTY_OUTPUT_ASSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputAsset(String outputAsset) { + this.outputAsset = outputAsset; + } + + public WalletQuoteResponse additionalData(ProviderAdditionalData additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Get additionalData + * + * @return additionalData + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProviderAdditionalData getAdditionalData() { + return additionalData; + } + + @JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAdditionalData(ProviderAdditionalData additionalData) { + this.additionalData = additionalData; + } + + public WalletQuoteResponse providerQuoteId(UUID providerQuoteId) { + this.providerQuoteId = providerQuoteId; + return this; + } + + /** + * An identifier that uniquely identifies the received quote + * + * @return providerQuoteId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROVIDER_QUOTE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getProviderQuoteId() { + return providerQuoteId; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_QUOTE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProviderQuoteId(UUID providerQuoteId) { + this.providerQuoteId = providerQuoteId; + } + + public WalletQuoteResponse expiredAt(OffsetDateTime expiredAt) { + this.expiredAt = expiredAt; + return this; + } + + /** + * When was the received `providerQuoteId` is expired (ISO Date time). + * + * @return expiredAt + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EXPIRED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getExpiredAt() { + return expiredAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setExpiredAt(OffsetDateTime expiredAt) { + this.expiredAt = expiredAt; + } + + public WalletQuoteResponse requiredActions(List requiredActions) { + this.requiredActions = requiredActions; + return this; + } + + public WalletQuoteResponse addRequiredActionsItem(SwapRequiredActionsEnum requiredActionsItem) { + if (this.requiredActions == null) { + this.requiredActions = new ArrayList<>(); + } + this.requiredActions.add(requiredActionsItem); + return this; + } + + /** + * The required actions for completing a swap operation + * + * @return requiredActions + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUIRED_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRequiredActions() { + return requiredActions; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequiredActions(List requiredActions) { + this.requiredActions = requiredActions; + } + + public WalletQuoteResponse estimatedFees(QuoteFee estimatedFees) { + this.estimatedFees = estimatedFees; + return this; + } + + /** + * Get estimatedFees + * + * @return estimatedFees + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ESTIMATED_FEES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public QuoteFee getEstimatedFees() { + return estimatedFees; + } + + @JsonProperty(JSON_PROPERTY_ESTIMATED_FEES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEstimatedFees(QuoteFee estimatedFees) { + this.estimatedFees = estimatedFees; + } + + /** Return true if this WalletQuoteResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WalletQuoteResponse walletQuoteResponse = (WalletQuoteResponse) o; + return Objects.equals(this.protocol, walletQuoteResponse.protocol) + && Objects.equals(this.inputAmount, walletQuoteResponse.inputAmount) + && Objects.equals(this.inputAsset, walletQuoteResponse.inputAsset) + && Objects.equals(this.slippageTolerance, walletQuoteResponse.slippageTolerance) + && Objects.equals(this.outputMinAmount, walletQuoteResponse.outputMinAmount) + && Objects.equals(this.outputMaxAmount, walletQuoteResponse.outputMaxAmount) + && Objects.equals(this.outputAsset, walletQuoteResponse.outputAsset) + && Objects.equals(this.additionalData, walletQuoteResponse.additionalData) + && Objects.equals(this.providerQuoteId, walletQuoteResponse.providerQuoteId) + && Objects.equals(this.expiredAt, walletQuoteResponse.expiredAt) + && Objects.equals(this.requiredActions, walletQuoteResponse.requiredActions) + && Objects.equals(this.estimatedFees, walletQuoteResponse.estimatedFees); + } + + @Override + public int hashCode() { + return Objects.hash( + protocol, + inputAmount, + inputAsset, + slippageTolerance, + outputMinAmount, + outputMaxAmount, + outputAsset, + additionalData, + providerQuoteId, + expiredAt, + requiredActions, + estimatedFees); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WalletQuoteResponse {\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" inputAsset: ").append(toIndentedString(inputAsset)).append("\n"); + sb.append(" slippageTolerance: ") + .append(toIndentedString(slippageTolerance)) + .append("\n"); + sb.append(" outputMinAmount: ").append(toIndentedString(outputMinAmount)).append("\n"); + sb.append(" outputMaxAmount: ").append(toIndentedString(outputMaxAmount)).append("\n"); + sb.append(" outputAsset: ").append(toIndentedString(outputAsset)).append("\n"); + sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); + sb.append(" providerQuoteId: ").append(toIndentedString(providerQuoteId)).append("\n"); + sb.append(" expiredAt: ").append(toIndentedString(expiredAt)).append("\n"); + sb.append(" requiredActions: ").append(toIndentedString(requiredActions)).append("\n"); + sb.append(" estimatedFees: ").append(toIndentedString(estimatedFees)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `protocol` to the URL query string + if (getProtocol() != null) { + joiner.add( + String.format( + "%sprotocol%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getProtocol()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `inputAmount` to the URL query string + if (getInputAmount() != null) { + joiner.add( + String.format( + "%sinputAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getInputAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `inputAsset` to the URL query string + if (getInputAsset() != null) { + joiner.add( + String.format( + "%sinputAsset%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getInputAsset()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `slippageTolerance` to the URL query string + if (getSlippageTolerance() != null) { + joiner.add( + String.format( + "%sslippageTolerance%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSlippageTolerance()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputMinAmount` to the URL query string + if (getOutputMinAmount() != null) { + joiner.add( + String.format( + "%soutputMinAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputMinAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputMaxAmount` to the URL query string + if (getOutputMaxAmount() != null) { + joiner.add( + String.format( + "%soutputMaxAmount%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputMaxAmount()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outputAsset` to the URL query string + if (getOutputAsset() != null) { + joiner.add( + String.format( + "%soutputAsset%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOutputAsset()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `additionalData` to the URL query string + if (getAdditionalData() != null) { + joiner.add(getAdditionalData().toUrlQueryString(prefix + "additionalData" + suffix)); + } + + // add `providerQuoteId` to the URL query string + if (getProviderQuoteId() != null) { + joiner.add( + String.format( + "%sproviderQuoteId%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getProviderQuoteId()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `expiredAt` to the URL query string + if (getExpiredAt() != null) { + joiner.add( + String.format( + "%sexpiredAt%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getExpiredAt()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `requiredActions` to the URL query string + if (getRequiredActions() != null) { + for (int i = 0; i < getRequiredActions().size(); i++) { + if (getRequiredActions().get(i) != null) { + joiner.add( + String.format( + "%srequiredActions%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getRequiredActions().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + } + + // add `estimatedFees` to the URL query string + if (getEstimatedFees() != null) { + joiner.add(getEstimatedFees().toUrlQueryString(prefix + "estimatedFees" + suffix)); + } + + return joiner.toString(); + } +} diff --git a/src/test/java/com/fireblocks/sdk/FireblocksTest.java b/src/test/java/com/fireblocks/sdk/FireblocksTest.java index aa60672b..c33dee55 100644 --- a/src/test/java/com/fireblocks/sdk/FireblocksTest.java +++ b/src/test/java/com/fireblocks/sdk/FireblocksTest.java @@ -597,6 +597,14 @@ public void testGetStakingApi() { Assert.assertSame(staking, fireblocks.staking()); } + @Test + public void testGetSwapBetaApi() { + setupFireblocks(true, null, null); + SwapBetaApi swapBeta = fireblocks.swapBeta(); + Assert.assertNotNull(swapBeta); + Assert.assertSame(swapBeta, fireblocks.swapBeta()); + } + @Test public void testGetTokenizationApi() { setupFireblocks(true, null, null); diff --git a/src/test/java/com/fireblocks/sdk/api/StakingApiTest.java b/src/test/java/com/fireblocks/sdk/api/StakingApiTest.java index 8b6974c5..29c6999b 100644 --- a/src/test/java/com/fireblocks/sdk/api/StakingApiTest.java +++ b/src/test/java/com/fireblocks/sdk/api/StakingApiTest.java @@ -172,9 +172,10 @@ public void getSummaryByVaultTest() throws ApiException { } /** - * Execute a Merge operation on SOL/SOL_TEST stake accounts + * Merge Solana on stake accounts * - *

Perform a Solana Merge of two active stake accounts into one. + *

Perform a Solana Merge of two active stake accounts into one. Endpoint Permission: Owner, + * Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * * @throws ApiException if the Api call fails */ diff --git a/src/test/java/com/fireblocks/sdk/api/SwapBetaApiTest.java b/src/test/java/com/fireblocks/sdk/api/SwapBetaApiTest.java new file mode 100644 index 00000000..ae39233f --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/api/SwapBetaApiTest.java @@ -0,0 +1,149 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.api; + + +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.model.QuoteRequest; +import com.fireblocks.sdk.model.QuoteResponse; +import com.fireblocks.sdk.model.SwapOperation; +import com.fireblocks.sdk.model.SwapOperationRequest; +import com.fireblocks.sdk.model.SwapOperationsPaginatedResponse; +import com.fireblocks.sdk.model.SwapProvider; +import com.fireblocks.sdk.model.SwapProvidersPaginatedResponse; +import java.math.BigDecimal; +import java.util.concurrent.CompletableFuture; +import org.junit.Ignore; +import org.junit.Test; + +/** API tests for SwapBetaApi */ +@Ignore +public class SwapBetaApiTest { + + private final SwapBetaApi api = new SwapBetaApi(); + + /** + * Approve terms of service + * + *

Approve the terms of service for a swap provider. Some providers require this approval + * before performing a swap action for the first time. Note: These endpoints are currently in + * beta and might be subject to changes. If you want to participate and learn more about the + * Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email + * to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. + * + * @throws ApiException if the Api call fails + */ + @Test + public void approveTermsOfServiceTest() throws ApiException { + String providerId = null; + String idempotencyKey = null; + CompletableFuture> response = + api.approveTermsOfService(providerId, idempotencyKey); + } + + /** + * Create a quote + * + *

Create a quote from specific swap provider. Note: These endpoints are currently in beta + * and might be subject to changes. If you want to participate and learn more about the + * Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email + * to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, + * Approver, Editor, Viewer. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createQuoteTest() throws ApiException { + QuoteRequest quoteRequest = null; + String providerId = null; + String idempotencyKey = null; + CompletableFuture> response = + api.createQuote(quoteRequest, providerId, idempotencyKey); + } + + /** + * Create swap operation + * + *

Create swap operation based on a provided quote Id Note: These endpoints are currently in + * beta and might be subject to changes. If you want to participate and learn more about the + * Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email + * to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createSwapOperationTest() throws ApiException { + SwapOperationRequest swapOperationRequest = null; + String idempotencyKey = null; + CompletableFuture> response = + api.createSwapOperation(swapOperationRequest, idempotencyKey); + } + + /** + * Get operation details + * + *

Get swap operation Details by ID. Note:These endpoints are currently in beta and might be + * subject to changes. If you want to participate and learn more about the Fireblocks Swap, + * please contact your Fireblocks Customer Success Manager or send an email + * to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, + * Approver, Editor, Viewer. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSwapOperationByIdTest() throws ApiException { + String operationId = null; + CompletableFuture> response = + api.getSwapOperationById(operationId); + } + + /** + * Get Operations list + * + *

Return a list of swap operations for the specific workspace The operations are sorted by + * creation date in descending order, meaning the most recent operation appears first. + * Note:These endpoints are currently in beta and might be subject to changes. If you want to + * participate and learn more about the Fireblocks TAP, please contact your Fireblocks Customer + * Success Manager or send an email to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, + * Non-Signing Admin, Signer, Approver, Editor, Viewer. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSwapOperationsTest() throws ApiException { + String pageCursor = null; + BigDecimal pageSize = null; + CompletableFuture> response = + api.getSwapOperations(pageCursor, pageSize); + } + + /** + * Get Providers List + * + *

Return a list of all supported swap providers. Note: These endpoints are currently in beta + * and might be subject to changes. If you want to participate and learn more about the + * Fireblocks Swap, please contact your Fireblocks Customer Success Manager or send an email + * to CSM@fireblocks.com. Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, + * Approver, Editor, Viewer. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSwapProvidersTest() throws ApiException { + String pageCursor = null; + BigDecimal pageSize = null; + CompletableFuture> response = + api.getSwapProviders(pageCursor, pageSize); + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/NonWalletQuoteFeeTest.java b/src/test/java/com/fireblocks/sdk/model/NonWalletQuoteFeeTest.java new file mode 100644 index 00000000..2e335332 --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/NonWalletQuoteFeeTest.java @@ -0,0 +1,57 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for NonWalletQuoteFee */ +public class NonWalletQuoteFeeTest { + private final NonWalletQuoteFee model = new NonWalletQuoteFee(); + + /** Model tests for NonWalletQuoteFee */ + @Test + public void testNonWalletQuoteFee() { + // TODO: test NonWalletQuoteFee + } + + /** Test the property 'networkExecutionFee' */ + @Test + public void networkExecutionFeeTest() { + // TODO: test networkExecutionFee + } + + /** Test the property 'networkFeeAssetId' */ + @Test + public void networkFeeAssetIdTest() { + // TODO: test networkFeeAssetId + } + + /** Test the property 'providerFee' */ + @Test + public void providerFeeTest() { + // TODO: test providerFee + } + + /** Test the property 'providerFeeAssetId' */ + @Test + public void providerFeeAssetIdTest() { + // TODO: test providerFeeAssetId + } + + /** Test the property 'providerFeeRate' */ + @Test + public void providerFeeRateTest() { + // TODO: test providerFeeRate + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/NonWalletQuoteResponseTest.java b/src/test/java/com/fireblocks/sdk/model/NonWalletQuoteResponseTest.java new file mode 100644 index 00000000..276455fc --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/NonWalletQuoteResponseTest.java @@ -0,0 +1,81 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for NonWalletQuoteResponse */ +public class NonWalletQuoteResponseTest { + private final NonWalletQuoteResponse model = new NonWalletQuoteResponse(); + + /** Model tests for NonWalletQuoteResponse */ + @Test + public void testNonWalletQuoteResponse() { + // TODO: test NonWalletQuoteResponse + } + + /** Test the property 'protocol' */ + @Test + public void protocolTest() { + // TODO: test protocol + } + + /** Test the property 'inputAmount' */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** Test the property 'inputAsset' */ + @Test + public void inputAssetTest() { + // TODO: test inputAsset + } + + /** Test the property 'slippageTolerance' */ + @Test + public void slippageToleranceTest() { + // TODO: test slippageTolerance + } + + /** Test the property 'outputMinAmount' */ + @Test + public void outputMinAmountTest() { + // TODO: test outputMinAmount + } + + /** Test the property 'outputMaxAmount' */ + @Test + public void outputMaxAmountTest() { + // TODO: test outputMaxAmount + } + + /** Test the property 'outputAsset' */ + @Test + public void outputAssetTest() { + // TODO: test outputAsset + } + + /** Test the property 'additionalData' */ + @Test + public void additionalDataTest() { + // TODO: test additionalData + } + + /** Test the property 'estimatedFees' */ + @Test + public void estimatedFeesTest() { + // TODO: test estimatedFees + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/ProviderAdditionalDataTest.java b/src/test/java/com/fireblocks/sdk/model/ProviderAdditionalDataTest.java new file mode 100644 index 00000000..97bd64cd --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/ProviderAdditionalDataTest.java @@ -0,0 +1,33 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for ProviderAdditionalData */ +public class ProviderAdditionalDataTest { + private final ProviderAdditionalData model = new ProviderAdditionalData(); + + /** Model tests for ProviderAdditionalData */ + @Test + public void testProviderAdditionalData() { + // TODO: test ProviderAdditionalData + } + + /** Test the property 'priceImpact' */ + @Test + public void priceImpactTest() { + // TODO: test priceImpact + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/ProviderCategoryEnumTest.java b/src/test/java/com/fireblocks/sdk/model/ProviderCategoryEnumTest.java new file mode 100644 index 00000000..798b2e6d --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/ProviderCategoryEnumTest.java @@ -0,0 +1,25 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for ProviderCategoryEnum */ +public class ProviderCategoryEnumTest { + /** Model tests for ProviderCategoryEnum */ + @Test + public void testProviderCategoryEnum() { + // TODO: test ProviderCategoryEnum + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/QuoteFeeTest.java b/src/test/java/com/fireblocks/sdk/model/QuoteFeeTest.java new file mode 100644 index 00000000..e4ba86f4 --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/QuoteFeeTest.java @@ -0,0 +1,63 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for QuoteFee */ +public class QuoteFeeTest { + private final QuoteFee model = new QuoteFee(); + + /** Model tests for QuoteFee */ + @Test + public void testQuoteFee() { + // TODO: test QuoteFee + } + + /** Test the property 'networkExecutionFee' */ + @Test + public void networkExecutionFeeTest() { + // TODO: test networkExecutionFee + } + + /** Test the property 'networkFeeAssetId' */ + @Test + public void networkFeeAssetIdTest() { + // TODO: test networkFeeAssetId + } + + /** Test the property 'providerFee' */ + @Test + public void providerFeeTest() { + // TODO: test providerFee + } + + /** Test the property 'providerFeeAssetId' */ + @Test + public void providerFeeAssetIdTest() { + // TODO: test providerFeeAssetId + } + + /** Test the property 'providerFeeRate' */ + @Test + public void providerFeeRateTest() { + // TODO: test providerFeeRate + } + + /** Test the property 'networkApproveFee' */ + @Test + public void networkApproveFeeTest() { + // TODO: test networkApproveFee + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/QuoteRequestTest.java b/src/test/java/com/fireblocks/sdk/model/QuoteRequestTest.java new file mode 100644 index 00000000..de2f71f2 --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/QuoteRequestTest.java @@ -0,0 +1,63 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for QuoteRequest */ +public class QuoteRequestTest { + private final QuoteRequest model = new QuoteRequest(); + + /** Model tests for QuoteRequest */ + @Test + public void testQuoteRequest() { + // TODO: test QuoteRequest + } + + /** Test the property 'accountId' */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** Test the property 'inputAmount' */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** Test the property 'inputAsset' */ + @Test + public void inputAssetTest() { + // TODO: test inputAsset + } + + /** Test the property 'outputAsset' */ + @Test + public void outputAssetTest() { + // TODO: test outputAsset + } + + /** Test the property 'slippageTolerance' */ + @Test + public void slippageToleranceTest() { + // TODO: test slippageTolerance + } + + /** Test the property 'protocol' */ + @Test + public void protocolTest() { + // TODO: test protocol + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/QuoteResponseTest.java b/src/test/java/com/fireblocks/sdk/model/QuoteResponseTest.java new file mode 100644 index 00000000..3e3f25ed --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/QuoteResponseTest.java @@ -0,0 +1,99 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for QuoteResponse */ +public class QuoteResponseTest { + private final QuoteResponse model = new QuoteResponse(); + + /** Model tests for QuoteResponse */ + @Test + public void testQuoteResponse() { + // TODO: test QuoteResponse + } + + /** Test the property 'protocol' */ + @Test + public void protocolTest() { + // TODO: test protocol + } + + /** Test the property 'inputAmount' */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** Test the property 'inputAsset' */ + @Test + public void inputAssetTest() { + // TODO: test inputAsset + } + + /** Test the property 'slippageTolerance' */ + @Test + public void slippageToleranceTest() { + // TODO: test slippageTolerance + } + + /** Test the property 'outputMinAmount' */ + @Test + public void outputMinAmountTest() { + // TODO: test outputMinAmount + } + + /** Test the property 'outputMaxAmount' */ + @Test + public void outputMaxAmountTest() { + // TODO: test outputMaxAmount + } + + /** Test the property 'outputAsset' */ + @Test + public void outputAssetTest() { + // TODO: test outputAsset + } + + /** Test the property 'additionalData' */ + @Test + public void additionalDataTest() { + // TODO: test additionalData + } + + /** Test the property 'providerQuoteId' */ + @Test + public void providerQuoteIdTest() { + // TODO: test providerQuoteId + } + + /** Test the property 'expiredAt' */ + @Test + public void expiredAtTest() { + // TODO: test expiredAt + } + + /** Test the property 'requiredActions' */ + @Test + public void requiredActionsTest() { + // TODO: test requiredActions + } + + /** Test the property 'estimatedFees' */ + @Test + public void estimatedFeesTest() { + // TODO: test estimatedFees + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapFlowErrorTest.java b/src/test/java/com/fireblocks/sdk/model/SwapFlowErrorTest.java new file mode 100644 index 00000000..a7250137 --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapFlowErrorTest.java @@ -0,0 +1,39 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapFlowError */ +public class SwapFlowErrorTest { + private final SwapFlowError model = new SwapFlowError(); + + /** Model tests for SwapFlowError */ + @Test + public void testSwapFlowError() { + // TODO: test SwapFlowError + } + + /** Test the property 'code' */ + @Test + public void codeTest() { + // TODO: test code + } + + /** Test the property 'message' */ + @Test + public void messageTest() { + // TODO: test message + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapOperationRequestTest.java b/src/test/java/com/fireblocks/sdk/model/SwapOperationRequestTest.java new file mode 100644 index 00000000..6bbffe7b --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapOperationRequestTest.java @@ -0,0 +1,45 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapOperationRequest */ +public class SwapOperationRequestTest { + private final SwapOperationRequest model = new SwapOperationRequest(); + + /** Model tests for SwapOperationRequest */ + @Test + public void testSwapOperationRequest() { + // TODO: test SwapOperationRequest + } + + /** Test the property 'providerQuoteId' */ + @Test + public void providerQuoteIdTest() { + // TODO: test providerQuoteId + } + + /** Test the property 'feeLevel' */ + @Test + public void feeLevelTest() { + // TODO: test feeLevel + } + + /** Test the property 'txNote' */ + @Test + public void txNoteTest() { + // TODO: test txNote + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapOperationTest.java b/src/test/java/com/fireblocks/sdk/model/SwapOperationTest.java new file mode 100644 index 00000000..99c2999e --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapOperationTest.java @@ -0,0 +1,135 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapOperation */ +public class SwapOperationTest { + private final SwapOperation model = new SwapOperation(); + + /** Model tests for SwapOperation */ + @Test + public void testSwapOperation() { + // TODO: test SwapOperation + } + + /** Test the property 'id' */ + @Test + public void idTest() { + // TODO: test id + } + + /** Test the property 'accountId' */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** Test the property 'providerId' */ + @Test + public void providerIdTest() { + // TODO: test providerId + } + + /** Test the property 'category' */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** Test the property 'protocol' */ + @Test + public void protocolTest() { + // TODO: test protocol + } + + /** Test the property 'status' */ + @Test + public void statusTest() { + // TODO: test status + } + + /** Test the property 'inputAmount' */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** Test the property 'inputAsset' */ + @Test + public void inputAssetTest() { + // TODO: test inputAsset + } + + /** Test the property 'slippageTolerance' */ + @Test + public void slippageToleranceTest() { + // TODO: test slippageTolerance + } + + /** Test the property 'outputMinAmount' */ + @Test + public void outputMinAmountTest() { + // TODO: test outputMinAmount + } + + /** Test the property 'outputMaxAmount' */ + @Test + public void outputMaxAmountTest() { + // TODO: test outputMaxAmount + } + + /** Test the property 'outputAsset' */ + @Test + public void outputAssetTest() { + // TODO: test outputAsset + } + + /** Test the property 'outputFinalAmount' */ + @Test + public void outputFinalAmountTest() { + // TODO: test outputFinalAmount + } + + /** Test the property 'requiredActions' */ + @Test + public void requiredActionsTest() { + // TODO: test requiredActions + } + + /** Test the property 'error' */ + @Test + public void errorTest() { + // TODO: test error + } + + /** Test the property 'createdAt' */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** Test the property 'updatedAt' */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** Test the property 'createdBy' */ + @Test + public void createdByTest() { + // TODO: test createdBy + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapOperationsPaginatedResponseTest.java b/src/test/java/com/fireblocks/sdk/model/SwapOperationsPaginatedResponseTest.java new file mode 100644 index 00000000..07935d6b --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapOperationsPaginatedResponseTest.java @@ -0,0 +1,39 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapOperationsPaginatedResponse */ +public class SwapOperationsPaginatedResponseTest { + private final SwapOperationsPaginatedResponse model = new SwapOperationsPaginatedResponse(); + + /** Model tests for SwapOperationsPaginatedResponse */ + @Test + public void testSwapOperationsPaginatedResponse() { + // TODO: test SwapOperationsPaginatedResponse + } + + /** Test the property 'data' */ + @Test + public void dataTest() { + // TODO: test data + } + + /** Test the property 'next' */ + @Test + public void nextTest() { + // TODO: test next + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapProviderProtocolsEnumTest.java b/src/test/java/com/fireblocks/sdk/model/SwapProviderProtocolsEnumTest.java new file mode 100644 index 00000000..d9bb7c6b --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapProviderProtocolsEnumTest.java @@ -0,0 +1,25 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapProviderProtocolsEnum */ +public class SwapProviderProtocolsEnumTest { + /** Model tests for SwapProviderProtocolsEnum */ + @Test + public void testSwapProviderProtocolsEnum() { + // TODO: test SwapProviderProtocolsEnum + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapProviderTest.java b/src/test/java/com/fireblocks/sdk/model/SwapProviderTest.java new file mode 100644 index 00000000..d8e8a60b --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapProviderTest.java @@ -0,0 +1,69 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapProvider */ +public class SwapProviderTest { + private final SwapProvider model = new SwapProvider(); + + /** Model tests for SwapProvider */ + @Test + public void testSwapProvider() { + // TODO: test SwapProvider + } + + /** Test the property 'id' */ + @Test + public void idTest() { + // TODO: test id + } + + /** Test the property 'name' */ + @Test + public void nameTest() { + // TODO: test name + } + + /** Test the property 'protocols' */ + @Test + public void protocolsTest() { + // TODO: test protocols + } + + /** Test the property 'category' */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** Test the property 'isTermsApprovalRequired' */ + @Test + public void isTermsApprovalRequiredTest() { + // TODO: test isTermsApprovalRequired + } + + /** Test the property 'termsOfServiceUrl' */ + @Test + public void termsOfServiceUrlTest() { + // TODO: test termsOfServiceUrl + } + + /** Test the property 'isTermsOfServiceApproved' */ + @Test + public void isTermsOfServiceApprovedTest() { + // TODO: test isTermsOfServiceApproved + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapProvidersPaginatedResponseTest.java b/src/test/java/com/fireblocks/sdk/model/SwapProvidersPaginatedResponseTest.java new file mode 100644 index 00000000..15f5b4e5 --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapProvidersPaginatedResponseTest.java @@ -0,0 +1,39 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapProvidersPaginatedResponse */ +public class SwapProvidersPaginatedResponseTest { + private final SwapProvidersPaginatedResponse model = new SwapProvidersPaginatedResponse(); + + /** Model tests for SwapProvidersPaginatedResponse */ + @Test + public void testSwapProvidersPaginatedResponse() { + // TODO: test SwapProvidersPaginatedResponse + } + + /** Test the property 'data' */ + @Test + public void dataTest() { + // TODO: test data + } + + /** Test the property 'next' */ + @Test + public void nextTest() { + // TODO: test next + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapRequiredActionTest.java b/src/test/java/com/fireblocks/sdk/model/SwapRequiredActionTest.java new file mode 100644 index 00000000..e745250e --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapRequiredActionTest.java @@ -0,0 +1,45 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapRequiredAction */ +public class SwapRequiredActionTest { + private final SwapRequiredAction model = new SwapRequiredAction(); + + /** Model tests for SwapRequiredAction */ + @Test + public void testSwapRequiredAction() { + // TODO: test SwapRequiredAction + } + + /** Test the property 'type' */ + @Test + public void typeTest() { + // TODO: test type + } + + /** Test the property 'status' */ + @Test + public void statusTest() { + // TODO: test status + } + + /** Test the property 'txId' */ + @Test + public void txIdTest() { + // TODO: test txId + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/SwapRequiredActionsEnumTest.java b/src/test/java/com/fireblocks/sdk/model/SwapRequiredActionsEnumTest.java new file mode 100644 index 00000000..65c74772 --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/SwapRequiredActionsEnumTest.java @@ -0,0 +1,25 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for SwapRequiredActionsEnum */ +public class SwapRequiredActionsEnumTest { + /** Model tests for SwapRequiredActionsEnum */ + @Test + public void testSwapRequiredActionsEnum() { + // TODO: test SwapRequiredActionsEnum + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/WalletQuoteResponseTest.java b/src/test/java/com/fireblocks/sdk/model/WalletQuoteResponseTest.java new file mode 100644 index 00000000..d632a5a3 --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/WalletQuoteResponseTest.java @@ -0,0 +1,99 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * 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.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for WalletQuoteResponse */ +public class WalletQuoteResponseTest { + private final WalletQuoteResponse model = new WalletQuoteResponse(); + + /** Model tests for WalletQuoteResponse */ + @Test + public void testWalletQuoteResponse() { + // TODO: test WalletQuoteResponse + } + + /** Test the property 'protocol' */ + @Test + public void protocolTest() { + // TODO: test protocol + } + + /** Test the property 'inputAmount' */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** Test the property 'inputAsset' */ + @Test + public void inputAssetTest() { + // TODO: test inputAsset + } + + /** Test the property 'slippageTolerance' */ + @Test + public void slippageToleranceTest() { + // TODO: test slippageTolerance + } + + /** Test the property 'outputMinAmount' */ + @Test + public void outputMinAmountTest() { + // TODO: test outputMinAmount + } + + /** Test the property 'outputMaxAmount' */ + @Test + public void outputMaxAmountTest() { + // TODO: test outputMaxAmount + } + + /** Test the property 'outputAsset' */ + @Test + public void outputAssetTest() { + // TODO: test outputAsset + } + + /** Test the property 'additionalData' */ + @Test + public void additionalDataTest() { + // TODO: test additionalData + } + + /** Test the property 'providerQuoteId' */ + @Test + public void providerQuoteIdTest() { + // TODO: test providerQuoteId + } + + /** Test the property 'expiredAt' */ + @Test + public void expiredAtTest() { + // TODO: test expiredAt + } + + /** Test the property 'requiredActions' */ + @Test + public void requiredActionsTest() { + // TODO: test requiredActions + } + + /** Test the property 'estimatedFees' */ + @Test + public void estimatedFeesTest() { + // TODO: test estimatedFees + } +}