PHPackages                             refring/monero-rpc-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. refring/monero-rpc-php

ActiveLibrary[API Development](/categories/api)

refring/monero-rpc-php
======================

A modern fully strong-typed library for using the Monero daemon rpc and wallet rpc APIs

0.8.1(5mo ago)91.6k2[1 PRs](https://github.com/refring/monero-rpc-php/pulls)MITPHPPHP ^8.1.0CI passing

Since Sep 11Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/refring/monero-rpc-php)[ Packagist](https://packagist.org/packages/refring/monero-rpc-php)[ RSS](/packages/refring-monero-rpc-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (16)Used By (0)

Monero Daemon &amp; Wallet RPC client
=====================================

[](#monero-daemon--wallet-rpc-client)

[![Packagist Version](https://camo.githubusercontent.com/a45604f709a685522e0eaeaabee3599222ae628224350b9a9137700d7f0c0675/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72656672696e672f6d6f6e65726f2d7270632d706870)](https://packagist.org/packages/refring/monero-rpc-php)[![Tests](https://github.com/refactor-ring/monero-rpc-php/actions/workflows/tests.yml/badge.svg)](https://github.com/refactor-ring/monero-rpc-php/actions/workflows/tests.yml)[![PHPStan](https://github.com/refactor-ring/monero-rpc-php/actions/workflows/phpstan.yml/badge.svg)](https://github.com/refactor-ring/monero-rpc-php/actions/workflows/phpstan.yml)[![codecov](https://camo.githubusercontent.com/3f2dbf2d514a6f3ec744a640f9c765fbc870f95f219a7a1d8d24bfc4e6f7b7ed/68747470733a2f2f636f6465636f762e696f2f67682f72656672696e672f6d6f6e65726f2d7270632d7068702f67726170682f62616467652e7376673f746f6b656e3d50384b32364d3857364e)](https://codecov.io/gh/refring/monero-rpc-php)[![Packagist Dependency Version](https://camo.githubusercontent.com/bbe60219d730b679855482768ea2633c512c4b5b1acc3e35368cc518d960670a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f72656672696e672f6d6f6e65726f2d7270632d7068702f706870)](https://packagist.org/packages/refring/monero-rpc-php)

Monero daemon and wallet RPC client library written in modern PHP.

Features
--------

[](#features)

- Implements Monero wallet and daemon rpc methods
- Support authentication for the wallet and daemon rpc servers
- Fully strongly typed and strict\_types enabled
- Minimal dependencies
- PSR-18 compatible, so different http client libraries can be used

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

[](#installation)

You can install the package with Composer, at this this time minimum-stability has to be set to dev:

```
composer require refring/monero-rpc-php
```

When your project does not have a http client available yet, you should require one as well.

Different http clients can be used:

### guzzle

[](#guzzle)

```
composer require guzzlehttp/guzzle
```

Other http clients### symfony http client

[](#symfony-http-client)

```
composer require symfony/http-client psr/http-client nyholm/psr7
```

### buzz

[](#buzz)

```
composer require kriswallsmith/buzz nyholm/psr7
```

### php-http/curl-client

[](#php-httpcurl-client)

```
composer php-http/curl-client
```

Setup
-----

[](#setup)

### Creating a client

[](#creating-a-client)

For the wallet rpc client:

```
$walletClient = (new \RefRing\MoneroRpcPhp\ClientBuilder('http://127.0.0.1:18081/json_rpc'))
    ->buildWalletClient();

echo $walletClient->getVersion()->version;
```

Daemon rpc client:

```
$daemonClient = (new \RefRing\MoneroRpcPhp\ClientBuilder('http://127.0.0.1:18081/json_rpc'))
    ->buildDaemonClient();

echo $daemonClient->getVersion()->version;
```

### Using authentication

[](#using-authentication)

```
$daemonClient = (new \RefRing\MoneroRpcPhp\ClientBuilder('http://127.0.0.1:18081/json_rpc'))
    ->withAuthentication('foo', 'bar')
    ->buildDaemonClient();

echo $daemonClient->getVersion()->version;
```

### Connecting through a proxy

[](#connecting-through-a-proxy)

Configuring a proxy is specific to the http client library.

Below is a Symfony Http Client example for a socks5 proxy:

```
$httpClient = new Psr18Client(new CurlHttpClient([
    'http_version' => '2.0',
    'proxy' => 'socks5://username:password@127.0.0.1:9999',
]));

$daemonClient = (new \RefRing\MoneroRpcPhp\ClientBuilder('http://examplenode/json_rpc'))
    ->withHttpClient($httpClient)
    ->buildDaemonClient();
```

### Injecting a logger

[](#injecting-a-logger)

The client builder also supports injecting a logger and/or a http client:

```
$httpClient = new \Symfony\Component\HttpClient\Psr18Client();
$logger = new \Psr\Log\NullLogger();

$daemonClient = (new \RefRing\MoneroRpcPhp\ClientBuilder('http://127.0.0.1:18081/json_rpc'))
    ->withHttpClient($httpClient)
    ->withLogger($logger)
    ->buildDaemonClient();
```

Usage
-----

[](#usage)

### Creating a wallet and account

[](#creating-a-wallet-and-account)

```
// Try to create a wallet, or open it when it already exists
try{
    $walletClient->createWallet('testwallet', 'English', 'password');
} catch (WalletExistsException $e) {
    $walletClient->openWallet('testwallet', 'password');
} catch(MoneroRpcException $e) {
    echo 'An error occured: '.$e->getMessage();
}

$baseAddressData = $walletClient->getAddress();
$subAddressData = $walletClient->createAddress();

printf("BaseAddress: %s\nSubAddress: %s\n", $baseAddressData->address, $subAddressData->address);

// Create another account
$newAccountData = $walletClient->createAccount('another account');
$newAccountSubAddress = $walletClient->createAddress($newAccountData->accountIndex);

printf("Account %d\nBaseAddress: %s\nSubAddress: %s", $newAccountData->accountIndex, $newAccountData->address, $newAccountSubAddress->address);
```

Testing
-------

[](#testing)

The project has unit tests and integration tests, the unit tests can be run using `composer test:unit`

To run the integration tests, you'll need `docker` and `docker compose` or you could run `monerod` and `monero-wallet-rpc` on your own.

If you have the docker stack installed, go to the `tests` folder and run `docker compose up`. Note that the daemon will run on port `18081` and `monero-wallet-rpc` will run on port `18083`.

After that, run `composer test:integration` to run the integration tests.

Compatibility
-------------

[](#compatibility)

Only the latest 3 point releases of Monero are actively supported and covered by integration tests.

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md)

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Acknowledgments
---------------

[](#acknowledgments)

- [monero-rpc-rs](https://github.com/monero-rs/monero-rpc-rs) - Parts of this project served as inspiration.
- [monero-php](https://github.com/monero-integrations/monerophp) - Thanks for providing the php ecosystem with a Monero library during all these years!
- [Monero](https://getmonero.org) - Thanks to everybody involved!

Donations
---------

[](#donations)

If this library has been valuable to you, please consider donating some XMR to support its continued development.

 [![](donate.png)](donate.png)
 `87EXWd4R8SwDZqx3wdtHoygSX6iEtY5geQxksy7dK6Kb91h3Rb195PbXKqFQcAezP3UbXD5pxPrtQcd2V3t8962U9MFJaWQ`

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance72

Regular maintenance activity

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% 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 ~62 days

Recently: every ~184 days

Total

14

Last Release

163d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/103168904?v=4)[refring](/maintainers/refring)[@refring](https://github.com/refring)

---

Top Contributors

[![refring](https://avatars.githubusercontent.com/u/103168904?v=4)](https://github.com/refring "refring (227 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")

---

Tags

moneromonero-daemonmonero-rpcmonero-walletphp8apiclientsdkMoneromonero-wallet-rpcmonero daemon

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/refring-monero-rpc-php/health.svg)

```
[![Health](https://phpackages.com/badges/refring-monero-rpc-php/health.svg)](https://phpackages.com/packages/refring-monero-rpc-php)
```

###  Alternatives

[openai-php/client

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

5.8k22.6M232](/packages/openai-php-client)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)

PHPackages © 2026

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