diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index b6298383..8818fe61 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -197,6 +197,7 @@ docs/CallAccepted.md docs/CallbackHandler.md docs/CallbackHandlerRequest.md docs/CancelTransactionResponse.md +docs/CantonBetaApi.md docs/CantonCall.md docs/CantonCallAllowListAdd.md docs/CantonCallAllowListRemove.md @@ -1416,6 +1417,7 @@ src/main/java/com/fireblocks/sdk/api/ApprovalsBetaApi.java src/main/java/com/fireblocks/sdk/api/AuditLogsApi.java src/main/java/com/fireblocks/sdk/api/BlockchainLinkBetaApi.java src/main/java/com/fireblocks/sdk/api/BlockchainsAssetsApi.java +src/main/java/com/fireblocks/sdk/api/CantonBetaApi.java src/main/java/com/fireblocks/sdk/api/ComplianceApi.java src/main/java/com/fireblocks/sdk/api/ComplianceOrchestratorBetaApi.java src/main/java/com/fireblocks/sdk/api/ComplianceScreeningConfigurationApi.java @@ -2799,6 +2801,7 @@ src/test/java/com/fireblocks/sdk/api/ApprovalsBetaApiTest.java src/test/java/com/fireblocks/sdk/api/AuditLogsApiTest.java src/test/java/com/fireblocks/sdk/api/BlockchainLinkBetaApiTest.java src/test/java/com/fireblocks/sdk/api/BlockchainsAssetsApiTest.java +src/test/java/com/fireblocks/sdk/api/CantonBetaApiTest.java src/test/java/com/fireblocks/sdk/api/ComplianceApiTest.java src/test/java/com/fireblocks/sdk/api/ComplianceOrchestratorBetaApiTest.java src/test/java/com/fireblocks/sdk/api/ComplianceScreeningConfigurationApiTest.java diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 5a359479..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,239 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v35.0.0](https://github.com/fireblocks/java-sdk/compare/v15.0.0...v35.0.0) - 2026-10-13 - -### Merged - -- Generated SDK #2941386800 [`#161`](https://github.com/fireblocks/java-sdk/pull/161) - -## [v15.0.0](https://github.com/fireblocks/java-sdk/compare/v14.1.0...v15.0.0) - 2026-03-15 - -### Merged - -- Generated SDK #3733 (major) [`#128`](https://github.com/fireblocks/java-sdk/pull/128) - -## [v14.1.0](https://github.com/fireblocks/java-sdk/compare/v14.0.0...v14.1.0) - 2026-02-26 - -### Merged - -- Generated SDK #2167 [`#126`](https://github.com/fireblocks/java-sdk/pull/126) - -## [v14.0.0](https://github.com/fireblocks/java-sdk/compare/v13.0.0...v14.0.0) - 2026-02-03 - -### Merged - -- Generated SDK #4746 [`#121`](https://github.com/fireblocks/java-sdk/pull/121) - -## [v13.0.0](https://github.com/fireblocks/java-sdk/compare/v12.1.3...v13.0.0) - 2025-11-13 - -### Merged - -- Generated SDK #5834 [`#116`](https://github.com/fireblocks/java-sdk/pull/116) - -## [v12.1.3](https://github.com/fireblocks/java-sdk/compare/v12.1.2...v12.1.3) - 2025-10-22 - -### Merged - -- Generated SDK #8293 [`#115`](https://github.com/fireblocks/java-sdk/pull/115) - -## [v12.1.2](https://github.com/fireblocks/java-sdk/compare/v12.1.1...v12.1.2) - 2025-09-29 - -### Merged - -- Generated SDK #6061 [`#113`](https://github.com/fireblocks/java-sdk/pull/113) - -## [v12.1.1](https://github.com/fireblocks/java-sdk/compare/v12.1.0...v12.1.1) - 2025-09-10 - -### Merged - -- Generated SDK #1410 [`#111`](https://github.com/fireblocks/java-sdk/pull/111) - -## [v12.1.0](https://github.com/fireblocks/java-sdk/compare/v12.0.0...v12.1.0) - 2025-09-09 - -### Merged - -- Generated SDK #4521 [`#109`](https://github.com/fireblocks/java-sdk/pull/109) - -## [v12.0.0](https://github.com/fireblocks/java-sdk/compare/v11.2.0...v12.0.0) - 2025-09-01 - -### Merged - -- Generated SDK #7741 [`#108`](https://github.com/fireblocks/java-sdk/pull/108) - -## [v11.2.0](https://github.com/fireblocks/java-sdk/compare/v11.1.0...v11.2.0) - 2025-08-21 - -### Merged - -- Generated SDK #3302 [`#107`](https://github.com/fireblocks/java-sdk/pull/107) - -## [v11.1.0](https://github.com/fireblocks/java-sdk/compare/v11.0.0...v11.1.0) - 2025-08-11 - -### Merged - -- Generated SDK #1782 [`#105`](https://github.com/fireblocks/java-sdk/pull/105) - -## [v11.0.0](https://github.com/fireblocks/java-sdk/compare/v10.4.0...v11.0.0) - 2025-07-15 - -### Merged - -- Generated SDK #5610 [`#103`](https://github.com/fireblocks/java-sdk/pull/103) - -## [v10.4.0](https://github.com/fireblocks/java-sdk/compare/v10.3.0...v10.4.0) - 2025-06-29 - -### Merged - -- Generated SDK #1492 [`#101`](https://github.com/fireblocks/java-sdk/pull/101) - -## [v10.3.0](https://github.com/fireblocks/java-sdk/compare/v10.2.0...v10.3.0) - 2025-06-18 - -### Merged - -- Generated SDK #4009 [`#99`](https://github.com/fireblocks/java-sdk/pull/99) - -## [v10.2.0](https://github.com/fireblocks/java-sdk/compare/v10.1.1...v10.2.0) - 2025-06-04 - -### Merged - -- Generated SDK #8912 [`#98`](https://github.com/fireblocks/java-sdk/pull/98) - -## [v10.1.1](https://github.com/fireblocks/java-sdk/compare/v10.1.0...v10.1.1) - 2025-05-18 - -### Merged - -- Generated SDK #5019 [`#97`](https://github.com/fireblocks/java-sdk/pull/97) - -## [v10.1.0](https://github.com/fireblocks/java-sdk/compare/v10.0.2...v10.1.0) - 2025-05-07 - -### Merged - -- Generated SDK #7076 [`#95`](https://github.com/fireblocks/java-sdk/pull/95) - -## [v10.0.2](https://github.com/fireblocks/java-sdk/compare/v10.0.1...v10.0.2) - 2025-04-20 - -### Merged - -- Generated SDK #4794 [`#94`](https://github.com/fireblocks/java-sdk/pull/94) - -## [v10.0.1](https://github.com/fireblocks/java-sdk/compare/v10.0.0...v10.0.1) - 2025-04-07 - -### Merged - -- Generated SDK #3065 [`#93`](https://github.com/fireblocks/java-sdk/pull/93) - -## [v10.0.0](https://github.com/fireblocks/java-sdk/compare/v9.0.0...v10.0.0) - 2025-03-30 - -### Merged - -- Generated SDK #619 [`#90`](https://github.com/fireblocks/java-sdk/pull/90) - -## [v9.0.0](https://github.com/fireblocks/java-sdk/compare/v8.1.0...v9.0.0) - 2025-03-17 - -### Merged - -- Generated SDK #645 [`#89`](https://github.com/fireblocks/java-sdk/pull/89) - -## [v8.1.0](https://github.com/fireblocks/java-sdk/compare/v8.0.1...v8.1.0) - 2025-02-24 - -### Merged - -- Generated SDK #9833 [`#84`](https://github.com/fireblocks/java-sdk/pull/84) - -## [v8.0.1](https://github.com/fireblocks/java-sdk/compare/v8.0.0...v8.0.1) - 2025-02-12 - -### Merged - -- Generated SDK #4262 [`#82`](https://github.com/fireblocks/java-sdk/pull/82) - -## [v8.0.0](https://github.com/fireblocks/java-sdk/compare/v7.0.0...v8.0.0) - 2025-02-02 - -### Merged - -- Generated SDK #538 [`#80`](https://github.com/fireblocks/java-sdk/pull/80) - -## [v7.0.0](https://github.com/fireblocks/java-sdk/compare/v6.0.0...v7.0.0) - 2025-01-08 - -### Merged - -- Generated SDK #8699 [`#77`](https://github.com/fireblocks/java-sdk/pull/77) - -## [v6.0.0](https://github.com/fireblocks/java-sdk/compare/v5.0.0...v6.0.0) - 2024-12-05 - -### Merged - -- Generated SDK #1430 [`#73`](https://github.com/fireblocks/java-sdk/pull/73) - -## [v5.0.0](https://github.com/fireblocks/java-sdk/compare/v4.0.0...v5.0.0) - 2024-10-31 - -### Merged - -- Generated SDK #5184 [`#71`](https://github.com/fireblocks/java-sdk/pull/71) - -## [v4.0.0](https://github.com/fireblocks/java-sdk/compare/v3.1.0...v4.0.0) - 2024-09-17 - -### Merged - -- Generated SDK #237 [`#70`](https://github.com/fireblocks/java-sdk/pull/70) - -## [v3.1.0](https://github.com/fireblocks/java-sdk/compare/v3.0.0...v3.1.0) - 2024-07-25 - -### Merged - -- Generated SDK #6749 [`#67`](https://github.com/fireblocks/java-sdk/pull/67) - -## [v3.0.0](https://github.com/fireblocks/java-sdk/compare/v2.1.0...v3.0.0) - 2024-07-17 - -### Merged - -- Generated SDK #6152 [`#65`](https://github.com/fireblocks/java-sdk/pull/65) -- Generated SDK #7984 [`#62`](https://github.com/fireblocks/java-sdk/pull/62) -- Generated SDK #2873 [`#61`](https://github.com/fireblocks/java-sdk/pull/61) - -## [v2.1.0](https://github.com/fireblocks/java-sdk/compare/v2.0.1...v2.1.0) - 2024-06-04 - -### Merged - -- Generated SDK for version COR-46191/fix_pipelines [`#24`](https://github.com/fireblocks/java-sdk/pull/24) -- Generated SDK for version COR-46191/fix_pipelines [`#23`](https://github.com/fireblocks/java-sdk/pull/23) -- Generated SDK for version COR-46191/fix_pipelines [`#22`](https://github.com/fireblocks/java-sdk/pull/22) -- Generated SDK for version COR-46191/fix_pipelines [`#21`](https://github.com/fireblocks/java-sdk/pull/21) - -## [v2.0.1](https://github.com/fireblocks/java-sdk/compare/v2.0.0...v2.0.1) - 2024-06-04 - -### Merged - -- Generated SDK for version COR-46191/fix_pipelines [`#20`](https://github.com/fireblocks/java-sdk/pull/20) - -## [v2.0.0](https://github.com/fireblocks/java-sdk/compare/v1.1.0...v2.0.0) - 2024-05-08 - -### Merged - -- feat: add tokenization api [`#12`](https://github.com/fireblocks/java-sdk/pull/12) - -## [v1.1.0](https://github.com/fireblocks/java-sdk/compare/v1.0.1...v1.1.0) - 2024-04-17 - -### Merged - -- feat: add cosigners beta api [`#11`](https://github.com/fireblocks/java-sdk/pull/11) -- fix: fix readme doc headline [`#10`](https://github.com/fireblocks/java-sdk/pull/10) - -## [v1.0.1](https://github.com/fireblocks/java-sdk/compare/v1.0.0...v1.0.1) - 2024-04-07 - -### Merged - -- Generated SDK for version v1.0.1 [`#9`](https://github.com/fireblocks/java-sdk/pull/9) - -## v1.0.0 - 2024-04-07 - -### Merged - -- Generated SDK for version v1.0.0 GA [`#8`](https://github.com/fireblocks/java-sdk/pull/8) -- v0.0.1-beta [`#6`](https://github.com/fireblocks/java-sdk/pull/6) -- Update GitHub Actions workflows [`#5`](https://github.com/fireblocks/java-sdk/pull/5) -- Generated #1189972817 [`#3`](https://github.com/fireblocks/java-sdk/pull/3) -- Add installation instructions [`#2`](https://github.com/fireblocks/java-sdk/pull/2) -- Added Idempotency & NCW headers support #6 [`#1`](https://github.com/fireblocks/java-sdk/pull/1) diff --git a/README.md b/README.md index 38f4cf46..3c202374 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Add this dependency to your project's POM: com.fireblocks.sdk fireblocks-sdk - 35.0.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:35.0.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-35.0.0.jar` +- `target/fireblocks-sdk-0.0.0.jar` - `target/lib/*.jar` ## Versioning @@ -213,6 +213,8 @@ Class | Method | HTTP request | Description *BlockchainsAssetsApi* | [**registerNewAsset**](docs/BlockchainsAssetsApi.md#registerNewAsset) | **POST** /assets | Register an asset *BlockchainsAssetsApi* | [**setAssetPrice**](docs/BlockchainsAssetsApi.md#setAssetPrice) | **POST** /assets/prices/{id} | Set asset price *BlockchainsAssetsApi* | [**updateAssetUserMetadata**](docs/BlockchainsAssetsApi.md#updateAssetUserMetadata) | **PATCH** /assets/{id} | Update the user’s metadata for an asset +*CantonBetaApi* | [**createCantonCall**](docs/CantonBetaApi.md#createCantonCall) | **POST** /operations/canton/calls | Make a Canton call +*CantonBetaApi* | [**respondToCantonOffer**](docs/CantonBetaApi.md#respondToCantonOffer) | **POST** /operations/canton/offers/{offerId}/responses | Answer an offer *ComplianceApi* | [**activateArsConfig**](docs/ComplianceApi.md#activateArsConfig) | **POST** /screening/ars/config/activate | Activate ARS (Address Registry Screening) *ComplianceApi* | [**activateByorkConfig**](docs/ComplianceApi.md#activateByorkConfig) | **POST** /screening/byork/config/activate | Activate BYORK Light *ComplianceApi* | [**addAddressRegistryVaultOptOuts**](docs/ComplianceApi.md#addAddressRegistryVaultOptOuts) | **POST** /address_registry/vaults | Add vault accounts to the address registry opt-out list diff --git a/api/openapi.yaml b/api/openapi.yaml index 40cbdb71..4ee98b34 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -251,7 +251,7 @@ paths: Issues a device pairing token for the given user and returns the user's info along with the token. - The API user must be in PENDING_ACTIVATION status. If the user is already set up (enabled), the request is rejected with a 409 Conflict. - Please note that this endpoint is available only for API keys with Owner/Admin/Non Signing Admin permissions. - Endpoint Permission: Owner, Admin, Non-Signing Admin. + - This is the same pairing token that the API Co-signer requests during installation and when you pair an additional API user with an existing Co-signer. You can use this endpoint instead of copying the token from Pair API user in the Console. The token is valid for one hour. operationId: issueApiUserPairingToken parameters: - description: The ID of the api user @@ -2574,14 +2574,8 @@ paths: - application/json /operations/canton/calls: post: - description: |- - Submits one Canton call. `type` names the call and selects the shape of `payload`; `vaultAccountId` and `blockchainId` name the wallet that makes it, and are the same for every `type`. - {"type":"DTCC_END_INVESTOR_INVITE","vaultAccountId":"12","blockchainId":"CANTON", "payload":{"endInvestor":"investor-party::1220abc…"}} - `payload` is optional on `DTCC_PARTICIPANT_ONBOARDING`, where every field it holds is. - An unknown or missing `type`, or a `payload` missing a required field, is a `400`. A field that does not belong to the selected `type` is ignored rather than rejected. - A `501` has two different causes, and the distinction is permanent rather than a build-order detail, so it belongs in the published spec: - NO CANTON CAPABILITY — specified so the contract is complete, but not available in v1: `DTCC_END_INVESTOR_INVITE_CANCEL`, `DTCC_ALLOW_LIST_ADD`, `DTCC_ALLOW_LIST_REMOVE`. NO HANDLER YET — the capability exists and the type is being wired one slice at a time. - To withdraw an allocation, answer the allocation offer with `ALLOCATION_WITHDRAW` on `/offers/{offerId}/responses` — it is not a call. + description: Submits a Canton call from a vault account's Canton wallet. `type` + selects the call and the shape of `payload`. operationId: createCantonCall parameters: - description: "A unique identifier for the request. If the request is sent\ @@ -2646,7 +2640,8 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorSchema" - description: This call type is not available in v1 + description: "This call type is not yet available: DTCC_END_INVESTOR_INVITE_CANCEL,\ + \ DTCC_ALLOW_LIST_ADD, DTCC_ALLOW_LIST_REMOVE" headers: X-Request-ID: $ref: "#/components/headers/X-Request-ID" @@ -2656,18 +2651,35 @@ paths: tags: - Canton (Beta) x-rate-limit-category: write - x-internal: true + x-readme: + code-samples: + - language: typescript + code: "const response: Promise> = fireblocks.cantonBeta.createCantonCall(cantonBetaApiCreateCantonCallRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response = fireblocks.cantonBeta().createCantonCall(cantonCall,\ + \ idempotencyKey);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.canton_beta.create_canton_call(canton_call,\ + \ idempotency_key);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise> = fireblocks.cantonBeta.createCantonCall(cantonBetaApiCreateCantonCallRequest);" + - lang: Java + source: "CompletableFuture> response = fireblocks.cantonBeta().createCantonCall(cantonCall,\ + \ idempotencyKey);" + - lang: Python + source: "response = fireblocks.canton_beta.create_canton_call(canton_call,\ + \ idempotency_key);" x-content-type: application/json x-accepts: - application/json /operations/canton/offers/{offerId}/responses: post: - description: |- - ONE endpoint for every offer. `responseType` selects the variant, and `payload` carries that variant's arguments — the same `{discriminator, payload}` shape `/calls` uses. The union is closed, so an unknown `responseType` is a `400`. - {"responseType":"DTCC_END_INVESTOR_ONBOARDING_REJECT","payload":{"reason":"KYC"}} {"responseType":"ALLOCATION_ACCEPT"} - An allocation offer takes three answers, all on the offer's own id: `ALLOCATION_ACCEPT`, `ALLOCATION_REJECT`, and — once the accept has settled — `ALLOCATION_WITHDRAW`, which unlocks the holding the accept allocated. Sent earlier, the withdraw is a `409`. - `payload` appears ONLY on the variants that take arguments. A variant with no arguments has no `payload` property at all, rather than an empty object — so the schema says what the ledger says, and a future type that needs fields declares its own instead of widening this envelope. - `responseType` is a direct copy of a value the caller already read off the offer, in `cantonDetails.offerResponse.availableResponses`. Both sides share one flat vocabulary, so there is nothing to translate; the previous shape required pairing that value with a matching `domain` string, which carried no information `responseType` did not already determine. + description: Responds to an incoming Canton offer. Set `responseType` to one + of the values in the offer transaction's `cantonDetails.offerResponse.availableResponses`. operationId: respondToCantonOffer parameters: - description: The Fireblocks transaction id of the incoming offer being answered. @@ -2746,7 +2758,7 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorSchema" - description: No handler is implemented for this responseType yet + description: This responseType is not yet available headers: X-Request-ID: $ref: "#/components/headers/X-Request-ID" @@ -2756,7 +2768,31 @@ paths: tags: - Canton (Beta) x-rate-limit-category: write - x-internal: true + x-readme: + code-samples: + - language: typescript + code: "const response: Promise>\ + \ = fireblocks.cantonBeta.respondToCantonOffer(cantonBetaApiRespondToCantonOfferRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response =\ + \ fireblocks.cantonBeta().respondToCantonOffer(offerResponse, offerId,\ + \ idempotencyKey);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.canton_beta.respond_to_canton_offer(offer_response,\ + \ offer_id, idempotency_key);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise>\ + \ = fireblocks.cantonBeta.respondToCantonOffer(cantonBetaApiRespondToCantonOfferRequest);" + - lang: Java + source: "CompletableFuture> response =\ + \ fireblocks.cantonBeta().respondToCantonOffer(offerResponse, offerId, idempotencyKey);" + - lang: Python + source: "response = fireblocks.canton_beta.respond_to_canton_offer(offer_response,\ + \ offer_id, idempotency_key);" x-content-type: application/json x-accepts: - application/json @@ -38680,6 +38716,8 @@ paths: The private key the CSR is built from is held by Fireblocks and is specific to this workspace. It is created on the first request for a given key type, and the same CSR is returned on subsequent requests for that type. Pass `keyAlgorithm` to choose RSA or ECDSA. A workspace may hold one key of each: the CSR returned is always the one for the type requested, so a certificate signed against it matches the key used at delivery time. + + **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. operationId: getMtlsCsr parameters: - description: "Algorithm of the private key the CSR is generated for. ECDSA\ @@ -80497,6 +80535,7 @@ components: description: Request to create a cryptographic proof of address ownership for TRUST network compliance example: + address: bc1qexampleexampleexampleexampleexampleexample prefix: trust_verification vaultAccountId: "0" trustUuid: 550e8400-e29b-41d4-a716-446655440000 @@ -80523,6 +80562,15 @@ components: example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string + address: + description: | + Optional non-default (derived) address of the vault account to prove. + Supported for UTXO assets only (`BTC`, `BTC_TEST`). The address must belong to the vault account for the given asset. + Both SegWit and Legacy address forms are accepted. + When omitted, the proof is created for the default (index 0) address of the vault account. + example: bc1qexampleexampleexampleexampleexampleexample + maxLength: 255 + type: string required: - asset - prefix @@ -80572,6 +80620,7 @@ components: description: Response containing the TRUST-compatible encoded signature example: signature: 0x6e6e0da016d49d2eaeefb2ce49efcde627151ce03d3e525963aa541ce07fb41c0f1f70d131f160480b4a68aaefbdae1b6fe3765eee3ceff0a8b47a8c979ccd961c + publicKey: 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 transactionId: 550e8400-e29b-41d4-a716-446655440000 status: PENDING_SIGNATURE properties: @@ -80587,6 +80636,13 @@ components: TRUST-compatible encoded signature for proof of address verification. example: 0x6e6e0da016d49d2eaeefb2ce49efcde627151ce03d3e525963aa541ce07fb41c0f1f70d131f160480b4a68aaefbdae1b6fe3765eee3ceff0a8b47a8c979ccd961c type: string + publicKey: + description: | + Hex public key of the Fireblocks vault key that produced the signature. + Present only when `status` is `SIGNED` or `COMPLETED`, and only if Fireblocks returned it. + TRUST requires this key for SUI, TON and XTZ (as `auxProofData.encryptedPublicKey`). + example: 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 + type: string required: - signature - status @@ -95889,11 +95945,14 @@ components: OfferResponseDtccOnboardingAccept: additionalProperties: false description: Accept a DTCC end-investor onboarding offer. Carries no arguments. + example: + responseType: DTCC_END_INVESTOR_ONBOARDING_ACCEPT properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - DTCC_END_INVESTOR_ONBOARDING_ACCEPT example: DTCC_END_INVESTOR_ONBOARDING_ACCEPT @@ -95918,9 +95977,10 @@ components: description: Reject a DTCC end-investor onboarding offer. properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - DTCC_END_INVESTOR_ONBOARDING_REJECT example: DTCC_END_INVESTOR_ONBOARDING_REJECT @@ -95936,9 +95996,10 @@ components: description: Accept a Tradeweb co-signing delegation offer. Carries no arguments. properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - TRADEWEB_COSIGNING_DELEGATION_ACCEPT example: TRADEWEB_COSIGNING_DELEGATION_ACCEPT @@ -95949,12 +96010,13 @@ components: OfferResponseTradewebReject: additionalProperties: false description: "Reject a Tradeweb co-signing delegation offer. Carries no arguments\ - \ — the DAR has nowhere on-ledger to record a reason, so none is accepted." + \ — Tradeweb does not record a reject reason on the ledger, so none is accepted." properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - TRADEWEB_COSIGNING_DELEGATION_REJECT example: TRADEWEB_COSIGNING_DELEGATION_REJECT @@ -95967,9 +96029,10 @@ components: description: Accept a CIP-56 allocation request. Carries no arguments. properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - ALLOCATION_ACCEPT example: ALLOCATION_ACCEPT @@ -95982,9 +96045,10 @@ components: description: Reject a CIP-56 allocation request. Carries no arguments. properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - ALLOCATION_REJECT example: ALLOCATION_REJECT @@ -95997,9 +96061,10 @@ components: description: Accept an inbound 2-step transfer offer. Carries no arguments. properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - TRANSFER_ACCEPT example: TRANSFER_ACCEPT @@ -96012,9 +96077,10 @@ components: description: Reject an inbound 2-step transfer offer. Carries no arguments. properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - TRANSFER_REJECT example: TRANSFER_REJECT @@ -96024,15 +96090,15 @@ components: type: object OfferResponseTransferWithdraw: additionalProperties: false - description: "Withdraw your own OUTGOING transfer offer. Carries no arguments\ - \ — `offerId` in the path is the offer, so the vault account and blockchain\ - \ are resolved from it rather than restated. Was `CantonCallType.TRANSFER_WITHDRAW`\ - \ with a 3-field payload until FA-10624." + description: "Withdraw your own outgoing transfer offer. Carries no arguments\ + \ — `offerId` in the path identifies the offer, and the vault account and\ + \ blockchain are resolved from it." properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - TRANSFER_WITHDRAW example: TRANSFER_WITHDRAW @@ -96047,9 +96113,10 @@ components: \ offer. Answers `409` until the accept has settled." properties: responseType: - description: |- - How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. - `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. + description: How you are answering the offer — one of the offer transaction's + `cantonDetails.offerResponse.availableResponses`. That list does not change + after the offer arrives; check `expiresAt` and the transaction status + to see whether it is still answerable. enum: - ALLOCATION_WITHDRAW example: ALLOCATION_WITHDRAW @@ -96085,6 +96152,10 @@ components: OfferResponseAccepted: description: The outgoing transaction that carries the response. Its on-chain outcome arrives by webhook as a status update on this transaction. + example: + responseType: DTCC_END_INVESTOR_ONBOARDING_REJECT + transactionId: 5a1d8b0f-2c31-4c7e-9d0a-118e7b6c4a21 + status: SUBMITTED properties: transactionId: description: The outgoing response transaction. @@ -96108,6 +96179,13 @@ components: description: "Optional, and so is every field in it: omit `payload` entirely\ \ to onboard with DTCC's published parties for the blockchain and the default\ \ expiry." + example: + registrar: dtcc-registrar::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + compliance: dtcc-compliance::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + clientOnboarder: dtcc-onboarder::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + upgrader: dtcc-upgrader::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + expiresAt: 2026-12-31T23:59:59Z + operator: dtcc-operator::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 properties: expiresAt: description: When the onboarding request expires if it has not been answered. @@ -96118,31 +96196,42 @@ components: operator: description: DTCC infra operator party id. Optional — overrides the service's default for the blockchain. - example: dtcc-operator::1220abc… + example: dtcc-operator::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 type: string compliance: description: DTCC compliance party id. Optional — overrides the service's default for the blockchain. - example: dtcc-compliance::1220abc… + example: dtcc-compliance::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 type: string registrar: description: DTCC registrar party id — co-signs the accept. Optional — overrides the service's default for the blockchain. - example: dtcc-registrar::1220abc… + example: dtcc-registrar::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 type: string clientOnboarder: description: DTCC client onboarder party id — co-signs the accept. Optional — overrides the service's default for the blockchain. - example: dtcc-onboarder::1220abc… + example: dtcc-onboarder::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 type: string upgrader: description: DTCC upgrader party id — the Model Upgrade Tool authority. Optional — overrides the service's default for the blockchain. - example: dtcc-upgrader::1220abc… + example: dtcc-upgrader::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 type: string type: object CantonCallParticipantOnboarding: additionalProperties: false + example: + payload: + registrar: dtcc-registrar::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + compliance: dtcc-compliance::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + clientOnboarder: dtcc-onboarder::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + upgrader: dtcc-upgrader::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + expiresAt: 2026-12-31T23:59:59Z + operator: dtcc-operator::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + vaultAccountId: "12" + type: DTCC_PARTICIPANT_ONBOARDING + blockchainId: CANTON properties: type: description: Which call to make. Selects the shape of `payload`. @@ -96170,12 +96259,11 @@ components: - vaultAccountId type: object EndInvestorPayload: - description: "Shared by invite / invite-cancel / offboard — identical wire shape,\ - \ different verb." + description: The end investor a call acts on. properties: endInvestor: description: The end investor's Canton party id. - example: investor-party::1220abc… + example: investor-party::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 type: string required: - endInvestor @@ -96272,7 +96360,7 @@ components: wallets: description: Canton party ids to add or remove. example: - - investor-party::1220abc… + - investor-party::1220abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 items: type: string minItems: 1 @@ -96357,6 +96445,9 @@ components: - $ref: "#/components/schemas/CantonCallAllowListRemove" CallAccepted: description: The outgoing transaction that carries the call. + example: + transactionId: 5a1d8b0f-2c31-4c7e-9d0a-118e7b6c4a21 + status: SUBMITTED properties: transactionId: description: The outgoing transaction that carries the call. diff --git a/build.gradle b/build.gradle index 2721121e..d43e483e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'eclipse' apply plugin: 'com.diffplug.spotless' group = 'com.fireblocks.sdk' -version = '35.0.0' +version = '0.0.0' buildscript { repositories { diff --git a/docs/ApiUserApi.md b/docs/ApiUserApi.md index c051e45a..b3a081c7 100644 --- a/docs/ApiUserApi.md +++ b/docs/ApiUserApi.md @@ -174,7 +174,7 @@ No authorization required Issue API user pairing token -Issues a device pairing token for the given user and returns the user's info along with the token. - The API user must be in PENDING_ACTIVATION status. If the user is already set up (enabled), the request is rejected with a 409 Conflict. - Please note that this endpoint is available only for API keys with Owner/Admin/Non Signing Admin permissions. Endpoint Permission: Owner, Admin, Non-Signing Admin. +Issues a device pairing token for the given user and returns the user's info along with the token. - The API user must be in PENDING_ACTIVATION status. If the user is already set up (enabled), the request is rejected with a 409 Conflict. - Please note that this endpoint is available only for API keys with Owner/Admin/Non Signing Admin permissions. - This is the same pairing token that the API Co-signer requests during installation and when you pair an additional API user with an existing Co-signer. You can use this endpoint instead of copying the token from Pair API user in the Console. The token is valid for one hour. ### Example diff --git a/docs/CantonBetaApi.md b/docs/CantonBetaApi.md new file mode 100644 index 00000000..4ac74fde --- /dev/null +++ b/docs/CantonBetaApi.md @@ -0,0 +1,178 @@ +# CantonBetaApi + +All URIs are relative to https://developers.fireblocks.com/reference/ + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createCantonCall**](CantonBetaApi.md#createCantonCall) | **POST** /operations/canton/calls | Make a Canton call | +| [**respondToCantonOffer**](CantonBetaApi.md#respondToCantonOffer) | **POST** /operations/canton/offers/{offerId}/responses | Answer an offer | + + + +## createCantonCall + +> CompletableFuture> createCantonCall createCantonCall(cantonCall, idempotencyKey) + +Make a Canton call + +Submits a Canton call from a vault account's Canton wallet. `type` selects the call and the shape of `payload`. + +### 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.CantonBetaApi; +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); + + CantonCall cantonCall = new CantonCall(); // CantonCall | + 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.cantonBeta().createCantonCall(cantonCall, 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 CantonBetaApi#createCantonCall"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **cantonCall** | [**CantonCall**](CantonCall.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** | The outgoing transaction that carries the call. | * X-Request-ID -
| +| **400** | Unknown or missing type, a missing required payload field, or an invalid party id, blockchainId, or expiry | * X-Request-ID -
| +| **404** | No Canton wallet for this vault account and blockchainId, or an unknown end investor for this tenant | * X-Request-ID -
| +| **409** | The target is not in a state this call can act on, or more than one candidate contract matched the wallet | * X-Request-ID -
| +| **501** | This call type is not yet available: DTCC_END_INVESTOR_INVITE_CANCEL, DTCC_ALLOW_LIST_ADD, DTCC_ALLOW_LIST_REMOVE | * X-Request-ID -
| +| **0** | Error Response | * X-Request-ID -
| + + +## respondToCantonOffer + +> CompletableFuture> respondToCantonOffer respondToCantonOffer(offerResponse, offerId, idempotencyKey) + +Answer an offer + +Responds to an incoming Canton offer. Set `responseType` to one of the values in the offer transaction's `cantonDetails.offerResponse.availableResponses`. + +### 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.CantonBetaApi; +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); + + OfferResponse offerResponse = new OfferResponse(); // OfferResponse | + String offerId = "5a1d8b0f-2c31-4c7e-9d0a-118e7b6c4a21"; // String | The Fireblocks transaction id of the incoming offer being answered. + 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.cantonBeta().respondToCantonOffer(offerResponse, offerId, 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 CantonBetaApi#respondToCantonOffer"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **offerResponse** | [**OfferResponse**](OfferResponse.md)| | | +| **offerId** | **String**| The Fireblocks transaction id of the incoming offer being answered. | | +| **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 outgoing transaction that carries the response. Its on-chain outcome arrives by webhook as a status update on this transaction. | * X-Request-ID -
| +| **400** | Unknown or missing responseType, or a missing required payload field, or the response is not available to this workspace's side of the offer (a sender sending accept/reject, a receiver sending withdraw) | * X-Request-ID -
| +| **404** | Unknown offer id for this tenant | * X-Request-ID -
| +| **409** | The offer cannot take this response now. An accept or reject: the offer is already answered, expired, or a response is in flight. ALLOCATION_WITHDRAW — which is sent AFTER the accept, on the same offer: the allocation is not ALLOCATED, because the accept has not settled yet, or it was already withdrawn or settled by the venue. The message names the state. | * X-Request-ID -
| +| **501** | This responseType is not yet available | * X-Request-ID -
| +| **0** | Error Response | * X-Request-ID -
| + diff --git a/docs/EndInvestorPayload.md b/docs/EndInvestorPayload.md index 95cf0cfb..e9335ef2 100644 --- a/docs/EndInvestorPayload.md +++ b/docs/EndInvestorPayload.md @@ -2,7 +2,7 @@ # EndInvestorPayload -Shared by invite / invite-cancel / offboard — identical wire shape, different verb. +The end investor a call acts on. ## Properties diff --git a/docs/OfferResponseAllocationAccept.md b/docs/OfferResponseAllocationAccept.md index c3a25aa7..b285fcf6 100644 --- a/docs/OfferResponseAllocationAccept.md +++ b/docs/OfferResponseAllocationAccept.md @@ -8,7 +8,7 @@ Accept a CIP-56 allocation request. Carries no arguments. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/OfferResponseAllocationReject.md b/docs/OfferResponseAllocationReject.md index 44343f78..04b84bbd 100644 --- a/docs/OfferResponseAllocationReject.md +++ b/docs/OfferResponseAllocationReject.md @@ -8,7 +8,7 @@ Reject a CIP-56 allocation request. Carries no arguments. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/OfferResponseAllocationWithdraw.md b/docs/OfferResponseAllocationWithdraw.md index b7ee1b53..a16634c4 100644 --- a/docs/OfferResponseAllocationWithdraw.md +++ b/docs/OfferResponseAllocationWithdraw.md @@ -8,7 +8,7 @@ Withdraw the allocation you made by accepting this offer, unlocking the holding. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/OfferResponseDtccOnboardingAccept.md b/docs/OfferResponseDtccOnboardingAccept.md index b32bf591..353df4e4 100644 --- a/docs/OfferResponseDtccOnboardingAccept.md +++ b/docs/OfferResponseDtccOnboardingAccept.md @@ -8,7 +8,7 @@ Accept a DTCC end-investor onboarding offer. Carries no arguments. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/OfferResponseDtccOnboardingReject.md b/docs/OfferResponseDtccOnboardingReject.md index 44abf052..19e0b251 100644 --- a/docs/OfferResponseDtccOnboardingReject.md +++ b/docs/OfferResponseDtccOnboardingReject.md @@ -8,7 +8,7 @@ Reject a DTCC end-investor onboarding offer. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | |**payload** | [**DtccOnboardingRejectPayload**](DtccOnboardingRejectPayload.md) | | | diff --git a/docs/OfferResponseTradewebAccept.md b/docs/OfferResponseTradewebAccept.md index be65df35..b35ce927 100644 --- a/docs/OfferResponseTradewebAccept.md +++ b/docs/OfferResponseTradewebAccept.md @@ -8,7 +8,7 @@ Accept a Tradeweb co-signing delegation offer. Carries no arguments. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/OfferResponseTradewebReject.md b/docs/OfferResponseTradewebReject.md index 608028ee..6acbc040 100644 --- a/docs/OfferResponseTradewebReject.md +++ b/docs/OfferResponseTradewebReject.md @@ -2,13 +2,13 @@ # OfferResponseTradewebReject -Reject a Tradeweb co-signing delegation offer. Carries no arguments — the DAR has nowhere on-ledger to record a reason, so none is accepted. +Reject a Tradeweb co-signing delegation offer. Carries no arguments — Tradeweb does not record a reject reason on the ledger, so none is accepted. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/OfferResponseTransferAccept.md b/docs/OfferResponseTransferAccept.md index e6be6ed6..1613cbb4 100644 --- a/docs/OfferResponseTransferAccept.md +++ b/docs/OfferResponseTransferAccept.md @@ -8,7 +8,7 @@ Accept an inbound 2-step transfer offer. Carries no arguments. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/OfferResponseTransferReject.md b/docs/OfferResponseTransferReject.md index 9248afcf..9c444b1c 100644 --- a/docs/OfferResponseTransferReject.md +++ b/docs/OfferResponseTransferReject.md @@ -8,7 +8,7 @@ Reject an inbound 2-step transfer offer. Carries no arguments. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/OfferResponseTransferWithdraw.md b/docs/OfferResponseTransferWithdraw.md index 14ce349b..47300cf1 100644 --- a/docs/OfferResponseTransferWithdraw.md +++ b/docs/OfferResponseTransferWithdraw.md @@ -2,13 +2,13 @@ # OfferResponseTransferWithdraw -Withdraw your own OUTGOING transfer offer. Carries no arguments — `offerId` in the path is the offer, so the vault account and blockchain are resolved from it rather than restated. Was `CantonCallType.TRANSFER_WITHDRAW` with a 3-field payload until FA-10624. +Withdraw your own outgoing transfer offer. Carries no arguments — `offerId` in the path identifies the offer, and the vault account and blockchain are resolved from it. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer. Must be one of the values listed in the transaction's `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, not nested under an `additionalInfo` envelope, which does not exist on `TransactionResponse`. `availableResponses` states what this offer TYPE accepts. It is set when the offer arrives and does not change, so it does NOT tell you whether the offer is still answerable — check `expiresAt` and the transaction's status for that, and expect this endpoint to be the authority: it re-checks state and expiry on every call and answers 409 when either has moved. | | +|**responseType** | [**ResponseTypeEnum**](#ResponseTypeEnum) | How you are answering the offer — one of the offer transaction's `cantonDetails.offerResponse.availableResponses`. That list does not change after the offer arrives; check `expiresAt` and the transaction status to see whether it is still answerable. | | diff --git a/docs/TrustProofOfAddressRequest.md b/docs/TrustProofOfAddressRequest.md index 7ec499c4..aef4afef 100644 --- a/docs/TrustProofOfAddressRequest.md +++ b/docs/TrustProofOfAddressRequest.md @@ -12,6 +12,7 @@ Request to create a cryptographic proof of address ownership for TRUST network c |**asset** | **String** | The asset identifier for which proof of address is being created. | | |**prefix** | **String** | The prefix to be used for signing messages. | | |**trustUuid** | **UUID** | A unique identifier (UUID) obtained from TRUST (CreateAddressOwnership) | | +|**address** | **String** | Optional non-default (derived) address of the vault account to prove. Supported for UTXO assets only (`BTC`, `BTC_TEST`). The address must belong to the vault account for the given asset. Both SegWit and Legacy address forms are accepted. When omitted, the proof is created for the default (index 0) address of the vault account. | [optional] | diff --git a/docs/TrustProofOfAddressResponse.md b/docs/TrustProofOfAddressResponse.md index 3d1f0a50..910dda4c 100644 --- a/docs/TrustProofOfAddressResponse.md +++ b/docs/TrustProofOfAddressResponse.md @@ -11,6 +11,7 @@ Response containing the TRUST-compatible encoded signature |**transactionId** | **UUID** | Transaction ID from Fireblocks (UUID format) | | |**status** | **TypedMessageTransactionStatusEnum** | | | |**signature** | **String** | TRUST-compatible encoded signature for proof of address verification. | | +|**publicKey** | **String** | Hex public key of the Fireblocks vault key that produced the signature. Present only when `status` is `SIGNED` or `COMPLETED`, and only if Fireblocks returned it. TRUST requires this key for SUI, TON and XTZ (as `auxProofData.encryptedPublicKey`). | [optional] | diff --git a/docs/WebhooksV2Api.md b/docs/WebhooksV2Api.md index 8b665420..7910448e 100644 --- a/docs/WebhooksV2Api.md +++ b/docs/WebhooksV2Api.md @@ -592,7 +592,7 @@ No authorization required Get mTLS CSR -Returns the Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate. The private key the CSR is built from is held by Fireblocks and is specific to this workspace. It is created on the first request for a given key type, and the same CSR is returned on subsequent requests for that type. Pass `keyAlgorithm` to choose RSA or ECDSA. A workspace may hold one key of each: the CSR returned is always the one for the type requested, so a certificate signed against it matches the key used at delivery time. +Returns the Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate. The private key the CSR is built from is held by Fireblocks and is specific to this workspace. It is created on the first request for a given key type, and the same CSR is returned on subsequent requests for that type. Pass `keyAlgorithm` to choose RSA or ECDSA. A workspace may hold one key of each: the CSR returned is always the one for the type requested, so a certificate signed against it matches the key used at delivery time. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. ### Example diff --git a/pom.xml b/pom.xml index a812eae2..5c58d835 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fireblocks-sdk jar fireblocks-sdk - 35.0.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 73fe7281..aa53bae8 100644 --- a/src/main/java/com/fireblocks/sdk/Configuration.java +++ b/src/main/java/com/fireblocks/sdk/Configuration.java @@ -21,7 +21,7 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class Configuration { - public static final String VERSION = "35.0.0"; + public static final String VERSION = "0.0.0"; private static final AtomicReference defaultApiClient = new AtomicReference<>(); private static volatile Supplier apiClientFactory = ApiClient::new; diff --git a/src/main/java/com/fireblocks/sdk/Fireblocks.java b/src/main/java/com/fireblocks/sdk/Fireblocks.java index 5a4284c1..05f8a67b 100644 --- a/src/main/java/com/fireblocks/sdk/Fireblocks.java +++ b/src/main/java/com/fireblocks/sdk/Fireblocks.java @@ -41,6 +41,7 @@ public class Fireblocks { private AuditLogsApi auditLogs; private BlockchainLinkBetaApi blockchainLinkBeta; private BlockchainsAssetsApi blockchainsAssets; + private CantonBetaApi cantonBeta; private ComplianceApi compliance; private ComplianceOrchestratorBetaApi complianceOrchestratorBeta; private ComplianceScreeningConfigurationApi complianceScreeningConfiguration; @@ -267,6 +268,13 @@ public BlockchainsAssetsApi blockchainsAssets() { return blockchainsAssets; } + public CantonBetaApi cantonBeta() { + if (cantonBeta == null) { + cantonBeta = new CantonBetaApi(apiClient); + } + return cantonBeta; + } + public ComplianceApi compliance() { if (compliance == null) { compliance = new ComplianceApi(apiClient); diff --git a/src/main/java/com/fireblocks/sdk/api/ApiUserApi.java b/src/main/java/com/fireblocks/sdk/api/ApiUserApi.java index 39248a3f..d4850d74 100644 --- a/src/main/java/com/fireblocks/sdk/api/ApiUserApi.java +++ b/src/main/java/com/fireblocks/sdk/api/ApiUserApi.java @@ -263,7 +263,10 @@ private HttpRequest.Builder getApiUsersRequestBuilder() throws ApiException { * user's info along with the token. - The API user must be in PENDING_ACTIVATION status. If * the user is already set up (enabled), the request is rejected with a 409 Conflict. - Please * note that this endpoint is available only for API keys with Owner/Admin/Non Signing Admin - * permissions. Endpoint Permission: Owner, Admin, Non-Signing Admin. + * permissions. - This is the same pairing token that the API Co-signer requests during + * installation and when you pair an additional API user with an existing Co-signer. You can use + * this endpoint instead of copying the token from Pair API user in the Console. The token is + * valid for one hour. * * @param userId The ID of the api user (required) * @param idempotencyKey A unique identifier for the request. If the request is sent multiple diff --git a/src/main/java/com/fireblocks/sdk/api/CantonBetaApi.java b/src/main/java/com/fireblocks/sdk/api/CantonBetaApi.java new file mode 100644 index 00000000..312f2873 --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/api/CantonBetaApi.java @@ -0,0 +1,299 @@ +/* + * Fireblocks API + * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: developers@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.LifecycleWarning; +import com.fireblocks.sdk.ValidationUtils; +import com.fireblocks.sdk.model.CallAccepted; +import com.fireblocks.sdk.model.CantonCall; +import com.fireblocks.sdk.model.OfferResponse; +import com.fireblocks.sdk.model.OfferResponseAccepted; +import java.io.IOException; +import java.io.InputStream; +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.concurrent.CancellationException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; +import java.util.concurrent.ExecutionException; +import java.util.function.Consumer; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CantonBetaApi { + 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 CantonBetaApi() { + this(new ApiClient()); + } + + public CantonBetaApi(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()); + } + + /** + * Normalizes any failure raised while performing the call into the single failure type callers + * are told to expect. Transport-level errors surfaced by {@code HttpClient.sendAsync} - + * connection refused, DNS failures, TLS errors, timeouts - would otherwise reach the caller as + * a raw {@link java.io.IOException}, which makes the documented {@code (ApiException) + * e.getCause()} throw {@link ClassCastException}. + * + *

{@link CancellationException} is passed through unchanged: a cancelled call is not an API + * failure. + */ + private static Throwable toApiFailure(Throwable throwable) { + Throwable cause = throwable; + while ((cause instanceof CompletionException || cause instanceof ExecutionException) + && cause.getCause() != null) { + cause = cause.getCause(); + } + if (cause instanceof ApiException || cause instanceof CancellationException) { + return cause; + } + return new ApiException(cause); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Make a Canton call Submits a Canton call from a vault account's Canton wallet. + * `type` selects the call and the shape of `payload`. + * + * @param cantonCall (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<CallAccepted>>, which completes + * exceptionally with an {@link ApiException} if the API call fails + */ + public CompletableFuture> createCantonCall( + CantonCall cantonCall, String idempotencyKey) { + try { + HttpRequest.Builder localVarRequestBuilder = + createCantonCallRequestBuilder(cantonCall, idempotencyKey); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + // Ahead of the status check, which fails the future: the lifecycle + // header + // is present on allowed error responses too. + LifecycleWarning.warn( + localVarResponse.headers(), + "createCantonCall", + localVarResponse.statusCode()); + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException("createCantonCall", 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< + CallAccepted>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }) + .handle( + (localVarApiResponse, localVarThrowable) -> + localVarThrowable == null + ? CompletableFuture.completedFuture(localVarApiResponse) + : CompletableFuture + .>failedFuture( + toApiFailure(localVarThrowable))) + .thenCompose(localVarNormalized -> localVarNormalized); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createCantonCallRequestBuilder( + CantonCall cantonCall, String idempotencyKey) throws ApiException { + ValidationUtils.assertParamExists("createCantonCall", "cantonCall", cantonCall); + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/operations/canton/calls"; + + 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(cantonCall); + 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; + } + /** + * Answer an offer Responds to an incoming Canton offer. Set `responseType` to one of + * the values in the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. + * + * @param offerResponse (required) + * @param offerId The Fireblocks transaction id of the incoming offer being answered. (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<OfferResponseAccepted>>, which completes + * exceptionally with an {@link ApiException} if the API call fails + */ + public CompletableFuture> respondToCantonOffer( + OfferResponse offerResponse, String offerId, String idempotencyKey) { + try { + HttpRequest.Builder localVarRequestBuilder = + respondToCantonOfferRequestBuilder(offerResponse, offerId, idempotencyKey); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + // Ahead of the status check, which fails the future: the lifecycle + // header + // is present on allowed error responses too. + LifecycleWarning.warn( + localVarResponse.headers(), + "respondToCantonOffer", + localVarResponse.statusCode()); + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException( + "respondToCantonOffer", 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< + OfferResponseAccepted>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }) + .handle( + (localVarApiResponse, localVarThrowable) -> + localVarThrowable == null + ? CompletableFuture.completedFuture(localVarApiResponse) + : CompletableFuture + .> + failedFuture( + toApiFailure( + localVarThrowable))) + .thenCompose(localVarNormalized -> localVarNormalized); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder respondToCantonOfferRequestBuilder( + OfferResponse offerResponse, String offerId, String idempotencyKey) + throws ApiException { + ValidationUtils.assertParamExists("respondToCantonOffer", "offerResponse", offerResponse); + ValidationUtils.assertParamExistsAndNotEmpty("respondToCantonOffer", "offerId", offerId); + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/operations/canton/offers/{offerId}/responses" + .replace("{offerId}", ApiClient.urlEncode(offerId.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(offerResponse); + 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; + } +} diff --git a/src/main/java/com/fireblocks/sdk/api/WebhooksV2Api.java b/src/main/java/com/fireblocks/sdk/api/WebhooksV2Api.java index f9d81a69..52192415 100644 --- a/src/main/java/com/fireblocks/sdk/api/WebhooksV2Api.java +++ b/src/main/java/com/fireblocks/sdk/api/WebhooksV2Api.java @@ -841,7 +841,8 @@ private HttpRequest.Builder getMetricsRequestBuilder(UUID webhookId, String metr * and the same CSR is returned on subsequent requests for that type. Pass * `keyAlgorithm` to choose RSA or ECDSA. A workspace may hold one key of each: the * CSR returned is always the one for the type requested, so a certificate signed against it - * matches the key used at delivery time. + * matches the key used at delivery time. **Endpoint Permissions:** Owner, Admin, Non-Signing + * Admin. * * @param keyAlgorithm Algorithm of the private key the CSR is generated for. ECDSA keys are * smaller and quicker to issue, but the certificate authority signing the request has to diff --git a/src/main/java/com/fireblocks/sdk/model/EndInvestorPayload.java b/src/main/java/com/fireblocks/sdk/model/EndInvestorPayload.java index 174ae9e1..652effd7 100644 --- a/src/main/java/com/fireblocks/sdk/model/EndInvestorPayload.java +++ b/src/main/java/com/fireblocks/sdk/model/EndInvestorPayload.java @@ -21,7 +21,7 @@ import java.util.Objects; import java.util.StringJoiner; -/** Shared by invite / invite-cancel / offboard — identical wire shape, different verb. */ +/** The end investor a call acts on. */ @JsonPropertyOrder({EndInvestorPayload.JSON_PROPERTY_END_INVESTOR}) @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationAccept.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationAccept.java index ca3aa098..1609b009 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationAccept.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationAccept.java @@ -29,14 +29,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseAllocationAccept { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { ALLOCATION_ACCEPT(String.valueOf("ALLOCATION_ACCEPT")); @@ -87,14 +83,10 @@ public OfferResponseAllocationAccept responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationReject.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationReject.java index e80c9553..ece6bcda 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationReject.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationReject.java @@ -29,14 +29,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseAllocationReject { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { ALLOCATION_REJECT(String.valueOf("ALLOCATION_REJECT")); @@ -87,14 +83,10 @@ public OfferResponseAllocationReject responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationWithdraw.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationWithdraw.java index c23e84a4..bb649606 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationWithdraw.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseAllocationWithdraw.java @@ -33,14 +33,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseAllocationWithdraw { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { ALLOCATION_WITHDRAW(String.valueOf("ALLOCATION_WITHDRAW")); @@ -91,14 +87,10 @@ public OfferResponseAllocationWithdraw responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseDtccOnboardingAccept.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseDtccOnboardingAccept.java index 1ef52554..f3a3cf59 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseDtccOnboardingAccept.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseDtccOnboardingAccept.java @@ -29,14 +29,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseDtccOnboardingAccept { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { DTCC_END_INVESTOR_ONBOARDING_ACCEPT(String.valueOf("DTCC_END_INVESTOR_ONBOARDING_ACCEPT")); @@ -87,14 +83,10 @@ public OfferResponseDtccOnboardingAccept responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseDtccOnboardingReject.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseDtccOnboardingReject.java index eabeb2e1..17a6c035 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseDtccOnboardingReject.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseDtccOnboardingReject.java @@ -32,14 +32,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseDtccOnboardingReject { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { DTCC_END_INVESTOR_ONBOARDING_REJECT(String.valueOf("DTCC_END_INVESTOR_ONBOARDING_REJECT")); @@ -96,14 +92,10 @@ public OfferResponseDtccOnboardingReject responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseTradewebAccept.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseTradewebAccept.java index 7d363dfb..36ae873d 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseTradewebAccept.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseTradewebAccept.java @@ -29,14 +29,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseTradewebAccept { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { TRADEWEB_COSIGNING_DELEGATION_ACCEPT( @@ -88,14 +84,10 @@ public OfferResponseTradewebAccept responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseTradewebReject.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseTradewebReject.java index 376c5db9..1dde59e8 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseTradewebReject.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseTradewebReject.java @@ -23,8 +23,8 @@ import java.util.StringJoiner; /** - * Reject a Tradeweb co-signing delegation offer. Carries no arguments — the DAR has nowhere - * on-ledger to record a reason, so none is accepted. + * Reject a Tradeweb co-signing delegation offer. Carries no arguments — Tradeweb does not record a + * reject reason on the ledger, so none is accepted. */ @JsonPropertyOrder({OfferResponseTradewebReject.JSON_PROPERTY_RESPONSE_TYPE}) @jakarta.annotation.Generated( @@ -32,14 +32,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseTradewebReject { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { TRADEWEB_COSIGNING_DELEGATION_REJECT( @@ -91,14 +87,10 @@ public OfferResponseTradewebReject responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferAccept.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferAccept.java index 53e0ef05..8c228c0b 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferAccept.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferAccept.java @@ -29,14 +29,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseTransferAccept { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { TRANSFER_ACCEPT(String.valueOf("TRANSFER_ACCEPT")); @@ -87,14 +83,10 @@ public OfferResponseTransferAccept responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferReject.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferReject.java index 291d46b9..4d6d69c2 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferReject.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferReject.java @@ -29,14 +29,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseTransferReject { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { TRANSFER_REJECT(String.valueOf("TRANSFER_REJECT")); @@ -87,14 +83,10 @@ public OfferResponseTransferReject responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferWithdraw.java b/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferWithdraw.java index b04e746b..1e3d9960 100644 --- a/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferWithdraw.java +++ b/src/main/java/com/fireblocks/sdk/model/OfferResponseTransferWithdraw.java @@ -23,9 +23,8 @@ import java.util.StringJoiner; /** - * Withdraw your own OUTGOING transfer offer. Carries no arguments — `offerId` in the path - * is the offer, so the vault account and blockchain are resolved from it rather than restated. Was - * `CantonCallType.TRANSFER_WITHDRAW` with a 3-field payload until FA-10624. + * Withdraw your own outgoing transfer offer. Carries no arguments — `offerId` in the path + * identifies the offer, and the vault account and blockchain are resolved from it. */ @JsonPropertyOrder({OfferResponseTransferWithdraw.JSON_PROPERTY_RESPONSE_TYPE}) @jakarta.annotation.Generated( @@ -33,14 +32,10 @@ comments = "Generator version: 7.14.0") public class OfferResponseTransferWithdraw { /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. */ public enum ResponseTypeEnum { TRANSFER_WITHDRAW(String.valueOf("TRANSFER_WITHDRAW")); @@ -91,14 +86,10 @@ public OfferResponseTransferWithdraw responseType( } /** - * How you are answering the offer. Must be one of the values listed in the transaction's - * `cantonDetails.offerResponse.availableResponses` — TOP-LEVEL on the transaction, - * not nested under an `additionalInfo` envelope, which does not exist on - * `TransactionResponse`. `availableResponses` states what this offer TYPE - * accepts. It is set when the offer arrives and does not change, so it does NOT tell you - * whether the offer is still answerable — check `expiresAt` and the transaction's - * status for that, and expect this endpoint to be the authority: it re-checks state and expiry - * on every call and answers 409 when either has moved. + * How you are answering the offer — one of the offer transaction's + * `cantonDetails.offerResponse.availableResponses`. That list does not change after + * the offer arrives; check `expiresAt` and the transaction status to see whether it + * is still answerable. * * @return responseType */ diff --git a/src/main/java/com/fireblocks/sdk/model/TrustProofOfAddressRequest.java b/src/main/java/com/fireblocks/sdk/model/TrustProofOfAddressRequest.java index 90036b39..8c2de750 100644 --- a/src/main/java/com/fireblocks/sdk/model/TrustProofOfAddressRequest.java +++ b/src/main/java/com/fireblocks/sdk/model/TrustProofOfAddressRequest.java @@ -27,7 +27,8 @@ TrustProofOfAddressRequest.JSON_PROPERTY_VAULT_ACCOUNT_ID, TrustProofOfAddressRequest.JSON_PROPERTY_ASSET, TrustProofOfAddressRequest.JSON_PROPERTY_PREFIX, - TrustProofOfAddressRequest.JSON_PROPERTY_TRUST_UUID + TrustProofOfAddressRequest.JSON_PROPERTY_TRUST_UUID, + TrustProofOfAddressRequest.JSON_PROPERTY_ADDRESS }) @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -45,6 +46,9 @@ public class TrustProofOfAddressRequest { public static final String JSON_PROPERTY_TRUST_UUID = "trustUuid"; @jakarta.annotation.Nonnull private UUID trustUuid; + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nullable private String address; + public TrustProofOfAddressRequest() {} @JsonCreator @@ -153,6 +157,32 @@ public void setTrustUuid(@jakarta.annotation.Nonnull UUID trustUuid) { this.trustUuid = trustUuid; } + public TrustProofOfAddressRequest address(@jakarta.annotation.Nullable String address) { + this.address = address; + return this; + } + + /** + * Optional non-default (derived) address of the vault account to prove. Supported for UTXO + * assets only (`BTC`, `BTC_TEST`). The address must belong to the vault + * account for the given asset. Both SegWit and Legacy address forms are accepted. When omitted, + * the proof is created for the default (index 0) address of the vault account. + * + * @return address + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAddress() { + return address; + } + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(@jakarta.annotation.Nullable String address) { + this.address = address; + } + /** Return true if this TrustProofOfAddressRequest object is equal to o. */ @Override public boolean equals(Object o) { @@ -166,12 +196,13 @@ public boolean equals(Object o) { return Objects.equals(this.vaultAccountId, trustProofOfAddressRequest.vaultAccountId) && Objects.equals(this.asset, trustProofOfAddressRequest.asset) && Objects.equals(this.prefix, trustProofOfAddressRequest.prefix) - && Objects.equals(this.trustUuid, trustProofOfAddressRequest.trustUuid); + && Objects.equals(this.trustUuid, trustProofOfAddressRequest.trustUuid) + && Objects.equals(this.address, trustProofOfAddressRequest.address); } @Override public int hashCode() { - return Objects.hash(vaultAccountId, asset, prefix, trustUuid); + return Objects.hash(vaultAccountId, asset, prefix, trustUuid, address); } @Override @@ -182,6 +213,7 @@ public String toString() { sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); sb.append(" trustUuid: ").append(toIndentedString(trustUuid)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append("}"); return sb.toString(); } @@ -269,6 +301,16 @@ public String toUrlQueryString(String prefix) { ApiClient.urlEncode(ApiClient.valueToString(getTrustUuid())))); } + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add( + String.format( + "%saddress%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getAddress())))); + } + return joiner.toString(); } } diff --git a/src/main/java/com/fireblocks/sdk/model/TrustProofOfAddressResponse.java b/src/main/java/com/fireblocks/sdk/model/TrustProofOfAddressResponse.java index e5bc21b2..c84332fc 100644 --- a/src/main/java/com/fireblocks/sdk/model/TrustProofOfAddressResponse.java +++ b/src/main/java/com/fireblocks/sdk/model/TrustProofOfAddressResponse.java @@ -26,7 +26,8 @@ @JsonPropertyOrder({ TrustProofOfAddressResponse.JSON_PROPERTY_TRANSACTION_ID, TrustProofOfAddressResponse.JSON_PROPERTY_STATUS, - TrustProofOfAddressResponse.JSON_PROPERTY_SIGNATURE + TrustProofOfAddressResponse.JSON_PROPERTY_SIGNATURE, + TrustProofOfAddressResponse.JSON_PROPERTY_PUBLIC_KEY }) @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -41,6 +42,9 @@ public class TrustProofOfAddressResponse { public static final String JSON_PROPERTY_SIGNATURE = "signature"; @jakarta.annotation.Nonnull private String signature; + public static final String JSON_PROPERTY_PUBLIC_KEY = "publicKey"; + @jakarta.annotation.Nullable private String publicKey; + public TrustProofOfAddressResponse() {} @JsonCreator @@ -125,6 +129,32 @@ public void setSignature(@jakarta.annotation.Nonnull String signature) { this.signature = signature; } + public TrustProofOfAddressResponse publicKey(@jakarta.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Hex public key of the Fireblocks vault key that produced the signature. Present only when + * `status` is `SIGNED` or `COMPLETED`, and only if Fireblocks + * returned it. TRUST requires this key for SUI, TON and XTZ (as + * `auxProofData.encryptedPublicKey`). + * + * @return publicKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicKey() { + return publicKey; + } + + @JsonProperty(JSON_PROPERTY_PUBLIC_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublicKey(@jakarta.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + } + /** Return true if this TrustProofOfAddressResponse object is equal to o. */ @Override public boolean equals(Object o) { @@ -137,12 +167,13 @@ public boolean equals(Object o) { TrustProofOfAddressResponse trustProofOfAddressResponse = (TrustProofOfAddressResponse) o; return Objects.equals(this.transactionId, trustProofOfAddressResponse.transactionId) && Objects.equals(this.status, trustProofOfAddressResponse.status) - && Objects.equals(this.signature, trustProofOfAddressResponse.signature); + && Objects.equals(this.signature, trustProofOfAddressResponse.signature) + && Objects.equals(this.publicKey, trustProofOfAddressResponse.publicKey); } @Override public int hashCode() { - return Objects.hash(transactionId, status, signature); + return Objects.hash(transactionId, status, signature, publicKey); } @Override @@ -152,6 +183,7 @@ public String toString() { sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); sb.append("}"); return sb.toString(); } @@ -229,6 +261,16 @@ public String toUrlQueryString(String prefix) { ApiClient.urlEncode(ApiClient.valueToString(getSignature())))); } + // add `publicKey` to the URL query string + if (getPublicKey() != null) { + joiner.add( + String.format( + "%spublicKey%s=%s", + prefix, + suffix, + ApiClient.urlEncode(ApiClient.valueToString(getPublicKey())))); + } + return joiner.toString(); } } diff --git a/src/test/java/com/fireblocks/sdk/FireblocksTest.java b/src/test/java/com/fireblocks/sdk/FireblocksTest.java index 3a35aef2..e2a4db7c 100644 --- a/src/test/java/com/fireblocks/sdk/FireblocksTest.java +++ b/src/test/java/com/fireblocks/sdk/FireblocksTest.java @@ -395,6 +395,14 @@ public void testGetBlockchainsAssetsApi() { Assert.assertSame(blockchainsAssets, fireblocks.blockchainsAssets()); } + @Test + public void testGetCantonBetaApi() { + setupFireblocks(true, null, null); + CantonBetaApi cantonBeta = fireblocks.cantonBeta(); + Assert.assertNotNull(cantonBeta); + Assert.assertSame(cantonBeta, fireblocks.cantonBeta()); + } + @Test public void testGetComplianceApi() { setupFireblocks(true, null, null); diff --git a/src/test/java/com/fireblocks/sdk/api/ApiUserApiTest.java b/src/test/java/com/fireblocks/sdk/api/ApiUserApiTest.java index 22871268..9e18d8fa 100644 --- a/src/test/java/com/fireblocks/sdk/api/ApiUserApiTest.java +++ b/src/test/java/com/fireblocks/sdk/api/ApiUserApiTest.java @@ -61,8 +61,10 @@ public void getApiUsersTest() { *

Issues a device pairing token for the given user and returns the user's info along * with the token. - The API user must be in PENDING_ACTIVATION status. If the user is already * set up (enabled), the request is rejected with a 409 Conflict. - Please note that this - * endpoint is available only for API keys with Owner/Admin/Non Signing Admin permissions. - * Endpoint Permission: Owner, Admin, Non-Signing Admin. + * endpoint is available only for API keys with Owner/Admin/Non Signing Admin permissions. - + * This is the same pairing token that the API Co-signer requests during installation and when + * you pair an additional API user with an existing Co-signer. You can use this endpoint instead + * of copying the token from Pair API user in the Console. The token is valid for one hour. */ @Test public void issueApiUserPairingTokenTest() { diff --git a/src/test/java/com/fireblocks/sdk/api/CantonBetaApiTest.java b/src/test/java/com/fireblocks/sdk/api/CantonBetaApiTest.java new file mode 100644 index 00000000..e21b3e5b --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/api/CantonBetaApiTest.java @@ -0,0 +1,59 @@ +/* + * Fireblocks API + * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: developers@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.ApiResponse; +import com.fireblocks.sdk.model.CallAccepted; +import com.fireblocks.sdk.model.CantonCall; +import com.fireblocks.sdk.model.OfferResponse; +import com.fireblocks.sdk.model.OfferResponseAccepted; +import java.util.concurrent.CompletableFuture; +import org.junit.Ignore; +import org.junit.Test; + +/** API tests for CantonBetaApi */ +@Ignore +public class CantonBetaApiTest { + + private final CantonBetaApi api = new CantonBetaApi(); + + /** + * Make a Canton call + * + *

Submits a Canton call from a vault account's Canton wallet. `type` selects + * the call and the shape of `payload`. + */ + @Test + public void createCantonCallTest() { + CantonCall cantonCall = null; + String idempotencyKey = null; + CompletableFuture> response = + api.createCantonCall(cantonCall, idempotencyKey); + } + + /** + * Answer an offer + * + *

Responds to an incoming Canton offer. Set `responseType` to one of the values in + * the offer transaction's `cantonDetails.offerResponse.availableResponses`. + */ + @Test + public void respondToCantonOfferTest() { + OfferResponse offerResponse = null; + String offerId = null; + String idempotencyKey = null; + CompletableFuture> response = + api.respondToCantonOffer(offerResponse, offerId, idempotencyKey); + } +} diff --git a/src/test/java/com/fireblocks/sdk/api/WebhooksV2ApiTest.java b/src/test/java/com/fireblocks/sdk/api/WebhooksV2ApiTest.java index f78a3672..a683f669 100644 --- a/src/test/java/com/fireblocks/sdk/api/WebhooksV2ApiTest.java +++ b/src/test/java/com/fireblocks/sdk/api/WebhooksV2ApiTest.java @@ -186,7 +186,7 @@ public void getMetricsTest() { * same CSR is returned on subsequent requests for that type. Pass `keyAlgorithm` to * choose RSA or ECDSA. A workspace may hold one key of each: the CSR returned is always the one * for the type requested, so a certificate signed against it matches the key used at delivery - * time. + * time. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. */ @Test public void getMtlsCsrTest() { diff --git a/src/test/java/com/fireblocks/sdk/model/TrustProofOfAddressRequestTest.java b/src/test/java/com/fireblocks/sdk/model/TrustProofOfAddressRequestTest.java index 2fd0c469..68717048 100644 --- a/src/test/java/com/fireblocks/sdk/model/TrustProofOfAddressRequestTest.java +++ b/src/test/java/com/fireblocks/sdk/model/TrustProofOfAddressRequestTest.java @@ -48,4 +48,10 @@ void prefixTest() { void trustUuidTest() { // TODO: test trustUuid } + + /** Test the property 'address' */ + @Test + void addressTest() { + // TODO: test address + } } diff --git a/src/test/java/com/fireblocks/sdk/model/TrustProofOfAddressResponseTest.java b/src/test/java/com/fireblocks/sdk/model/TrustProofOfAddressResponseTest.java index 928536fc..c8107361 100644 --- a/src/test/java/com/fireblocks/sdk/model/TrustProofOfAddressResponseTest.java +++ b/src/test/java/com/fireblocks/sdk/model/TrustProofOfAddressResponseTest.java @@ -42,4 +42,10 @@ void statusTest() { void signatureTest() { // TODO: test signature } + + /** Test the property 'publicKey' */ + @Test + void publicKeyTest() { + // TODO: test publicKey + } }