PHPackages                             hardcastle/xrpl\_php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hardcastle/xrpl\_php

ActiveLibrary[API Development](/categories/api)

hardcastle/xrpl\_php
====================

PHP SDK / Client for the XRP Ledger

1.1.0(1mo ago)129.7k↓20%5[1 PRs](https://github.com/AlexanderBuzz/xrpl-php/pulls)4MITPHPCI passing

Since Nov 4Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/AlexanderBuzz/xrpl-php)[ Packagist](https://packagist.org/packages/hardcastle/xrpl_php)[ RSS](/packages/hardcastle-xrpl-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (23)Versions (45)Used By (4)

PHP XRPL
========

[](#php-xrpl)

PHP SDK / Client Library to interact with the XRP Ledger and the Xahau Network. It offers all the functionality available in the JavaScript and Java Versions emphasizing robustness and code readability for those interested in looking under the hood and getting into the nitty-gritty of XRPL development.

[![Latest Stable Version](https://camo.githubusercontent.com/4c04c6f151a54cd53f0300ab2022e462ea7154f592954a59c77c0555c95461cd/68747470733a2f2f706f7365722e707567782e6f72672f68617264636173746c652f7872706c5f7068702f76657273696f6e2e737667)](https://packagist.org/packages/hardcastle/xrpl_php)[![Total Downloads](https://camo.githubusercontent.com/8470106609951c11efe7018aeceb644beebd068fe5d8dbdf7440bd97d8405163/68747470733a2f2f706f7365722e707567782e6f72672f68617264636173746c652f7872706c5f7068702f642f746f74616c2e737667)](https://packagist.org/packages/hardcastle/xrpl_php)[![PHPUnit](https://github.com/AlexanderBuzz/xrpl-php/actions/workflows/unit_test.yml/badge.svg)](https://phpunit.de/index.html)[![License](https://camo.githubusercontent.com/95c61c397ca3825757ec835268e50886b2c10ddc4f0676e1222b19037610927f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4953432d626c75652e737667)](http://opensource.org/licenses/ISC)

Features
--------

[](#features)

1. Managing &amp; creating keys and wallets
2. Submitting transactions to the XRP Ledger
3. Sending requests to observe the ledger
4. Creating and signing transactions (e.g. Payments) to modify the ledger state
5. Parsing ledger data into more convenient formats
6. Xahau Network Compatibility(Hooks, UNLReport, GenesisMint, etc.)

Installation
------------

[](#installation)

This library is installable via [Composer](https://getcomposer.org/):

`composer require hardcastle/xrpl_php`

Requirements
------------

[](#requirements)

This library requires PHP 8.1 or later as well as the PHP extension [GMP](http://php.net/manual/en/book.gmp.php).

Examples
--------

[](#examples)

### The "Quickstart" Examples

[](#the-quickstart-examples)

These examples reproduce the functionality from the [JavaScript quickstart examples](https://learn.xrpl.org/course/code-with-the-xrpl/):

```
php 1.get-accounts-send-xrp.php
php 2.create-trustline-send-currency.php
php 3.mint-nfts.php
```

### How-to Examples

[](#how-to-examples)

These examples show how to use key features:

```
php examples/client.php
php examples/fundWallet.php
php examples/payment.php
php examples/token-create.php // IOU + Token + CBDC - Wallet Matrix with Trustlines
etc...
```

### Core Examples

[](#core-examples)

These examples can be used to explore XRPL core functionality:

```
php examples/internal/address-codec.php
php examples/internal/binary-codec.php
etc...
```

### Run the project via Docker

[](#run-the-project-via-docker)

1. In the project directory, start the project and open a shell:

```
docker compose up -d
docker compose exec -u 0 php bash
```

2. In the container shell, install the composer dependencies:

```
composer install
```

### Run Tests

[](#run-tests)

You can run the tests with the following command:

```
./vendor/bin/phpunit tests
```

You can perform static code analysis with psalm with the following command:

```
./vendor/bin/psalm --config=psalm.xml
```

Try it yourself
---------------

[](#try-it-yourself)

### Issuing an [Account Info request](https://xrpl.org/account_info.html):

[](#issuing-an-account-info-request)

```
require __DIR__.'/../vendor/autoload.php';

use Hardcastle\XRPL_PHP\Client\JsonRpcClient;
use Hardcastle\XRPL_PHP\Models\Account\AccountObjectsRequest;

// Those will be purged from the Testnet in regular intervals, you can use fundWallet()
// to generate prefunded Wallets on the Testnet
$testnetAccountAddress = 'raKXrkYfbh4Uzqc481jTXbaKsWnW5XRMjp';

$client = new JsonRpcClient("https://s.altnet.rippletest.net:51234");

$request = new AccountObjectsRequest(
    account: $testnetAccountAddress,
    ledgerIndex: 'validated',
    deletionBlockersOnly: true
);

// Using synchronous request
$response = $client->syncRequest($request);
$json = json_decode($response->getBody());
print_r($json);

// Using asynchronous request
// $response = $client->request($request)->wait();
// $json = json_decode($response->getBody());
// print_r($json);
```

### Making a payment:

[](#making-a-payment)

```
// Use your own credentials here:
$testnetStandbyAccountSeed = 'sEdTcvQ9k4UUEHD9y947QiXEs93Fp2k';
$testnetStandbyAccountAddress = 'raJNboPDvjLrYZropPFrxvz2Qm7A9guEVd';
$standbyWallet = Wallet::fromSeed($testnetStandbyAccountSeed);

// Use your own credentials here:
$testnetOperationalAccountSeed = 'sEdVHf8rNEaRveJw4NdVKxm3iYWFuRb';
$testnetOperationalAccountAddress = 'rEQ3ik2kmAvajqpFweKgDghJFZQGpXxuRN';
$operationalWallet = Wallet::fromSeed($testnetStandbyAccountSeed);

$client = new JsonRpcClient("https://s.altnet.rippletest.net:51234");

$tx = [
    "TransactionType" => "Payment",
    "Account" => $testnetStandbyAccountAddress,
    "Amount" => xrpToDrops("100"),
    "Destination" => $testnetOperationalAccountAddress
];
$autofilledTx = $client->autofill($tx);
$signedTx = $standbyWallet->sign($autofilledTx);

$txResponse = $client->submitAndWait($signedTx['tx_blob']);
$result = $txResponse->getResult();
if ($result['meta']['TransactionResult'] === 'tecUNFUNDED_PAYMENT') {
    print_r("Error: The sending account is unfunded! TxHash: {$result['hash']}" . PHP_EOL);
} else {
    print_r("Token payment done! TxHash: {$result['hash']}" . PHP_EOL);
}
```

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance96

Actively maintained with recent releases

Popularity34

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~54 days

Total

40

Last Release

49d ago

Major Versions

0.10.2 → 1.0.02026-03-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/3df9851b05573ab236b96118bf83edd2c6a8f50a41a6372f2d0c8241de2dd56a?d=identicon)[alexander.busse](/maintainers/alexander.busse)

---

Top Contributors

[![AlexanderBuzz](https://avatars.githubusercontent.com/u/102560752?v=4)](https://github.com/AlexanderBuzz "AlexanderBuzz (157 commits)")[![AlexanderBusse](https://avatars.githubusercontent.com/u/50315509?v=4)](https://github.com/AlexanderBusse "AlexanderBusse (34 commits)")[![zgrguric](https://avatars.githubusercontent.com/u/108837406?v=4)](https://github.com/zgrguric "zgrguric (4 commits)")[![nvonsternberg](https://avatars.githubusercontent.com/u/1002769?v=4)](https://github.com/nvonsternberg "nvonsternberg (1 commits)")

---

Tags

clientsdkcryptocurrencyrippleblockchainxrpxrplstablecoinUSDCrlusdeurc

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hardcastle-xrpl-php/health.svg)

```
[![Health](https://phpackages.com/badges/hardcastle-xrpl-php/health.svg)](https://phpackages.com/packages/hardcastle-xrpl-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[crowdin/crowdin-api-client

PHP client library for Crowdin API v2

611.5M5](/packages/crowdin-crowdin-api-client)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[manamine/php-eos-rpc-sdk

PHP SDK for the EOS RPC API

207.5k](/packages/manamine-php-eos-rpc-sdk)[mocking-magician/coinbase-pro-sdk

Library for coinbase pro API calls

233.2k](/packages/mocking-magician-coinbase-pro-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
