### Get Embedded Wallet Device Setup State (Java) Source: https://github.com/fireblocks/java-sdk/blob/master/docs/EmbeddedWalletsApi.md Retrieves the setup state for a specific embedded wallet device. Ensure you have configured the Fireblocks client with your API key and secret key. This example uses the Sandbox environment. ```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.EmbeddedWalletsApi; 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 = "550e8400-e29b-41d4-a716-446655440000"; // String | Wallet Id String deviceId = "9ee1bff0-6dba-4f0c-9b75-03fe90e66fa3"; // String | Device Id try { CompletableFuture> response = fireblocks.embeddedWallets().getEmbeddedWalletDeviceSetupState(walletId, deviceId); 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 EmbeddedWalletsApi#getEmbeddedWalletDeviceSetupState"); 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 EmbeddedWalletsApi#getEmbeddedWalletDeviceSetupState"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### Get Payout Status Example Source: https://github.com/fireblocks/java-sdk/blob/master/docs/PaymentsPayoutApi.md Demonstrates how to retrieve the status of a payout instruction set using the getPayout method. Ensure you have the necessary API key and secret key configured. This example handles potential exceptions during the API call. ```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.PaymentsPayoutApi; 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 payoutId = "1fe3b61f-7e1f-4a19-aff0-4f0a524d44d7"; // String | the payout id received from the creation of the payout instruction set try { CompletableFuture> response = fireblocks.paymentsPayout().getPayout(payoutId); 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 PaymentsPayoutApi#getPayout"); 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 PaymentsPayoutApi#getPayout"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### getEmbeddedWalletDeviceSetupState Source: https://github.com/fireblocks/java-sdk/blob/master/docs/EmbeddedWalletsApi.md Get device key setup state. ```APIDOC ## GET /ncw/wallets/{walletId}/devices/{deviceId}/setup_status ### Description Get device key setup state. ### Method GET ### Endpoint /ncw/wallets/{walletId}/devices/{deviceId}/setup_status ### Parameters #### Path Parameters - **walletId** (string) - Required - The ID of the wallet. - **deviceId** (string) - Required - The ID of the device. ``` -------------------------------- ### Get Users List Example Source: https://github.com/fireblocks/java-sdk/blob/master/docs/UsersApi.md Demonstrates how to list all users for a workspace using the Fireblocks Java SDK. This method requires API keys with Admin permissions. Ensure you have the necessary imports and configure the Fireblocks client with your API key and secret key. ```java 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.UsersApi; 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); try { CompletableFuture>> response = fireblocks.users().getUsers(); 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 UsersApi#getUsers"); 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 UsersApi#getUsers"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### Get Staking Providers Source: https://github.com/fireblocks/java-sdk/blob/master/docs/StakingApi.md Retrieves a list of all available staking providers. This example demonstrates how to initialize the Fireblocks client and call the getProviders method, handling both successful responses and API exceptions. ```java 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.StakingApi; 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); try { CompletableFuture>> response = fireblocks.staking().getProviders(); 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 StakingApi#getProviders"); 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 StakingApi#getProviders"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### Get Trading Providers Example Source: https://github.com/fireblocks/java-sdk/blob/master/docs/TradingBetaApi.md This Java code snippet demonstrates how to retrieve a list of trading providers using the Fireblocks SDK. It shows the necessary imports, API client configuration, and how to handle both successful responses and API exceptions. ```java 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.TradingBetaApi; 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); Integer pageSize = 20; // Integer | Page size for pagination. String pageCursor = "pageCursor_example"; // String | Page cursor for pagination. try { CompletableFuture> response = fireblocks.tradingBeta().getTradingProviders(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 TradingBetaApi#getTradingProviders"); 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 TradingBetaApi#getTradingProviders"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### ConfigOperation Examples Source: https://github.com/fireblocks/java-sdk/blob/master/docs/ConfigOperation.md Demonstrates creating and setting different ConfigOperation subtypes (Conversion, Disbursement, Transfer) and retrieving them. ```java // Import classes: import com.fireblocks.sdk.model.ConfigOperation; import com.fireblocks.sdk.model.ConversionConfigOperation; import com.fireblocks.sdk.model.DisbursementConfigOperation; import com.fireblocks.sdk.model.TransferConfigOperation; public class Example { public static void main(String[] args) { ConfigOperation exampleConfigOperation = new ConfigOperation(); // create a new ConversionConfigOperation ConversionConfigOperation exampleConversionConfigOperation = new ConversionConfigOperation(); // set ConfigOperation to ConversionConfigOperation exampleConfigOperation.setActualInstance(exampleConversionConfigOperation); // to get back the ConversionConfigOperation set earlier ConversionConfigOperation testConversionConfigOperation = (ConversionConfigOperation) exampleConfigOperation.getActualInstance(); // create a new DisbursementConfigOperation DisbursementConfigOperation exampleDisbursementConfigOperation = new DisbursementConfigOperation(); // set ConfigOperation to DisbursementConfigOperation exampleConfigOperation.setActualInstance(exampleDisbursementConfigOperation); // to get back the DisbursementConfigOperation set earlier DisbursementConfigOperation testDisbursementConfigOperation = (DisbursementConfigOperation) exampleConfigOperation.getActualInstance(); // create a new TransferConfigOperation TransferConfigOperation exampleTransferConfigOperation = new TransferConfigOperation(); // set ConfigOperation to TransferConfigOperation exampleConfigOperation.setActualInstance(exampleTransferConfigOperation); // to get back the TransferConfigOperation set earlier TransferConfigOperation testTransferConfigOperation = (TransferConfigOperation) exampleConfigOperation.getActualInstance(); } } ``` -------------------------------- ### Get Embedded Wallet Setup Status Source: https://github.com/fireblocks/java-sdk/blob/master/docs/EmbeddedWalletsApi.md Retrieves the setup status for a given embedded wallet ID. This example demonstrates initializing the Fireblocks client and handling API responses and exceptions. ```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.EmbeddedWalletsApi; 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 = "550e8400-e29b-41d4-a716-446655440000"; // String | Wallet Id try { CompletableFuture> response = fireblocks.embeddedWallets().getEmbeddedWalletSetupStatus(walletId); 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 EmbeddedWalletsApi#getEmbeddedWalletSetupStatus"); 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 EmbeddedWalletsApi#getEmbeddedWalletSetupStatus"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### Using InitiatorConfigPattern with InitiatorConfig and String Source: https://github.com/fireblocks/java-sdk/blob/master/docs/InitiatorConfigPattern.md Demonstrates how to create an InitiatorConfigPattern and set either an InitiatorConfig or a String instance to it. Shows how to retrieve the set instance. ```java import com.fireblocks.sdk.model.InitiatorConfigPattern; import com.fireblocks.sdk.model.InitiatorConfig; import com.fireblocks.sdk.model.String; public class Example { public static void main(String[] args) { InitiatorConfigPattern exampleInitiatorConfigPattern = new InitiatorConfigPattern(); // create a new InitiatorConfig InitiatorConfig exampleInitiatorConfig = new InitiatorConfig(); // set InitiatorConfigPattern to InitiatorConfig exampleInitiatorConfigPattern.setActualInstance(exampleInitiatorConfig); // to get back the InitiatorConfig set earlier InitiatorConfig testInitiatorConfig = (InitiatorConfig) exampleInitiatorConfigPattern.getActualInstance(); // create a new String String exampleString = new String(); // set InitiatorConfigPattern to String exampleInitiatorConfigPattern.setActualInstance(exampleString); // to get back the String set earlier String testString = (String) exampleInitiatorConfigPattern.getActualInstance(); } } ``` -------------------------------- ### Get Embedded Wallet Device Setup State Source: https://github.com/fireblocks/java-sdk/blob/master/docs/EmbeddedWalletsApi.md Retrieves the setup state of a specific device setup key under a non-custodial wallet. ```APIDOC ## GET /embeddedWallets/{walletId}/devices/{deviceId}/setupState ### Description Get the state of the specific device setup key under a specific Non Custodial Wallet. ### Method GET ### Endpoint /embeddedWallets/{walletId}/devices/{deviceId}/setupState ### Parameters #### Path Parameters - **walletId** (String) - Required - Wallet Id - **deviceId** (String) - Required - Device Id ### Response #### Success Response (200) - **EmbeddedWalletDeviceKeySetupResponse** (EmbeddedWalletDeviceKeySetupResponse) - Successful response body containing the device key setup state. #### Response Example ```json { "example": "response body" } ``` ### HTTP request headers - **Accept**: application/json ### HTTP response details | Status code | Description | |-------------|-------------| | **200** | Successful response | | **0** | Error Response | ``` -------------------------------- ### Fetch All Offers using Java SDK Source: https://github.com/fireblocks/java-sdk/blob/master/docs/TradingBetaApi.md Demonstrates how to fetch all available offers using the TradingBetaApi in the Java SDK. It includes setting up the API client, making the request with an idempotency key, and handling both successful responses and API exceptions. ```java 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.TradingBetaApi; 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); CreateOffersRequest createOffersRequest = new CreateOffersRequest(); // CreateOffersRequest | 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.tradingBeta().fetchAllOffers(createOffersRequest, 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 TradingBetaApi#fetchAllOffers"); 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 TradingBetaApi#fetchAllOffers"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### Java SDK Settlement Example Source: https://github.com/fireblocks/java-sdk/blob/master/docs/Settlement.md Demonstrates how to create and manage DVPSettlement and PrefundedSettlement objects using the Fireblocks Java SDK. Ensure necessary classes are imported before use. ```java // Import classes: import com.fireblocks.sdk.model.Settlement; import com.fireblocks.sdk.model.DVPSettlement; import com.fireblocks.sdk.model.PrefundedSettlement; public class Example { public static void main(String[] args) { Settlement exampleSettlement = new Settlement(); // create a new DVPSettlement DVPSettlement exampleDVPSettlement = new DVPSettlement(); // set Settlement to DVPSettlement exampleSettlement.setActualInstance(exampleDVPSettlement); // to get back the DVPSettlement set earlier DVPSettlement testDVPSettlement = (DVPSettlement) exampleSettlement.getActualInstance(); // create a new PrefundedSettlement PrefundedSettlement examplePrefundedSettlement = new PrefundedSettlement(); // set Settlement to PrefundedSettlement exampleSettlement.setActualInstance(examplePrefundedSettlement); // to get back the PrefundedSettlement set earlier PrefundedSettlement testPrefundedSettlement = (PrefundedSettlement) exampleSettlement.getActualInstance(); } } ``` -------------------------------- ### Get Embedded Wallet Setup Status Source: https://github.com/fireblocks/java-sdk/blob/master/docs/EmbeddedWalletsApi.md Retrieves the key setup state for a specific Non-Custodial Wallet. This includes information about required algorithms and the device setup status. ```APIDOC ## GET /embedded/wallets/{walletId}/setup-status ### Description Retrieves the key setup state for a specific Non-Custodial Wallet, including required algorithms and device setup status. ### Method GET ### Endpoint /embedded/wallets/{walletId}/setup-status ### Parameters #### Path Parameters - **walletId** (String) - Required - The ID of the Non-Custodial wallet ### Response #### Success Response (200) - **EmbeddedWalletSetupStatusResponse** (EmbeddedWalletSetupStatusResponse) - The setup status of the embedded wallet. #### Response Example ```json { "walletId": "550e8400-e29b-41d4-a716-446655440000", "setupStatus": "COMPLETE", "requiredAlgorithms": ["ED25519", "SECP256K1"], "deviceSetupStatus": "READY" } ``` ### Error Handling - **0** - Error Response ``` -------------------------------- ### Create and Use CreateConnectionRequest Source: https://github.com/fireblocks/java-sdk/blob/master/docs/CreateConnectionRequest.md Demonstrates how to instantiate CreateConnectionRequest and set either a CreateNcwConnectionRequest or a CreateVaultAccountConnectionRequest as its actual instance. Also shows how to retrieve the set instance. ```java import com.fireblocks.sdk.model.CreateConnectionRequest; import com.fireblocks.sdk.model.CreateNcwConnectionRequest; import com.fireblocks.sdk.model.CreateVaultAccountConnectionRequest; public class Example { public static void main(String[] args) { CreateConnectionRequest exampleCreateConnectionRequest = new CreateConnectionRequest(); // create a new CreateNcwConnectionRequest CreateNcwConnectionRequest exampleCreateNcwConnectionRequest = new CreateNcwConnectionRequest(); // set CreateConnectionRequest to CreateNcwConnectionRequest exampleCreateConnectionRequest.setActualInstance(exampleCreateNcwConnectionRequest); // to get back the CreateNcwConnectionRequest set earlier CreateNcwConnectionRequest testCreateNcwConnectionRequest = (CreateNcwConnectionRequest) exampleCreateConnectionRequest.getActualInstance(); // create a new CreateVaultAccountConnectionRequest CreateVaultAccountConnectionRequest exampleCreateVaultAccountConnectionRequest = new CreateVaultAccountConnectionRequest(); // set CreateConnectionRequest to CreateVaultAccountConnectionRequest exampleCreateConnectionRequest.setActualInstance(exampleCreateVaultAccountConnectionRequest); // to get back the CreateVaultAccountConnectionRequest set earlier CreateVaultAccountConnectionRequest testCreateVaultAccountConnectionRequest = (CreateVaultAccountConnectionRequest) exampleCreateConnectionRequest.getActualInstance(); } } ``` -------------------------------- ### getEmbeddedWalletSetupStatus Source: https://github.com/fireblocks/java-sdk/blob/master/docs/EmbeddedWalletsApi.md Get wallet key setup state. ```APIDOC ## GET /ncw/wallets/{walletId}/setup_status ### Description Get wallet key setup state. ### Method GET ### Endpoint /ncw/wallets/{walletId}/setup_status ### Parameters #### Path Parameters - **walletId** (string) - Required - The ID of the wallet. ``` -------------------------------- ### DisbursementInstruction Example Source: https://github.com/fireblocks/java-sdk/blob/master/docs/DisbursementInstruction.md Demonstrates creating and setting both DisbursementAmountInstruction and DisbursementPercentageInstruction within a DisbursementInstruction object. Ensure necessary classes are imported. ```java import com.fireblocks.sdk.model.DisbursementInstruction; import com.fireblocks.sdk.model.DisbursementAmountInstruction; import com.fireblocks.sdk.model.DisbursementPercentageInstruction; public class Example { public static void main(String[] args) { DisbursementInstruction exampleDisbursementInstruction = new DisbursementInstruction(); // create a new DisbursementAmountInstruction DisbursementAmountInstruction exampleDisbursementAmountInstruction = new DisbursementAmountInstruction(); // set DisbursementInstruction to DisbursementAmountInstruction exampleDisbursementInstruction.setActualInstance(exampleDisbursementAmountInstruction); // to get back the DisbursementAmountInstruction set earlier DisbursementAmountInstruction testDisbursementAmountInstruction = (DisbursementAmountInstruction) exampleDisbursementInstruction.getActualInstance(); // create a new DisbursementPercentageInstruction DisbursementPercentageInstruction exampleDisbursementPercentageInstruction = new DisbursementPercentageInstruction(); // set DisbursementInstruction to DisbursementPercentageInstruction exampleDisbursementInstruction.setActualInstance(exampleDisbursementPercentageInstruction); // to get back the DisbursementPercentageInstruction set earlier DisbursementPercentageInstruction testDisbursementPercentageInstruction = (DisbursementPercentageInstruction) exampleDisbursementInstruction.getActualInstance(); } } ``` -------------------------------- ### EmbeddedWalletsApi - getEmbeddedWalletSetupStatus Source: https://github.com/fireblocks/java-sdk/blob/master/README.md Get the setup status of an embedded wallet. ```APIDOC ## GET /ncw/wallets/{walletId}/setup_status ### Description Get the setup status of an embedded wallet. ### Method GET ### Endpoint /ncw/wallets/{walletId}/setup_status ### Parameters #### Path Parameters - **walletId** (string) - Required - The ID of the wallet. ``` -------------------------------- ### Link Token Example (Java) Source: https://github.com/fireblocks/java-sdk/blob/master/docs/TokenizationApi.md Demonstrates how to link a token using the Tokenization API. Ensure you have the necessary API key and secret key configured. The idempotency key helps prevent duplicate requests. ```java 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.TokenizationApi; 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); TokenLinkRequestDto tokenLinkRequestDto = new TokenLinkRequestDto(); // TokenLinkRequestDto | 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.tokenization().link(tokenLinkRequestDto, 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 TokenizationApi#link"); 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 TokenizationApi#link"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### Get Embedded Wallet Setup Status Source: https://github.com/fireblocks/java-sdk/blob/master/docs/EmbeddedWalletsApi.md Retrieves the setup status of an embedded wallet. This is useful for checking if a wallet has been successfully provisioned and is ready for use. ```APIDOC ## GET /embedded-wallets/{walletId}/setup-status ### Description Retrieves the setup status of a specific embedded wallet. ### Method GET ### Endpoint /embedded-wallets/{walletId}/setup-status ### Parameters #### Path Parameters - **walletId** (String) - Required - The unique identifier of the wallet. ### Response #### Success Response (200) - **EmbeddedWalletSetupStatusResponse** (EmbeddedWalletSetupStatusResponse) - Details about the embedded wallet's setup status. #### Response Example ```json { "status": "COMPLETED", "walletId": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Error Handling - **0** - An error occurred during the request. The response body will contain details about the error. ``` -------------------------------- ### DelegationBlockchainPositionInfo Usage Example Source: https://github.com/fireblocks/java-sdk/blob/master/docs/DelegationBlockchainPositionInfo.md Demonstrates how to create and use DelegationBlockchainPositionInfo with different blockchain data types (Ethereum, Solana, StEth). Requires importing the necessary model classes. ```java import com.fireblocks.sdk.model.DelegationBlockchainPositionInfo; import com.fireblocks.sdk.model.EthereumBlockchainData; import com.fireblocks.sdk.model.SolanaBlockchainData; import com.fireblocks.sdk.model.StEthBlockchainData; public class Example { public static void main(String[] args) { DelegationBlockchainPositionInfo exampleDelegationBlockchainPositionInfo = new DelegationBlockchainPositionInfo(); // create a new EthereumBlockchainData EthereumBlockchainData exampleEthereumBlockchainData = new EthereumBlockchainData(); // set DelegationBlockchainPositionInfo to EthereumBlockchainData exampleDelegationBlockchainPositionInfo.setActualInstance(exampleEthereumBlockchainData); // to get back the EthereumBlockchainData set earlier EthereumBlockchainData testEthereumBlockchainData = (EthereumBlockchainData) exampleDelegationBlockchainPositionInfo.getActualInstance(); // create a new SolanaBlockchainData SolanaBlockchainData exampleSolanaBlockchainData = new SolanaBlockchainData(); // set DelegationBlockchainPositionInfo to SolanaBlockchainData exampleDelegationBlockchainPositionInfo.setActualInstance(exampleSolanaBlockchainData); // to get back the SolanaBlockchainData set earlier SolanaBlockchainData testSolanaBlockchainData = (SolanaBlockchainData) exampleDelegationBlockchainPositionInfo.getActualInstance(); // create a new StEthBlockchainData StEthBlockchainData exampleStEthBlockchainData = new StEthBlockchainData(); // set DelegationBlockchainPositionInfo to StEthBlockchainData exampleDelegationBlockchainPositionInfo.setActualInstance(exampleStEthBlockchainData); // to get back the StEthBlockchainData set earlier StEthBlockchainData testStEthBlockchainData = (StEthBlockchainData) exampleDelegationBlockchainPositionInfo.getActualInstance(); } } ``` -------------------------------- ### EmbeddedWalletsApi - getEmbeddedWalletDeviceSetupState Source: https://github.com/fireblocks/java-sdk/blob/master/README.md Get the setup state of an embedded wallet device. ```APIDOC ## GET /ncw/wallets/{walletId}/devices/{deviceId}/setup_status ### Description Get the setup state of an embedded wallet device. ### Method GET ### Endpoint /ncw/wallets/{walletId}/devices/{deviceId}/setup_status ### Parameters #### Path Parameters - **walletId** (string) - Required - The ID of the wallet. - **deviceId** (string) - Required - The ID of the device. ``` -------------------------------- ### Java SDK ConfigOperationSnapshot Example Source: https://github.com/fireblocks/java-sdk/blob/master/docs/ConfigOperationSnapshot.md Demonstrates how to use ConfigOperationSnapshot to hold and retrieve different types of operation snapshots (Conversion, Disbursement, Transfer) in Java. Ensure you have the necessary SDK classes imported. ```java import com.fireblocks.sdk.model.ConfigOperationSnapshot; import com.fireblocks.sdk.model.ConfigConversionOperationSnapshot; import com.fireblocks.sdk.model.ConfigDisbursementOperationSnapshot; import com.fireblocks.sdk.model.ConfigTransferOperationSnapshot; public class Example { public static void main(String[] args) { ConfigOperationSnapshot exampleConfigOperationSnapshot = new ConfigOperationSnapshot(); // create a new ConfigConversionOperationSnapshot ConfigConversionOperationSnapshot exampleConfigConversionOperationSnapshot = new ConfigConversionOperationSnapshot(); // set ConfigOperationSnapshot to ConfigConversionOperationSnapshot exampleConfigOperationSnapshot.setActualInstance(exampleConfigConversionOperationSnapshot); // to get back the ConfigConversionOperationSnapshot set earlier ConfigConversionOperationSnapshot testConfigConversionOperationSnapshot = (ConfigConversionOperationSnapshot) exampleConfigOperationSnapshot.getActualInstance(); // create a new ConfigDisbursementOperationSnapshot ConfigDisbursementOperationSnapshot exampleConfigDisbursementOperationSnapshot = new ConfigDisbursementOperationSnapshot(); // set ConfigOperationSnapshot to ConfigDisbursementOperationSnapshot exampleConfigOperationSnapshot.setActualInstance(exampleConfigDisbursementOperationSnapshot); // to get back the ConfigDisbursementOperationSnapshot set earlier ConfigDisbursementOperationSnapshot testConfigDisbursementOperationSnapshot = (ConfigDisbursementOperationSnapshot) exampleConfigOperationSnapshot.getActualInstance(); // create a new ConfigTransferOperationSnapshot ConfigTransferOperationSnapshot exampleConfigTransferOperationSnapshot = new ConfigTransferOperationSnapshot(); // set ConfigOperationSnapshot to ConfigTransferOperationSnapshot exampleConfigOperationSnapshot.setActualInstance(exampleConfigTransferOperationSnapshot); // to get back the ConfigTransferOperationSnapshot set earlier ConfigTransferOperationSnapshot testConfigTransferOperationSnapshot = (ConfigTransferOperationSnapshot) exampleConfigOperationSnapshot.getActualInstance(); } } ``` -------------------------------- ### Create Order using TradingBetaApi Source: https://github.com/fireblocks/java-sdk/blob/master/docs/TradingBetaApi.md Demonstrates how to create a buy or sell order using the TradingBetaApi. Requires setting up the Fireblocks client with API credentials and specifying order details. Handles potential API exceptions. ```java 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.TradingBetaApi; 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); CreateOrderRequest createOrderRequest = new CreateOrderRequest(); // CreateOrderRequest | 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.tradingBeta().createOrder(createOrderRequest, 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 TradingBetaApi#createOrder"); 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 TradingBetaApi#createOrder"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### addExchangeAccount Source: https://github.com/fireblocks/java-sdk/blob/master/docs/ExchangeAccountsApi.md Add an exchange account to exchanges. This endpoint currently supports a specific list of exchanges and provides a guide for setup. ```APIDOC ## addExchangeAccount ### Description Add an exchange account to exchanges. Note: This endpoint currently only supports the following exchanges `INDEPENDENT_RESERVE`,`BIT`,`BITHUMB`,`BITSO`,`CRYPTOCOM`,`BYBIT_V2`,`WHITEBIT`,`HITBTC`,`GEMINI`,`HUOBI`,`GATEIO`,`COINHAKO`,`BULLISH`,`BITGET`, and `LUNO`. To add an exchange account, please use the following [guide](https://developers.fireblocks.com/docs/add-an-exchange-account). ### Method POST ### Endpoint /exchange_accounts ### Parameters #### Request Body - **addExchangeAccountRequest** (AddExchangeAccountRequest) - Required - - **idempotencyKey** (string) - Required - 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. ### Response #### Success Response (200) - **AddExchangeAccountResponse** (AddExchangeAccountResponse) - Description ``` -------------------------------- ### CreateConfigOperationRequest Example Source: https://github.com/fireblocks/java-sdk/blob/master/docs/CreateConfigOperationRequest.md Demonstrates how to create and set different types of configuration operation requests (Conversion, Disbursement, Transfer) using the CreateConfigOperationRequest class. It also shows how to retrieve the set instance. ```java // Import classes: import com.fireblocks.sdk.model.CreateConfigOperationRequest; import com.fireblocks.sdk.model.CreateConversionConfigOperationRequest; import com.fireblocks.sdk.model.CreateDisbursementConfigOperationRequest; import com.fireblocks.sdk.model.CreateTransferConfigOperationRequest; public class Example { public static void main(String[] args) { CreateConfigOperationRequest exampleCreateConfigOperationRequest = new CreateConfigOperationRequest(); // create a new CreateConversionConfigOperationRequest CreateConversionConfigOperationRequest exampleCreateConversionConfigOperationRequest = new CreateConversionConfigOperationRequest(); // set CreateConfigOperationRequest to CreateConversionConfigOperationRequest exampleCreateConfigOperationRequest.setActualInstance(exampleCreateConversionConfigOperationRequest); // to get back the CreateConversionConfigOperationRequest set earlier CreateConversionConfigOperationRequest testCreateConversionConfigOperationRequest = (CreateConversionConfigOperationRequest) exampleCreateConfigOperationRequest.getActualInstance(); // create a new CreateDisbursementConfigOperationRequest CreateDisbursementConfigOperationRequest exampleCreateDisbursementConfigOperationRequest = new CreateDisbursementConfigOperationRequest(); // set CreateConfigOperationRequest to CreateDisbursementConfigOperationRequest exampleCreateConfigOperationRequest.setActualInstance(exampleCreateDisbursementConfigOperationRequest); // to get back the CreateDisbursementConfigOperationRequest set earlier CreateDisbursementConfigOperationRequest testCreateDisbursementConfigOperationRequest = (CreateDisbursementConfigOperationRequest) exampleCreateConfigOperationRequest.getActualInstance(); // create a new CreateTransferConfigOperationRequest CreateTransferConfigOperationRequest exampleCreateTransferConfigOperationRequest = new CreateTransferConfigOperationRequest(); // set CreateConfigOperationRequest to CreateTransferConfigOperationRequest exampleCreateConfigOperationRequest.setActualInstance(exampleCreateTransferConfigOperationRequest); // to get back the CreateTransferConfigOperationRequest set earlier CreateTransferConfigOperationRequest testCreateTransferConfigOperationRequest = (CreateTransferConfigOperationRequest) exampleCreateConfigOperationRequest.getActualInstance(); } } ``` -------------------------------- ### Get TRLink Partners Source: https://github.com/fireblocks/java-sdk/blob/master/docs/TrLinkApi.md Retrieves a list of TRLink partners. This example demonstrates how to initialize the Fireblocks SDK, make the API call, and handle both successful responses and exceptions. ```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.TrLinkApi; 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); try { CompletableFuture>> response = fireblocks.trLink().getTRLinkPartners(); 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 TrLinkApi#getTRLinkPartners"); 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 TrLinkApi#getTRLinkPartners"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### Get Smart Transfer Statistics Source: https://github.com/fireblocks/java-sdk/blob/master/docs/SmartTransferApi.md Retrieves the statistics for Smart Transfer. Ensure you have configured the ApiClient with your API key and secret key. This example uses the Sandbox environment. ```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.SmartTransferApi; 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); try { CompletableFuture> response = fireblocks.smartTransfer().getSmartTransferStatistic(); 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 SmartTransferApi#getSmartTransferStatistic"); 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 SmartTransferApi#getSmartTransferStatistic"); System.err.println("Status code: " + e.getCode()); System.err.println("Response headers: " + e.getResponseHeaders()); System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } } ``` -------------------------------- ### Instantiate and Use AssetTypesConfigInner with String Source: https://github.com/fireblocks/java-sdk/blob/master/docs/AssetTypesConfigInner.md Demonstrates how to create an AssetTypesConfigInner object and set a String instance to it. Also shows how to retrieve the String instance. ```java // Import classes: import com.fireblocks.sdk.model.AssetTypesConfigInner; import com.fireblocks.sdk.model.String; public class Example { public static void main(String[] args) { AssetTypesConfigInner exampleAssetTypesConfigInner = new AssetTypesConfigInner(); // create a new String String exampleString = new String(); // set AssetTypesConfigInner to String exampleAssetTypesConfigInner.setActualInstance(exampleString); // to get back the String set earlier String testString = (String) exampleAssetTypesConfigInner.getActualInstance(); } } ``` -------------------------------- ### TradingProvider with AccountBasedAccessProvider and DirectAccessProvider Source: https://github.com/fireblocks/java-sdk/blob/master/docs/TradingProvider.md Demonstrates how to instantiate TradingProvider and set it with either an AccountBasedAccessProvider or a DirectAccessProvider. This is useful when you need to dynamically switch between different access provider types. ```java // Import classes: import com.fireblocks.sdk.model.TradingProvider; import com.fireblocks.sdk.model.AccountBasedAccessProvider; import com.fireblocks.sdk.model.DirectAccessProvider; public class Example { public static void main(String[] args) { TradingProvider exampleTradingProvider = new TradingProvider(); // create a new AccountBasedAccessProvider AccountBasedAccessProvider exampleAccountBasedAccessProvider = new AccountBasedAccessProvider(); // set TradingProvider to AccountBasedAccessProvider exampleTradingProvider.setActualInstance(exampleAccountBasedAccessProvider); // to get back the AccountBasedAccessProvider set earlier AccountBasedAccessProvider testAccountBasedAccessProvider = (AccountBasedAccessProvider) exampleTradingProvider.getActualInstance(); // create a new DirectAccessProvider DirectAccessProvider exampleDirectAccessProvider = new DirectAccessProvider(); // set TradingProvider to DirectAccessProvider exampleTradingProvider.setActualInstance(exampleDirectAccessProvider); // to get back the DirectAccessProvider set earlier DirectAccessProvider testDirectAccessProvider = (DirectAccessProvider) exampleTradingProvider.getActualInstance(); } } ```