SDK github repo
Taurus-PROTECT Java SDK
This repository provides example Java code to consume some of the APIs of Taurus-PROTECT, covering:
- Wallet and deposit address lifecycle management
- Transactions creation and approval
- Querying blockchain assets and transaction history
- Compliance and governance operations
Repository: https://github.com/taurushq-io/taurus-protect-sdk-java
Modules
This repository contains two Java modules:
- openapi: Auto-generated from Taurus OpenAPI specifications. This module should not be modified.
- client: Higher-level Java code based on the openapi module. This is the recommended interface to interact with Taurus-PROTECT APIs.
Build
The SDK requires Java 8 (tested with Amazon Corretto 8) and Maven.
To compile the SDK, run:
mvn clean compile
To install the SDK locally, run:
mvn clean install
Usage
To start interacting with Taurus-PROTECT APIs, create a ProtectClient
instance with your host and credentials:
String host = "http://localhost:6000"; // Replace with your Taurus-PROTECT instance
String apiKey = "your-api-key";
String apiSecret = "your-api-secret";
ProtectClient client = new ProtectClient(host, apiKey, apiSecret);
Example: Create an Address
try {
Address a = client.getAddressService().createAddress(
1, // Wallet ID
"My Address", // Address name
"Optional comment",
"" // Empty string to generate address
);
System.out.println("Created address: " + a);
} catch (ApiException e) {
System.out.println("API error: " + e.getMessage());
System.out.println("Details: " + e.getError());
throw new RuntimeException(e);
}
More examples are available in the client/src/test/java directory.
Notes
- Use the
client
module for all API interactions. - The
openapi
module is auto-generated and should not be manually modified.
License
This SDK is provided under the Apache 2.0 License.
Updated 2 days ago