Development

What SDKs exist for XRPL development?

Last updated:

The XRP Ledger ecosystem provides official and community-maintained SDKs in multiple programming languages, enabling developers to integrate XRPL functionality into any technology stack. Each SDK offers complete access to XRPL features including payments, DEX trading, token issuance, and NFTs.

Official SDKs

xrpl.js is the official JavaScript/TypeScript library maintained by Ripple. It works in Node.js, browsers, and React Native applications. Installation is simple with npm: `npm install xrpl`. The library provides high-level methods for common operations and low-level access to all transaction types and API endpoints. It includes TypeScript definitions for type safety and excellent IDE support.

xrpl-py is the official Python library for XRPL development. Install with pip: `pip install xrpl-py`. This library is ideal for backend services, data analysis, trading bots, and automation scripts. It provides both synchronous and asynchronous API clients, making it suitable for high-performance applications.

JavaScript/TypeScript SDK (xrpl.js)

Basic usage example:

```javascript const xrpl = require('xrpl')

async function main() { // Connect to XRPL const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233') await client.connect() // Create a wallet const wallet = xrpl.Wallet.generate() console.log('Address:', wallet.address) console.log('Seed:', wallet.seed) // Get account info const response = await client.request({ command: 'account_info', account: wallet.address, ledger_index: 'validated' }) console.log('Account Balance:', response.result.account_data.Balance) await client.disconnect() }

main() ```

Sending a payment:

```javascript const payment = { TransactionType: 'Payment', Account: wallet.address, Destination: 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', Amount: xrpl.xrpToDrops('10'), // 10 XRP }

const prepared = await client.autofill(payment) const signed = wallet.sign(prepared) const result = await client.submitAndWait(signed.tx_blob)

if (result.result.meta.TransactionResult === 'tesSUCCESS') { console.log('Payment successful!') } ```

Python SDK (xrpl-py)

Basic usage example:

```python from xrpl.clients import JsonRpcClient from xrpl.wallet import Wallet from xrpl.models.transactions import Payment from xrpl.transaction import submit_and_wait from xrpl.utils import xrp_to_drops

# Connect to XRPL client = JsonRpcClient("https://s.altnet.rippletest.net:51234")

# Create a wallet wallet = Wallet.create() print(f"Address: {wallet.address}") print(f"Seed: {wallet.seed}")

# Send payment payment = Payment( account=wallet.address, destination="rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY", amount=xrp_to_drops(10) )

response = submit_and_wait(payment, client, wallet) print(f"Transaction result: {response.result['meta']['TransactionResult']}") ```

Community SDKs

xrpl4j (Java): Official Java library for enterprise applications, Android apps, and backend services. Provides strong typing and integration with Spring Framework.

XRPL.PHP (PHP): Community-maintained PHP library for web applications and WordPress plugins. Suitable for e-commerce integrations.

XRPL-Rust: Rust library for high-performance applications requiring maximum security and speed.

xrpl-c (C/C++): Low-level library for embedded systems and performance-critical applications.

SDK Features Comparison

All official SDKs support: Connection management (WebSocket and JSON-RPC), Wallet generation and key management, Transaction signing and submission, All XRPL transaction types, Account and ledger queries, Real-time subscription to events, Binary codec for serialization, and Address codec for validation.

Choosing the Right SDK

For web applications and frontend development, use xrpl.js with React, Vue, or Angular. For backend services and APIs, use xrpl-py or xrpl4j depending on your infrastructure. For mobile apps, use xrpl.js with React Native or xrpl4j for native Android. For data analysis and trading bots, use xrpl-py with pandas and numpy integration.

Installation and Setup

JavaScript: `npm install xrpl` or `yarn add xrpl` Python: `pip install xrpl-py` Java: Add Maven dependency to pom.xml PHP: `composer require xrpl/xrpl-php`

Common Issues and Solutions

Connection timeouts: Increase timeout settings or use alternative servers. The public servers can be busy during high traffic.

Invalid transaction signatures: Ensure you're using the correct network (testnet vs mainnet) and that your wallet has sufficient XRP for fees.

WebSocket disconnections: Implement automatic reconnection logic with exponential backoff.

All SDKs are actively maintained with regular updates for new XRPL features and amendments. Check the GitHub repositories for latest versions, examples, and issue tracking.

Was this helpful?

Related Questions

Go Deeper

Expand your knowledge with these related lessons

Client Libraries Deep Dive - xrpl.js, xrpl-py, and xrpl4j

55 minintermediate

Direct XRPL Integration—Building Custom Solutions

60 minbeginner

The XRPL Communication Layer - Architecture & Design Philosophy

50 minintermediate

Have more questions?

Browse our complete FAQ or contact support.