PHPackages                             sonofliberty/php-electron-cash-slp-api - 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. sonofliberty/php-electron-cash-slp-api

ActiveLibrary[API Development](/categories/api)

sonofliberty/php-electron-cash-slp-api
======================================

PHP wrapper for Electron Cash SLP JSONRPC-API

1.7.2(5y ago)1194GPL-3.0-or-laterPHP

Since Sep 13Pushed 5y agoCompare

[ Source](https://github.com/sonofliberty/php-electron-cash-slp-api)[ Packagist](https://packagist.org/packages/sonofliberty/php-electron-cash-slp-api)[ RSS](/packages/sonofliberty-php-electron-cash-slp-api/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (14)Used By (0)

[![Packagist](https://camo.githubusercontent.com/84751d550349cfc6fc02774bf18440529ecac282e044e35b8338e2cfc1b6cb9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70616472696f2f7068702d656c65637472756d2d6170692e7376673f636f6c6f723d253233346331)](https://camo.githubusercontent.com/84751d550349cfc6fc02774bf18440529ecac282e044e35b8338e2cfc1b6cb9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70616472696f2f7068702d656c65637472756d2d6170692e7376673f636f6c6f723d253233346331)[![GitHub code size in bytes](https://camo.githubusercontent.com/913a50be2374a1c86accd623ce25c04fd678321de71ba7ed1a9f5b1d9f4640f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f70616472696f2f7068702d656c65637472756d2d6170692e7376673f636f6c6f723d253233346331)](https://camo.githubusercontent.com/913a50be2374a1c86accd623ce25c04fd678321de71ba7ed1a9f5b1d9f4640f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f70616472696f2f7068702d656c65637472756d2d6170692e7376673f636f6c6f723d253233346331)

php-electrum-api - Electrum library
===================================

[](#php-electrum-api---electrum-library)

```
Licence: GPL-3.0
Author: Pascal Krason
Language: PHP 5.6-7.1

```

Please note, this library is by far not completed and but can be used in production. Until now i only implemented the most commonly used API-Calls. If you think im missing something, just create an issue or fork the project.

Setting up Electrum
===================

[](#setting-up-electrum)

First you need to setup a new Electrum wallet. Follow the instructions according to your OS at the [Electrum Download Page](https://electrum.org/#download). After the successfull installation you need to set a rpcport by typing:

```
electrum setconfig rpcport 7777
electrum setconfig rpcuser "username"
electrum setconfig rpcpassword "password"

```

Then we can create a default wallet, dont forget to note your generated seed, it's nescessary if you want to recover it one day:

```
electrum create

```

Now we can go ahead and start Electrum in daemon mode:

```
electrum daemon start

```

Since some new version electrum wants you to load your wallet by hand on startup:

```
electrum daemon load_wallet

```

Requirements
============

[](#requirements)

On the PHP side there are not much requirements, you only need at least PHP 5.6 and the curl-Extension installed. Then you can go ahead ans it through [Composer](http://getcomposer.org) which will do everything else for you.

Install
=======

[](#install)

First you need to install [Composer](https://getcomposer.org/doc/00-intro.md), after you accomplished this you can go ahead:

```
composer require padrio/php-electrum-api

```

Then you can simply include the autoloader and begin using the library:

```
// Include composer autoloader
require_once 'vendor/autoloader.php';
```

Examples
========

[](#examples)

Basic example
-------------

[](#basic-example)

A very basic useage example. Every API-Call has it's own request-object. You simply create one and execute it.

```
$method = new \Electrum\Request\Method\Version();

try {
    $response = $method->execute();
} catch(\Exception $exception) {
    die($exception->getMessage());
}

$response->getVersion();
```

Custom Client Configuration
---------------------------

[](#custom-client-configuration)

Every Request/Method takes a `Electrum\Client`-instance as parameter which replaces the default one. A custom instance can be usefull if you want to set custom config params like another Hostname or Port.

```
$client = new \Electrum\Client('http://127.0.0.1', 7777, 0, 'username', 'password');
$method = new \Electrum\Request\Method\Version($client);

try {
    $response = $method->execute();
} catch (\Exception $exception) {
    die($exception->getMessage());
}

$response->getVersion();
```

Advanced exception handling
---------------------------

[](#advanced-exception-handling)

Dealing with exceptions is easy. You can catch two types of exceptions which indicates whether it's an Request or Response fault.

```
$method = new \Electrum\Request\Method\Version();

try {
    $response = $method->execute();
} catch (\Electrum\Request\Exception\BadRequestException $exception) {
    die(sprintf(
        'Failed to send request: %s',
        $exception->getMessage()
    ));
} catch(\Electrum\Response\Exception\BadResponseException $exception) {
    die(sprintf(
        'Electrum-Client failed to respond correctly: %s',
        $exception->getMessage()
    ));
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~88 days

Recently: every ~187 days

Total

12

Last Release

2189d ago

### Community

Maintainers

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

---

Top Contributors

[![Padrio](https://avatars.githubusercontent.com/u/3200139?v=4)](https://github.com/Padrio "Padrio (11 commits)")[![sonofliberty](https://avatars.githubusercontent.com/u/7058895?v=4)](https://github.com/sonofliberty "sonofliberty (6 commits)")[![epoxa](https://avatars.githubusercontent.com/u/9610552?v=4)](https://github.com/epoxa "epoxa (5 commits)")[![LordS4me](https://avatars.githubusercontent.com/u/6563861?v=4)](https://github.com/LordS4me "LordS4me (3 commits)")[![zorn-v](https://avatars.githubusercontent.com/u/12619075?v=4)](https://github.com/zorn-v "zorn-v (2 commits)")[![thebigben](https://avatars.githubusercontent.com/u/35976104?v=4)](https://github.com/thebigben "thebigben (1 commits)")

---

Tags

apipaymentjsonrpcBitcoinCashelectroncashslp

### Embed Badge

![Health badge](/badges/sonofliberty-php-electron-cash-slp-api/health.svg)

```
[![Health](https://phpackages.com/badges/sonofliberty-php-electron-cash-slp-api/health.svg)](https://phpackages.com/packages/sonofliberty-php-electron-cash-slp-api)
```

###  Alternatives

[everypay/everypay-php

1742.0k](/packages/everypay-everypay-php)

PHPackages © 2026

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