xrpl4j
xrpl4j copied to clipboard
A 100% Java implementation to interact with the XRP Ledger.
xrpl4j: XRP Ledger Java SDK
A pure Java implementation of the core functionality necessary to interact with the XRP Ledger. While this library does not provide a network client, it does support the difficult tasks of XRPL serialization and transaction signing, and provides useful Java bindings for XRP Ledger objects and rippled request/response objects.
Project Structure
Xrpl4j is structured as a Maven multi-module project, with the following modules:
- xrpl4j-binary-codec:
- Serializes the JSON representation of XRPL Transactions to the canonical binary format of the XRP Ledger
- xrpl4j-address-codec:
- Converts seeds, addresses, and public keys from their byte representations to the XRPL Base58Check encoding format, and vice versa
- Handles X-Address encoding and decoding
- xrpl4j-keypairs:
- Generates seeds and derives XRPL key pairs, and can be used to sign transactions and verify transaction signatures
- Supports both secp256k1 and ed25519 key types and signing algorithms
- xrpl4j-model:
- Provides Java objects which model XRP Ledger objects, as well as request parameters and response results for the rippled websocket and JSON RPC APIs
- Also provides a Jackson
ObjectMapperand JSON bindings which can be used to serialize and deserialize to and from JSON
- xrpl4j-crypto:
- xrpl4j-crypto-core: Provides core primitives like public/private keys definitions, signature interafaces and more.
- xrpl4j-crypto-bouncycastle: An implementation using BouncyCastle as the underlying library/provider.
- xrpl4j-client:
- Provides an example rippled JSON RPC client which can be used to communicate with a rippled node
- xrpl4j-integration-tests:
- Contains all of the project's integration tests, which serve as valuable xrpl4j usage examples for common XRPL flows
Documentation
- Get Started Using Java: a tutorial for building a very simple XRP Ledger-connected app.
- Example usage can be found in the
xrpl4j-integration-testsmodule.
Requirements
- JDK 1.8 or higher
- A Java project manager such as Maven or Gradle
Installation
You can use one or more xrpl4j modules in your Maven project by using the current BOM like this:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.xrpl4j</groupId>
<artifactId>xrpl4j-bom</artifactId>
<version>2.3.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Then you can add any of the xrpl4j modules found in the BOM to your pom.xml. For example, if you want to use the xrpl4j address codecs, add the following:
<dependency>
<groupId>org.xrpl</groupId>
<artifactId>xrpl4j-address-codec</artifactId>
</dependency>
Development
You can build and test the entire project locally using maven from the command line:
mvn clean install
To build the project while skipping Integration tests, use the following command:
mvn clean install -DskipITs
To build the project while skipping Unit and Integration tests, use the following command:
mvn clean install -DskipITs -DskipTests