diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 62b078b7..b2006482 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -303,6 +303,7 @@ docs/PaginatedAddressResponse.md docs/PaginatedAddressResponsePaging.md docs/PaginatedAssetWalletResponse.md docs/PaginatedAssetWalletResponsePaging.md +docs/PaginatedAssetsResponse.md docs/Paging.md docs/PairApiKeyRequest.md docs/PairApiKeyResponse.md @@ -919,6 +920,7 @@ src/main/java/com/fireblocks/sdk/model/PaginatedAddressResponse.java src/main/java/com/fireblocks/sdk/model/PaginatedAddressResponsePaging.java src/main/java/com/fireblocks/sdk/model/PaginatedAssetWalletResponse.java src/main/java/com/fireblocks/sdk/model/PaginatedAssetWalletResponsePaging.java +src/main/java/com/fireblocks/sdk/model/PaginatedAssetsResponse.java src/main/java/com/fireblocks/sdk/model/Paging.java src/main/java/com/fireblocks/sdk/model/PairApiKeyRequest.java src/main/java/com/fireblocks/sdk/model/PairApiKeyResponse.java @@ -1499,6 +1501,7 @@ src/test/java/com/fireblocks/sdk/model/PaginatedAddressResponsePagingTest.java src/test/java/com/fireblocks/sdk/model/PaginatedAddressResponseTest.java src/test/java/com/fireblocks/sdk/model/PaginatedAssetWalletResponsePagingTest.java src/test/java/com/fireblocks/sdk/model/PaginatedAssetWalletResponseTest.java +src/test/java/com/fireblocks/sdk/model/PaginatedAssetsResponseTest.java src/test/java/com/fireblocks/sdk/model/PagingTest.java src/test/java/com/fireblocks/sdk/model/PairApiKeyRequestTest.java src/test/java/com/fireblocks/sdk/model/PairApiKeyResponseTest.java diff --git a/README.md b/README.md index cf767e01..ab53415a 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Add this dependency to your project's POM: com.fireblocks.sdk fireblocks-sdk - 8.1.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:8.1.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-8.1.0.jar` +- `target/fireblocks-sdk-0.0.0.jar` - `target/lib/*.jar` @@ -226,9 +226,10 @@ Class | Method | HTTP request | Description *InternalWalletsApi* | [**createInternalWallet**](docs/InternalWalletsApi.md#createInternalWallet) | **POST** /internal_wallets | Create an internal wallet *InternalWalletsApi* | [**createInternalWalletAsset**](docs/InternalWalletsApi.md#createInternalWalletAsset) | **POST** /internal_wallets/{walletId}/{assetId} | Add an asset to an internal wallet *InternalWalletsApi* | [**deleteInternalWallet**](docs/InternalWalletsApi.md#deleteInternalWallet) | **DELETE** /internal_wallets/{walletId} | Delete an internal wallet -*InternalWalletsApi* | [**deleteInternalWalletAsset**](docs/InternalWalletsApi.md#deleteInternalWalletAsset) | **DELETE** /internal_wallets/{walletId}/{assetId} | Delete a whitelisted address from an internal wallet -*InternalWalletsApi* | [**getInternalWallet**](docs/InternalWalletsApi.md#getInternalWallet) | **GET** /internal_wallets/{walletId} | Get assets for internal wallet +*InternalWalletsApi* | [**deleteInternalWalletAsset**](docs/InternalWalletsApi.md#deleteInternalWalletAsset) | **DELETE** /internal_wallets/{walletId}/{assetId} | Delete a whitelisted address +*InternalWalletsApi* | [**getInternalWallet**](docs/InternalWalletsApi.md#getInternalWallet) | **GET** /internal_wallets/{walletId} | Get an asset from an internal wallet *InternalWalletsApi* | [**getInternalWalletAsset**](docs/InternalWalletsApi.md#getInternalWalletAsset) | **GET** /internal_wallets/{walletId}/{assetId} | Get an asset from an internal wallet +*InternalWalletsApi* | [**getInternalWalletAssetsPaginated**](docs/InternalWalletsApi.md#getInternalWalletAssetsPaginated) | **GET** /internal_wallets/{walletId}/assets | List assets in an internal wallet (Paginated) *InternalWalletsApi* | [**getInternalWallets**](docs/InternalWalletsApi.md#getInternalWallets) | **GET** /internal_wallets | List internal wallets *InternalWalletsApi* | [**setCustomerRefIdForInternalWallet**](docs/InternalWalletsApi.md#setCustomerRefIdForInternalWallet) | **POST** /internal_wallets/{walletId}/set_customer_ref_id | Set an AML/KYT customer reference ID for an internal wallet *JobManagementApi* | [**cancelJob**](docs/JobManagementApi.md#cancelJob) | **POST** /batch/{jobId}/cancel | Cancel a running job @@ -673,6 +674,7 @@ Class | Method | HTTP request | Description - [PaginatedAddressResponsePaging](docs/PaginatedAddressResponsePaging.md) - [PaginatedAssetWalletResponse](docs/PaginatedAssetWalletResponse.md) - [PaginatedAssetWalletResponsePaging](docs/PaginatedAssetWalletResponsePaging.md) + - [PaginatedAssetsResponse](docs/PaginatedAssetsResponse.md) - [Paging](docs/Paging.md) - [PairApiKeyRequest](docs/PairApiKeyRequest.md) - [PairApiKeyResponse](docs/PairApiKeyResponse.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index fbf32774..ada37337 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -4680,10 +4680,24 @@ paths: x-accepts: application/json /internal_wallets: get: - description: | + description: |- Gets a list of internal wallets. - **Note**: BTC-based assets belonging to whitelisted addresses cannot be retrieved between 00:00 UTC and 00:01 UTC daily due to third-party provider, Blockchair, being unavailable for this 60 second period. Please wait until the next minute to retrieve BTC-based assets. + **Note**: + - BTC-based assets belonging to whitelisted addresses cannot be + retrieved between 00:00 UTC and 00:01 UTC daily due to third-party + provider, Blockchain, being unavailable for this 60 second period. +
Please wait until the next minute to retrieve BTC-based assets. + - The list of assets returned will NOT include the balances anymore. + + Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. + + - You can see the balance of the Internal Wallet via Fireblocks + - You cannot initiate transactions from Internal Wallets through Fireblocks + + Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. operationId: getInternalWallets responses: "200": @@ -4729,7 +4743,12 @@ paths: source: response = fireblocks.internal_wallets.get_internal_wallets(); x-accepts: application/json post: - description: Creates a new internal wallet with the requested name. + description: |- + Creates a new internal wallet with the requested name. + + Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. operationId: createInternalWallet parameters: - description: "A unique identifier for the request. If the request is sent\ @@ -4803,7 +4822,14 @@ paths: x-accepts: application/json /internal_wallets/{walletId}: delete: - description: Deletes an internal wallet by ID. + description: |- + Deletes an internal wallet by ID. + Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. + + - You can see the balance of the Internal Wallet via Fireblocks + - You cannot initiate transactions from Internal Wallets through Fireblocks + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. operationId: deleteInternalWallet parameters: - description: The ID of the wallet to delete @@ -4858,7 +4884,17 @@ paths: source: response = fireblocks.internal_wallets.delete_internal_wallet(wallet_id); x-accepts: application/json get: - description: Returns all assets in an internal wallet by ID. + description: |- + Returns information for an asset in an internal wallet. + + This endpoint will be deprecated after 6 months.
As part of the depreciation process this endpoint will no longer return balances, only addresses.
Until it is deprecated, this endpoint will behave the same way. + + Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. + + - You can see the balance of the Internal Wallet via Fireblocks + - You cannot initiate transactions from Internal Wallets through Fireblocks + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. operationId: getInternalWallet parameters: - description: The ID of the wallet to return @@ -4888,7 +4924,7 @@ paths: headers: X-Request-ID: $ref: '#/components/headers/X-Request-ID' - summary: Get assets for internal wallet + summary: Get an asset from an internal wallet tags: - Internal wallets x-readme: @@ -4916,10 +4952,121 @@ paths: - lang: Python source: response = fireblocks.internal_wallets.get_internal_wallet(wallet_id); x-accepts: application/json + /internal_wallets/{walletId}/assets: + get: + description: |- + Returns a paginated response of assets in an internal wallet. + + This is a new paginated endpoint that gets all the assets from the wallet container with balances.
This endpoint returns a limited amount of results with a quick response time. + + Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. + + - You can see the balance of the Internal Wallet via Fireblocks + - You cannot initiate transactions from Internal Wallets through Fireblocks + + Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + operationId: getInternalWalletAssetsPaginated + parameters: + - description: The ID of the internal wallet to return assets for + explode: false + in: path + name: walletId + required: true + schema: + type: string + style: simple + - example: 10 + explode: true + in: query + name: pageSize + required: false + schema: + default: 50 + description: Number of assets to return per page + maximum: 200 + minimum: 1 + type: number + style: form + - explode: true + in: query + name: pageCursor + required: false + schema: + description: Cursor for pagination + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedAssetsResponse' + description: A paginated response of assets for the internal wallet + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + summary: List assets in an internal wallet (Paginated) + tags: + - Internal wallets + x-readme: + code-samples: + - language: python + code: "internalWalletAssets = fireblocks.get_internal_wallet_assets(walletId,\ + \ pageSize, pageCursor)" + name: Fireblocks SDK Python example (Legacy) + - language: javascript + code: "const internalWalletAssets = fireblocks.getInternalWalletAssets(walletId,\ + \ pageSize, pageCursor);" + name: Fireblocks SDK Javascript example + - language: typescript + code: "const response: Promise>\ + \ = fireblocks.internalWallets.getInternalWalletAssetsPaginated(internalWalletsApiGetInternalWalletAssetsPaginatedRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response\ + \ = fireblocks.internalWallets().getInternalWalletAssetsPaginated(walletId,\ + \ pageSize, pageCursor);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.internal_wallets.get_internal_wallet_assets_paginated(wallet_id,\ + \ page_size, page_cursor);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise>\ + \ = fireblocks.internalWallets.getInternalWalletAssetsPaginated(internalWalletsApiGetInternalWalletAssetsPaginatedRequest);" + - lang: Java + source: "CompletableFuture> response\ + \ = fireblocks.internalWallets().getInternalWalletAssetsPaginated(walletId,\ + \ pageSize, pageCursor);" + - lang: Python + source: "response = fireblocks.internal_wallets.get_internal_wallet_assets_paginated(wallet_id,\ + \ page_size, page_cursor);" + x-accepts: application/json /internal_wallets/{walletId}/set_customer_ref_id: post: - description: Sets an AML/KYT customer reference ID for the specific internal - wallet. + description: |- + Sets an AML/KYT customer reference ID for the specific internal wallet. + + Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. + + - You can see the balance of the Internal Wallet via Fireblocks + - You cannot initiate transactions from Internal Wallets through Fireblocks + + Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. operationId: setCustomerRefIdForInternalWallet parameters: - description: The wallet ID @@ -4999,7 +5146,17 @@ paths: x-accepts: application/json /internal_wallets/{walletId}/{assetId}: delete: - description: Deletes a whitelisted address (for an asset) from an internal wallet. + description: |- + Deletes a whitelisted address (for an asset) from an internal wallet. + + Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. + + - You can see the balance of the Internal Wallet via Fireblocks + - You cannot initiate transactions from Internal Wallets through Fireblocks + + Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. operationId: deleteInternalWalletAsset parameters: - description: The ID of the wallet @@ -5034,7 +5191,7 @@ paths: headers: X-Request-ID: $ref: '#/components/headers/X-Request-ID' - summary: Delete a whitelisted address from an internal wallet + summary: Delete a whitelisted address tags: - Internal wallets x-readme: @@ -5068,7 +5225,17 @@ paths: \ asset_id);" x-accepts: application/json get: - description: Returns information for an asset in an internal wallet. + description: |- + Returns information for an asset in an internal wallet. + + Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. + + - You can see the balance of the Internal Wallet via Fireblocks + - You cannot initiate transactions from Internal Wallets through Fireblocks + + Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. operationId: getInternalWalletAsset parameters: - description: The ID of the wallet @@ -5142,7 +5309,18 @@ paths: \ asset_id);" x-accepts: application/json post: - description: Adds an asset to an existing internal wallet. + description: |- + Adds an asset to an existing internal wallet. + + Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. + + - You can see the balance of the Internal Wallet via Fireblocks + - You cannot initiate transactions from Internal Wallets through Fireblocks + + Learn more about Whitelisted Internal Addresses + [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) + + Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. operationId: createInternalWalletAsset parameters: - description: The ID of the wallet @@ -22306,6 +22484,41 @@ components: description: Optional - Sets a customer reference ID type: string type: object + PaginatedAssetsResponse: + example: + next: next + total: 0.8008281904610115 + data: + assets: + - lockedAmount: lockedAmount + address: address + balance: balance + id: id + tag: tag + activationTime: activationTime + status: null + - lockedAmount: lockedAmount + address: address + balance: balance + id: id + tag: tag + activationTime: activationTime + status: null + name: name + id: id + customerRefId: customerRefId + properties: + total: + description: Total number of assets in the internal wallet + type: number + data: + $ref: '#/components/schemas/UnmanagedWallet' + next: + description: Cursor for the next page of results + type: string + required: + - data + type: object CreateInternalWalletAssetRequest: example: address: address @@ -24741,6 +24954,7 @@ components: * `PROGRAM_CALL` - Execute multiple instructions on Solana blockchain. The @solana/web3.js library is recommended for building program call transactions. Currently in beta and disabled * `TYPED_MESSAGE` - An off-chain message in either Ethereum Personal Message or EIP712 format. Use it to sign specific readable messages that are not actual transactions. [Learn more about typed messages](https://developers.fireblocks.com/docs/typed-message-signing). * `RAW` - An off-chain message with no predefined format. Use it to sign any message with your private key, including protocols such as blockchains and custom transaction types that are not natively supported by Fireblocks. [Learn more about raw signing transactions.](https://developers.fireblocks.com/docs/raw-message-signing) + * `APPROVE` - Enables the approve function for a smart contract or wallet to withdraw from a designated wallet. [Learn more](https://support.fireblocks.io/hc/en-us/articles/4404616097426-Amount-Cap-for-Approve-transactions). enum: - TRANSFER - BURN @@ -24749,6 +24963,7 @@ components: - MINT - RAW - TYPED_MESSAGE + - APPROVE type: string TransferPeerPathSubType: enum: @@ -33915,6 +34130,7 @@ components: - bytecode - description - name + - type type: object ContractTemplateDto: example: diff --git a/build.gradle b/build.gradle index 201e0e35..358eefb7 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'eclipse' apply plugin: 'com.diffplug.spotless' group = 'com.fireblocks.sdk' -version = '8.1.0' +version = '0.0.0' buildscript { repositories { diff --git a/docs/ContractUploadRequest.md b/docs/ContractUploadRequest.md index 38bb0796..4401f652 100644 --- a/docs/ContractUploadRequest.md +++ b/docs/ContractUploadRequest.md @@ -12,7 +12,7 @@ |**longDescription** | **String** | A full description of the contract template. May contain to break the lines | [optional] | |**bytecode** | **String** | The compiled artifact of this smart contract. Used for deployment of this contract template | | |**sourcecode** | **String** | The source code of the contract. Optional. | [optional] | -|**type** | [**TypeEnum**](#TypeEnum) | The type of the contract template | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | The type of the contract template | | |**docs** | [**ContractDoc**](ContractDoc.md) | A `natspec` compliant documentation json. Can be retrieved from the output json after compilation | [optional] | |**abi** | [**List<AbiFunction>**](AbiFunction.md) | The abi of the contract template. Necessary for displaying and for after deployment encoding | | |**attributes** | [**ContractAttributes**](ContractAttributes.md) | The attributes related to this contract template. It will be displayed in the tokenization page | [optional] | diff --git a/docs/InternalWalletsApi.md b/docs/InternalWalletsApi.md index 14adb3da..8a64ab12 100644 --- a/docs/InternalWalletsApi.md +++ b/docs/InternalWalletsApi.md @@ -7,9 +7,10 @@ All URIs are relative to https://developers.fireblocks.com/reference/ | [**createInternalWallet**](InternalWalletsApi.md#createInternalWallet) | **POST** /internal_wallets | Create an internal wallet | | [**createInternalWalletAsset**](InternalWalletsApi.md#createInternalWalletAsset) | **POST** /internal_wallets/{walletId}/{assetId} | Add an asset to an internal wallet | | [**deleteInternalWallet**](InternalWalletsApi.md#deleteInternalWallet) | **DELETE** /internal_wallets/{walletId} | Delete an internal wallet | -| [**deleteInternalWalletAsset**](InternalWalletsApi.md#deleteInternalWalletAsset) | **DELETE** /internal_wallets/{walletId}/{assetId} | Delete a whitelisted address from an internal wallet | -| [**getInternalWallet**](InternalWalletsApi.md#getInternalWallet) | **GET** /internal_wallets/{walletId} | Get assets for internal wallet | +| [**deleteInternalWalletAsset**](InternalWalletsApi.md#deleteInternalWalletAsset) | **DELETE** /internal_wallets/{walletId}/{assetId} | Delete a whitelisted address | +| [**getInternalWallet**](InternalWalletsApi.md#getInternalWallet) | **GET** /internal_wallets/{walletId} | Get an asset from an internal wallet | | [**getInternalWalletAsset**](InternalWalletsApi.md#getInternalWalletAsset) | **GET** /internal_wallets/{walletId}/{assetId} | Get an asset from an internal wallet | +| [**getInternalWalletAssetsPaginated**](InternalWalletsApi.md#getInternalWalletAssetsPaginated) | **GET** /internal_wallets/{walletId}/assets | List assets in an internal wallet (Paginated) | | [**getInternalWallets**](InternalWalletsApi.md#getInternalWallets) | **GET** /internal_wallets | List internal wallets | | [**setCustomerRefIdForInternalWallet**](InternalWalletsApi.md#setCustomerRefIdForInternalWallet) | **POST** /internal_wallets/{walletId}/set_customer_ref_id | Set an AML/KYT customer reference ID for an internal wallet | @@ -21,7 +22,7 @@ All URIs are relative to https://developers.fireblocks.com/reference/ Create an internal wallet -Creates a new internal wallet with the requested name. +Creates a new internal wallet with the requested name. Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. ### Example @@ -106,7 +107,7 @@ No authorization required Add an asset to an internal wallet -Adds an asset to an existing internal wallet. +Adds an asset to an existing internal wallet. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. ### Example @@ -195,7 +196,7 @@ No authorization required Delete an internal wallet -Deletes an internal wallet by ID. +Deletes an internal wallet by ID. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. ### Example @@ -275,9 +276,9 @@ No authorization required > CompletableFuture> deleteInternalWalletAsset deleteInternalWalletAsset(walletId, assetId) -Delete a whitelisted address from an internal wallet +Delete a whitelisted address -Deletes a whitelisted address (for an asset) from an internal wallet. +Deletes a whitelisted address (for an asset) from an internal wallet. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. ### Example @@ -359,9 +360,9 @@ No authorization required > CompletableFuture> getInternalWallet getInternalWallet(walletId) -Get assets for internal wallet +Get an asset from an internal wallet -Returns all assets in an internal wallet by ID. +Returns information for an asset in an internal wallet. This endpoint will be deprecated after 6 months. </br>As part of the depreciation process this endpoint will no longer return balances, only addresses. </br>Until it is deprecated, this endpoint will behave the same way. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. ### Example @@ -444,7 +445,7 @@ No authorization required Get an asset from an internal wallet -Returns information for an asset in an internal wallet. +Returns information for an asset in an internal wallet. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. ### Example @@ -523,13 +524,100 @@ No authorization required | **0** | Error Response | * X-Request-ID -
| +## getInternalWalletAssetsPaginated + +> CompletableFuture> getInternalWalletAssetsPaginated getInternalWalletAssetsPaginated(walletId, pageSize, pageCursor) + +List assets in an internal wallet (Paginated) + +Returns a paginated response of assets in an internal wallet. This is a new paginated endpoint that gets all the assets from the wallet container with balances. </br>This endpoint returns a limited amount of results with a quick response time. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + +### Example + +```java +// Import classes: +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.BasePath; +import com.fireblocks.sdk.Fireblocks; +import com.fireblocks.sdk.ConfigurationOptions; +import com.fireblocks.sdk.model.*; +import com.fireblocks.sdk.api.InternalWalletsApi; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class Example { + public static void main(String[] args) { + ConfigurationOptions configurationOptions = new ConfigurationOptions() + .basePath(BasePath.Sandbox) + .apiKey("my-api-key") + .secretKey("my-secret-key"); + Fireblocks fireblocks = new Fireblocks(configurationOptions); + + String walletId = "walletId_example"; // String | The ID of the internal wallet to return assets for + BigDecimal pageSize = new BigDecimal("50"); // BigDecimal | + String pageCursor = "pageCursor_example"; // String | + try { + CompletableFuture> response = fireblocks.internalWallets().getInternalWalletAssetsPaginated(walletId, pageSize, pageCursor); + 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 InternalWalletsApi#getInternalWalletAssetsPaginated"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling InternalWalletsApi#getInternalWalletAssetsPaginated"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **walletId** | **String**| The ID of the internal wallet to return assets for | | +| **pageSize** | **BigDecimal**| | [optional] [default to 50] | +| **pageCursor** | **String**| | [optional] | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A paginated response of assets for the internal wallet | * X-Request-ID -
| +| **0** | Error Response | * X-Request-ID -
| + + ## getInternalWallets > CompletableFuture>> getInternalWallets getInternalWallets() List internal wallets -Gets a list of internal wallets. **Note**: BTC-based assets belonging to whitelisted addresses cannot be retrieved between 00:00 UTC and 00:01 UTC daily due to third-party provider, Blockchair, being unavailable for this 60 second period. Please wait until the next minute to retrieve BTC-based assets. +Gets a list of internal wallets. **Note**: - BTC-based assets belonging to whitelisted addresses cannot be retrieved between 00:00 UTC and 00:01 UTC daily due to third-party provider, Blockchain, being unavailable for this 60 second period. </br>Please wait until the next minute to retrieve BTC-based assets. - The list of assets returned will NOT include the balances anymore. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. ### Example @@ -608,7 +696,7 @@ No authorization required Set an AML/KYT customer reference ID for an internal wallet -Sets an AML/KYT customer reference ID for the specific internal wallet. +Sets an AML/KYT customer reference ID for the specific internal wallet. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. ### Example diff --git a/docs/PaginatedAssetsResponse.md b/docs/PaginatedAssetsResponse.md new file mode 100644 index 00000000..39fda23c --- /dev/null +++ b/docs/PaginatedAssetsResponse.md @@ -0,0 +1,15 @@ + + +# PaginatedAssetsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**total** | **BigDecimal** | Total number of assets in the internal wallet | [optional] | +|**data** | [**UnmanagedWallet**](UnmanagedWallet.md) | | | +|**next** | **String** | Cursor for the next page of results | [optional] | + + + diff --git a/docs/TransactionOperation.md b/docs/TransactionOperation.md index f0e0d161..e47a5ba8 100644 --- a/docs/TransactionOperation.md +++ b/docs/TransactionOperation.md @@ -19,5 +19,7 @@ * `TYPED_MESSAGE` (value: `"TYPED_MESSAGE"`) +* `APPROVE` (value: `"APPROVE"`) + diff --git a/pom.xml b/pom.xml index 102964c9..94938f50 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fireblocks-sdk jar fireblocks-sdk - 8.1.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 fe6af984..9ec56d09 100644 --- a/src/main/java/com/fireblocks/sdk/Configuration.java +++ b/src/main/java/com/fireblocks/sdk/Configuration.java @@ -14,7 +14,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "8.1.0"; + public static final String VERSION = "0.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/fireblocks/sdk/api/InternalWalletsApi.java b/src/main/java/com/fireblocks/sdk/api/InternalWalletsApi.java index b29721c6..d2ea78f5 100644 --- a/src/main/java/com/fireblocks/sdk/api/InternalWalletsApi.java +++ b/src/main/java/com/fireblocks/sdk/api/InternalWalletsApi.java @@ -18,20 +18,25 @@ import com.fireblocks.sdk.ApiClient; import com.fireblocks.sdk.ApiException; import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.Pair; import com.fireblocks.sdk.ValidationUtils; import com.fireblocks.sdk.model.CreateInternalWalletAssetRequest; import com.fireblocks.sdk.model.CreateWalletRequest; +import com.fireblocks.sdk.model.PaginatedAssetsResponse; import com.fireblocks.sdk.model.SetCustomerRefIdRequest; import com.fireblocks.sdk.model.UnmanagedWallet; import com.fireblocks.sdk.model.WalletAsset; import java.io.IOException; import java.io.InputStream; +import java.math.BigDecimal; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; +import java.util.ArrayList; import java.util.List; +import java.util.StringJoiner; import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; @@ -74,7 +79,10 @@ private String formatExceptionMessage(String operationId, int statusCode, String } /** - * Create an internal wallet Creates a new internal wallet with the requested name. + * Create an internal wallet Creates a new internal wallet with the requested name. Learn more + * about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @param createWalletRequest (optional) * @param idempotencyKey A unique identifier for the request. If the request is sent multiple @@ -152,7 +160,12 @@ private HttpRequest.Builder createInternalWalletRequestBuilder( return localVarRequestBuilder; } /** - * Add an asset to an internal wallet Adds an asset to an existing internal wallet. + * Add an asset to an internal wallet Adds an asset to an existing internal wallet. Internal + * Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can see the + * balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from + * Internal Wallets through Fireblocks Learn more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @param walletId The ID of the wallet (required) * @param assetId The ID of the asset to add (required) @@ -249,7 +262,10 @@ private HttpRequest.Builder createInternalWalletAssetRequestBuilder( return localVarRequestBuilder; } /** - * Delete an internal wallet Deletes an internal wallet by ID. + * Delete an internal wallet Deletes an internal wallet by ID. Internal Wallets are whitelisted + * wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal + * Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through + * Fireblocks Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @param walletId The ID of the wallet to delete (required) * @return CompletableFuture<ApiResponse<Void>> @@ -307,8 +323,12 @@ private HttpRequest.Builder deleteInternalWalletRequestBuilder(String walletId) return localVarRequestBuilder; } /** - * Delete a whitelisted address from an internal wallet Deletes a whitelisted address (for an - * asset) from an internal wallet. + * Delete a whitelisted address Deletes a whitelisted address (for an asset) from an internal + * wallet. Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - + * You can see the balance of the Internal Wallet via Fireblocks - You cannot initiate + * transactions from Internal Wallets through Fireblocks Learn more about Whitelisted Internal + * Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) + * Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @param walletId The ID of the wallet (required) * @param assetId The ID of the asset to delete (required) @@ -371,7 +391,13 @@ private HttpRequest.Builder deleteInternalWalletAssetRequestBuilder( return localVarRequestBuilder; } /** - * Get assets for internal wallet Returns all assets in an internal wallet by ID. + * Get an asset from an internal wallet Returns information for an asset in an internal wallet. + * This endpoint will be deprecated after 6 months. </br>As part of the depreciation + * process this endpoint will no longer return balances, only addresses. </br>Until it is + * deprecated, this endpoint will behave the same way. Internal Wallets are whitelisted wallets + * that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet + * via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks + * Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * * @param walletId The ID of the wallet to return (required) * @return CompletableFuture<ApiResponse<UnmanagedWallet>> @@ -438,6 +464,11 @@ private HttpRequest.Builder getInternalWalletRequestBuilder(String walletId) } /** * Get an asset from an internal wallet Returns information for an asset in an internal wallet. + * Internal Wallets are whitelisted wallets that belong to you outside of Fireblocks. - You can + * see the balance of the Internal Wallet via Fireblocks - You cannot initiate transactions from + * Internal Wallets through Fireblocks Learn more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * * @param walletId The ID of the wallet (required) * @param assetId The ID of the asset to return (required) @@ -509,10 +540,114 @@ private HttpRequest.Builder getInternalWalletAssetRequestBuilder( return localVarRequestBuilder; } /** - * List internal wallets Gets a list of internal wallets. **Note**: BTC-based assets belonging + * List assets in an internal wallet (Paginated) Returns a paginated response of assets in an + * internal wallet. This is a new paginated endpoint that gets all the assets from the wallet + * container with balances. </br>This endpoint returns a limited amount of results with a + * quick response time. Internal Wallets are whitelisted wallets that belong to you outside of + * Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot + * initiate transactions from Internal Wallets through Fireblocks Learn more about Whitelisted + * Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + * + * @param walletId The ID of the internal wallet to return assets for (required) + * @param pageSize (optional, default to 50) + * @param pageCursor (optional) + * @return CompletableFuture<ApiResponse<PaginatedAssetsResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getInternalWalletAssetsPaginated( + String walletId, BigDecimal pageSize, String pageCursor) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + getInternalWalletAssetsPaginatedRequestBuilder(walletId, pageSize, pageCursor); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException( + "getInternalWalletAssetsPaginated", + 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< + PaginatedAssetsResponse>() {}))); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getInternalWalletAssetsPaginatedRequestBuilder( + String walletId, BigDecimal pageSize, String pageCursor) throws ApiException { + ValidationUtils.assertParamExistsAndNotEmpty( + "getInternalWalletAssetsPaginated", "walletId", walletId); + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/internal_wallets/{walletId}/assets" + .replace("{walletId}", ApiClient.urlEncode(walletId.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pageSize"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageSize", pageSize)); + localVarQueryParameterBaseName = "pageCursor"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageCursor", pageCursor)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * List internal wallets Gets a list of internal wallets. **Note**: - BTC-based assets belonging * to whitelisted addresses cannot be retrieved between 00:00 UTC and 00:01 UTC daily due to - * third-party provider, Blockchair, being unavailable for this 60 second period. Please wait - * until the next minute to retrieve BTC-based assets. + * third-party provider, Blockchain, being unavailable for this 60 second period. + * </br>Please wait until the next minute to retrieve BTC-based assets. - The list of + * assets returned will NOT include the balances anymore. Internal Wallets are whitelisted + * wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal + * Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through + * Fireblocks Learn more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * * @return CompletableFuture<ApiResponse<List<UnmanagedWallet>>> * @throws ApiException if fails to make API call @@ -576,7 +711,12 @@ private HttpRequest.Builder getInternalWalletsRequestBuilder() throws ApiExcepti } /** * Set an AML/KYT customer reference ID for an internal wallet Sets an AML/KYT customer - * reference ID for the specific internal wallet. + * reference ID for the specific internal wallet. Internal Wallets are whitelisted wallets that + * belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet via + * Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks Learn + * more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @param setCustomerRefIdRequest (required) * @param walletId The wallet ID (required) diff --git a/src/main/java/com/fireblocks/sdk/model/ContractUploadRequest.java b/src/main/java/com/fireblocks/sdk/model/ContractUploadRequest.java index 59bec1f1..1e217d1a 100644 --- a/src/main/java/com/fireblocks/sdk/model/ContractUploadRequest.java +++ b/src/main/java/com/fireblocks/sdk/model/ContractUploadRequest.java @@ -232,15 +232,15 @@ public ContractUploadRequest type(TypeEnum type) { * * @return type */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TypeEnum getType() { return type; } @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setType(TypeEnum type) { this.type = type; } diff --git a/src/main/java/com/fireblocks/sdk/model/PaginatedAssetsResponse.java b/src/main/java/com/fireblocks/sdk/model/PaginatedAssetsResponse.java new file mode 100644 index 00000000..4a78f2ad --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/PaginatedAssetsResponse.java @@ -0,0 +1,216 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** PaginatedAssetsResponse */ +@JsonPropertyOrder({ + PaginatedAssetsResponse.JSON_PROPERTY_TOTAL, + PaginatedAssetsResponse.JSON_PROPERTY_DATA, + PaginatedAssetsResponse.JSON_PROPERTY_NEXT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PaginatedAssetsResponse { + public static final String JSON_PROPERTY_TOTAL = "total"; + private BigDecimal total; + + public static final String JSON_PROPERTY_DATA = "data"; + private UnmanagedWallet data; + + public static final String JSON_PROPERTY_NEXT = "next"; + private String next; + + public PaginatedAssetsResponse() {} + + public PaginatedAssetsResponse total(BigDecimal total) { + this.total = total; + return this; + } + + /** + * Total number of assets in the internal wallet + * + * @return total + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getTotal() { + return total; + } + + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotal(BigDecimal total) { + this.total = total; + } + + public PaginatedAssetsResponse data(UnmanagedWallet data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UnmanagedWallet getData() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setData(UnmanagedWallet data) { + this.data = data; + } + + public PaginatedAssetsResponse next(String next) { + this.next = next; + return this; + } + + /** + * Cursor for the next page of results + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNext() { + return next; + } + + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNext(String next) { + this.next = next; + } + + /** Return true if this PaginatedAssetsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaginatedAssetsResponse paginatedAssetsResponse = (PaginatedAssetsResponse) o; + return Objects.equals(this.total, paginatedAssetsResponse.total) + && Objects.equals(this.data, paginatedAssetsResponse.data) + && Objects.equals(this.next, paginatedAssetsResponse.next); + } + + @Override + public int hashCode() { + return Objects.hash(total, data, next); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaginatedAssetsResponse {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `total` to the URL query string + if (getTotal() != null) { + joiner.add( + String.format( + "%stotal%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getTotal()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `data` to the URL query string + if (getData() != null) { + joiner.add(getData().toUrlQueryString(prefix + "data" + suffix)); + } + + // add `next` to the URL query string + if (getNext() != null) { + joiner.add( + String.format( + "%snext%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getNext()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/TransactionOperation.java b/src/main/java/com/fireblocks/sdk/model/TransactionOperation.java index d2350168..a66688e0 100644 --- a/src/main/java/com/fireblocks/sdk/model/TransactionOperation.java +++ b/src/main/java/com/fireblocks/sdk/model/TransactionOperation.java @@ -34,7 +34,10 @@ * off-chain message with no predefined format. Use it to sign any message with your private key, * including protocols such as blockchains and custom transaction types that are not natively * supported by Fireblocks. [Learn more about raw signing - * transactions.](https://developers.fireblocks.com/docs/raw-message-signing) + * transactions.](https://developers.fireblocks.com/docs/raw-message-signing) * `APPROVE` + * - Enables the approve function for a smart contract or wallet to withdraw from a designated + * wallet. [Learn + * more](https://support.fireblocks.io/hc/en-us/articles/4404616097426-Amount-Cap-for-Approve-transactions). */ public enum TransactionOperation { TRANSFER("TRANSFER"), @@ -49,7 +52,9 @@ public enum TransactionOperation { RAW("RAW"), - TYPED_MESSAGE("TYPED_MESSAGE"); + TYPED_MESSAGE("TYPED_MESSAGE"), + + APPROVE("APPROVE"); private String value; diff --git a/src/test/java/com/fireblocks/sdk/api/InternalWalletsApiTest.java b/src/test/java/com/fireblocks/sdk/api/InternalWalletsApiTest.java index 244b33fb..590cfaaf 100644 --- a/src/test/java/com/fireblocks/sdk/api/InternalWalletsApiTest.java +++ b/src/test/java/com/fireblocks/sdk/api/InternalWalletsApiTest.java @@ -17,9 +17,11 @@ import com.fireblocks.sdk.ApiResponse; import com.fireblocks.sdk.model.CreateInternalWalletAssetRequest; import com.fireblocks.sdk.model.CreateWalletRequest; +import com.fireblocks.sdk.model.PaginatedAssetsResponse; import com.fireblocks.sdk.model.SetCustomerRefIdRequest; import com.fireblocks.sdk.model.UnmanagedWallet; import com.fireblocks.sdk.model.WalletAsset; +import java.math.BigDecimal; import java.util.List; import java.util.concurrent.CompletableFuture; import org.junit.Ignore; @@ -34,7 +36,10 @@ public class InternalWalletsApiTest { /** * Create an internal wallet * - *

Creates a new internal wallet with the requested name. + *

Creates a new internal wallet with the requested name. Learn more about Whitelisted + * Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @throws ApiException if the Api call fails */ @@ -49,7 +54,12 @@ public void createInternalWalletTest() throws ApiException { /** * Add an asset to an internal wallet * - *

Adds an asset to an existing internal wallet. + *

Adds an asset to an existing internal wallet. Internal Wallets are whitelisted wallets + * that belong to you outside of Fireblocks. - You can see the balance of the Internal Wallet + * via Fireblocks - You cannot initiate transactions from Internal Wallets through Fireblocks + * Learn more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @throws ApiException if the Api call fails */ @@ -67,7 +77,10 @@ public void createInternalWalletAssetTest() throws ApiException { /** * Delete an internal wallet * - *

Deletes an internal wallet by ID. + *

Deletes an internal wallet by ID. Internal Wallets are whitelisted wallets that belong to + * you outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - + * You cannot initiate transactions from Internal Wallets through Fireblocks Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @throws ApiException if the Api call fails */ @@ -79,9 +92,14 @@ public void deleteInternalWalletTest() throws ApiException { } /** - * Delete a whitelisted address from an internal wallet + * Delete a whitelisted address * - *

Deletes a whitelisted address (for an asset) from an internal wallet. + *

Deletes a whitelisted address (for an asset) from an internal wallet. Internal Wallets are + * whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of + * the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets + * through Fireblocks Learn more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @throws ApiException if the Api call fails */ @@ -95,9 +113,15 @@ public void deleteInternalWalletAssetTest() throws ApiException { } /** - * Get assets for internal wallet + * Get an asset from an internal wallet * - *

Returns all assets in an internal wallet by ID. + *

Returns information for an asset in an internal wallet. This endpoint will be deprecated + * after 6 months. </br>As part of the depreciation process this endpoint will no longer + * return balances, only addresses. </br>Until it is deprecated, this endpoint will behave + * the same way. Internal Wallets are whitelisted wallets that belong to you outside of + * Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You cannot + * initiate transactions from Internal Wallets through Fireblocks Endpoint Permission: Admin, + * Non-Signing Admin, Signer, Approver, Editor, Viewer. * * @throws ApiException if the Api call fails */ @@ -110,7 +134,12 @@ public void getInternalWalletTest() throws ApiException { /** * Get an asset from an internal wallet * - *

Returns information for an asset in an internal wallet. + *

Returns information for an asset in an internal wallet. Internal Wallets are whitelisted + * wallets that belong to you outside of Fireblocks. - You can see the balance of the Internal + * Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets through + * Fireblocks Learn more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * * @throws ApiException if the Api call fails */ @@ -122,13 +151,42 @@ public void getInternalWalletAssetTest() throws ApiException { api.getInternalWalletAsset(walletId, assetId); } + /** + * List assets in an internal wallet (Paginated) + * + *

Returns a paginated response of assets in an internal wallet. This is a new paginated + * endpoint that gets all the assets from the wallet container with balances. </br>This + * endpoint returns a limited amount of results with a quick response time. Internal Wallets are + * whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance of + * the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal Wallets + * through Fireblocks Learn more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getInternalWalletAssetsPaginatedTest() throws ApiException { + String walletId = null; + BigDecimal pageSize = null; + String pageCursor = null; + CompletableFuture> response = + api.getInternalWalletAssetsPaginated(walletId, pageSize, pageCursor); + } + /** * List internal wallets * - *

Gets a list of internal wallets. **Note**: BTC-based assets belonging to whitelisted + *

Gets a list of internal wallets. **Note**: - BTC-based assets belonging to whitelisted * addresses cannot be retrieved between 00:00 UTC and 00:01 UTC daily due to third-party - * provider, Blockchair, being unavailable for this 60 second period. Please wait until the next - * minute to retrieve BTC-based assets. + * provider, Blockchain, being unavailable for this 60 second period. </br>Please wait + * until the next minute to retrieve BTC-based assets. - The list of assets returned will NOT + * include the balances anymore. Internal Wallets are whitelisted wallets that belong to you + * outside of Fireblocks. - You can see the balance of the Internal Wallet via Fireblocks - You + * cannot initiate transactions from Internal Wallets through Fireblocks Learn more about + * Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * * @throws ApiException if the Api call fails */ @@ -140,7 +198,12 @@ public void getInternalWalletsTest() throws ApiException { /** * Set an AML/KYT customer reference ID for an internal wallet * - *

Sets an AML/KYT customer reference ID for the specific internal wallet. + *

Sets an AML/KYT customer reference ID for the specific internal wallet. Internal Wallets + * are whitelisted wallets that belong to you outside of Fireblocks. - You can see the balance + * of the Internal Wallet via Fireblocks - You cannot initiate transactions from Internal + * Wallets through Fireblocks Learn more about Whitelisted Internal Addresses + * [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) Endpoint + * Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * * @throws ApiException if the Api call fails */ diff --git a/src/test/java/com/fireblocks/sdk/model/PaginatedAssetsResponseTest.java b/src/test/java/com/fireblocks/sdk/model/PaginatedAssetsResponseTest.java new file mode 100644 index 00000000..4f73b8a4 --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/PaginatedAssetsResponseTest.java @@ -0,0 +1,45 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for PaginatedAssetsResponse */ +public class PaginatedAssetsResponseTest { + private final PaginatedAssetsResponse model = new PaginatedAssetsResponse(); + + /** Model tests for PaginatedAssetsResponse */ + @Test + public void testPaginatedAssetsResponse() { + // TODO: test PaginatedAssetsResponse + } + + /** Test the property 'total' */ + @Test + public void totalTest() { + // TODO: test total + } + + /** Test the property 'data' */ + @Test + public void dataTest() { + // TODO: test data + } + + /** Test the property 'next' */ + @Test + public void nextTest() { + // TODO: test next + } +}