PHPackages                             ftab/php-dogecoinrpc - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ftab/php-dogecoinrpc

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ftab/php-dogecoinrpc
====================

Dogecoin JSON-RPC client based on php-bitcoinrpc

v3.0.2(6y ago)12721MITPHPPHP &gt;=7.1

Since Jan 20Pushed 6y agoCompare

[ Source](https://github.com/ftab/php-dogecoinrpc)[ Packagist](https://packagist.org/packages/ftab/php-dogecoinrpc)[ Docs](https://github.com/ftab/php-dogecoinrpc)[ RSS](/packages/ftab-php-dogecoinrpc/feed)WikiDiscussions 3.x Synced 4d ago

READMEChangelog (3)Dependencies (2)Versions (38)Used By (0)

Simple Dogecoin JSON-RPC client based on
=======================================================================================

[](#simple-dogecoin-json-rpc-client-based-on-httpsgithubcomdenpamusicphp-bitcoinrpc)

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

[](#installation)

Run `php composer.phar require ftab/php-dogecoinrpc` in your project directory or add following lines to composer.json

```
"require": {
    "ftab/php-dogecoinrpc": "^3.0"
}
```

and run `php composer.phar install`.

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

[](#requirements)

PHP 7.1 or higher

Usage
-----

[](#usage)

Create new object with url as parameter

```
/**
 * Don't forget to include composer autoloader by uncommenting line below
 * if you're not already done it anywhere else in your project.
 **/
// require 'vendor/autoload.php';

use ftab\Dogecoin\Client as DogecoinClient;

$dogecoind = new DogecoinClient('http://rpcuser:rpcpassword@localhost:22555/');
```

or use array to define your dogecoind settings

```
/**
 * Don't forget to include composer autoloader by uncommenting line below
 * if you're not already done it anywhere else in your project.
 **/
// require 'vendor/autoload.php';

use ftab\Dogecoin\Client as DogecoinClient;

$dogecoind = new DogecoinClient([
    'scheme'        => 'http',                 // optional, default http
    'host'          => 'localhost',            // optional, default localhost
    'port'          => 22555,                  // optional, default 22555
    'user'          => 'rpcuser',              // required
    'password'      => 'rpcpassword',          // required
    'ca'            => '/etc/ssl/ca-cert.pem',  // optional, for use with https scheme
    'preserve_case' => false,                  // optional, send method names as defined instead of lowercasing them
]);
```

Then call methods defined in [Dogecoin Core](https://github.com/dogecoin/dogecoin/) API with magic:

```
/**
 * Get block info.
 */
$block = $dogecoind->getBlock('1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691');

$block('hash')->get();     // 1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691
$block['height'];          // 0 (array access)
$block->get('tx.0');       // 5b2a3f53f605d62c53e62932dac6925e3d74afa5a4b459745c36d42d0ed26a69
$block->count('tx');       // 1
$block->has('version');    // key must exist and CAN NOT be null
$block->exists('version'); // key must exist and CAN be null
$block->contains(0);       // check if response contains value
$block->values();          // array of values
$block->keys();            // array of keys
$block->random(1, 'tx');   // random block txid
$block('tx')->random(2);   // two random block txid's
$block('tx')->first();     // txid of first transaction
$block('tx')->last();      // txid of last transaction

/**
 * Send transaction.
 */
$result = $dogecoind->sendToAddress('DATfurydmRTZ6vJnBtaibHJYMdx9JYjL4n', 100);
$txid = $result->get();

/**
 * Get transaction amount.
 */
$result = $dogecoind->listSinceBlock();
$dogecoin = $result->sum('transactions.*.amount');
$dogetoshi = \ftab\Dogecoin\to_dogetoshi($dogecoin);
```

To send asynchronous request, add Async to method name:

```
$dogecoind->getBlockAsync(
    '1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691',
    function ($response) {
        // success
    },
    function ($exception) {
        // error
    }
);
```

You can also send requests using request method:

```
/**
 * Get block info.
 */
$block = $dogecoind->request('getBlock', '1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691');

$block('hash');            // 1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691
$block['height'];          // 0 (array access)
$block->get('tx.0');       // 5b2a3f53f605d62c53e62932dac6925e3d74afa5a4b459745c36d42d0ed26a69
$block->count('tx');       // 1
$block->has('version');    // key must exist and CAN NOT be null
$block->exists('version'); // key must exist and CAN be null
$block->contains(0);       // check if response contains value
$block->values();          // get response values
$block->keys();            // get response keys
$block->first('tx');       // get txid of the first transaction
$block->last('tx');        // get txid of the last transaction
$block->random(1, 'tx');   // get random txid

/**
 * Send transaction.
 */
$result = $dogecoind->request('sendtoaddress', 'DATfurydmRTZ6vJnBtaibHJYMdx9JYjL4n', 60);
$txid = $result->get();
```

or requestAsync method for asynchronous calls:

```
$dogecoind->requestAsync(
    'getBlock',
    '1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691',
    function ($response) {
        // success
    },
    function ($exception) {
        // error
    }
);
```

Exceptions
----------

[](#exceptions)

- `ftab\Dogecoin\Exceptions\BadConfigurationException` - thrown on bad client configuration.
- `ftab\Dogecoin\Exceptions\BadRemoteCallException` - thrown on getting error message from daemon.
- `ftab\Dogecoin\Exceptions\ConnectionException` - thrown on daemon connection errors (e. g. timeouts)

Helpers
-------

[](#helpers)

Package provides following helpers to assist with value handling.

#### `to_dogecoin()`

[](#to_dogecoin)

Converts value in dogetoshi to dogecoin.

```
echo ftab\Dogecoin\to_dogecoin('100000'); // '0.00100000'
```

#### `to_dogetoshi()`

[](#to_dogetoshi)

Converts value in dogecoin to dogetoshi.

```
echo ftab\Dogecoin\to_dogetoshi('0.001'); // '100000'
```

#### `to_fixed()`

[](#to_fixed)

Trims value to precision without rounding.

```
echo ftab\Dogecoin\to_fixed('0.1236', 3); // '0.123'
```

License
-------

[](#license)

This product is distributed under MIT license.

Donations
---------

[](#donations)

### Let's give some love to Denpa

[](#lets-give-some-love-to-denpa)

If you like this project, please consider donating to the original author of php-bitcoinrpc as they did all the work:
**BTC**: 3L6dqSBNgdpZan78KJtzoXEk9DN3sgEQJu
**Bech32**: bc1qyj8v6l70c4mjgq7hujywlg6le09kx09nq8d350

❤Thanks for your support!❤

### dogecoin fork

[](#dogecoin-fork)

I guess I could take a doge or two for making this fork too? Dunno. Feels weird when all I'm doing is diffing and editing.

- **DOGE**: DATfurydmRTZ6vJnBtaibHJYMdx9JYjL4n

Or check out the game I'm putting it in, and throw your doge at some of the in-game goodies!

- [Ruins of Chaos](https://ruinsofchaos.com/)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

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

Total

37

Last Release

2267d ago

Major Versions

1.x-dev → v2.0.0beta12017-08-14

v2.1.3 → v3.0.02020-02-16

PHP version history (3 changes)v1.0.0PHP &gt;=5.4.0

v1.0.2PHP &gt;=5.6.0

v2.1.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/52a61e8121a891f1bcda25a527b3789a4c5bcda739e5534f4838fab1d151aab1?d=identicon)[ftab](/maintainers/ftab)

---

Top Contributors

[![denpamusic](https://avatars.githubusercontent.com/u/16575433?v=4)](https://github.com/denpamusic "denpamusic (256 commits)")[![ftab](https://avatars.githubusercontent.com/u/1690894?v=4)](https://github.com/ftab "ftab (4 commits)")[![partyka1](https://avatars.githubusercontent.com/u/19314216?v=4)](https://github.com/partyka1 "partyka1 (4 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")[![M-Shahbaz](https://avatars.githubusercontent.com/u/3539612?v=4)](https://github.com/M-Shahbaz "M-Shahbaz (1 commits)")[![mtdlaurynas](https://avatars.githubusercontent.com/u/29912829?v=4)](https://github.com/mtdlaurynas "mtdlaurynas (1 commits)")

---

Tags

apidogecoinphpapiGuzzlejsonrpcdogecoin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ftab-php-dogecoinrpc/health.svg)

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

###  Alternatives

[denpa/php-bitcoinrpc

Bitcoin JSON-RPC client based on GuzzleHttp

284217.4k4](/packages/denpa-php-bitcoinrpc)[denpa/laravel-bitcoinrpc

Bitcoin JSON-RPC Service Provider for Laravel

9053.4k](/packages/denpa-laravel-bitcoinrpc)[antoinelemaire/aircall-php

Aircall API client built on top of Guzzle 6

1049.6k](/packages/antoinelemaire-aircall-php)

PHPackages © 2026

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