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

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

azartpay/azart-rpc-php
======================

Azart JSON-RPC client based on GuzzleHttp

2.0.3(7y ago)0171MITPHPPHP &gt;=5.6.0

Since Jan 20Pushed 7y agoCompare

[ Source](https://github.com/azartpay/azart-rpc-php)[ Packagist](https://packagist.org/packages/azartpay/azart-rpc-php)[ Docs](https://github.com/azartpay/azart-rpc-php)[ RSS](/packages/azartpay-azart-rpc-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (22)Used By (0)

Azart RPC PHP
=============

[](#azart-rpc-php)

Simple Azart JSON-RPC client based on GuzzleHttp

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

[](#installation)

Run `php composer.phar require azartpay/azart-rpc-php` in your project directory or add following lines to composer.json

```
"require": {
    "azartpay/azart-rpc-php": "2.0.3"
}
```

and run `php composer.phar update`.

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

[](#requirements)

PHP 7.0 or higher (should also work on 5.6, but this is unsupported)

Usage
-----

[](#usage)

Create new object with url as parameter

```
use AzartPay\Azart\Client as AzartClient;

$azartd = new AzartClient('http://rpcuser:rpcpassword@localhost:9798/');
```

or use array to define your azartd settings

```
use AzartPay\Azart\Client as AzartClient;

$azartd = new AzartClient([
    'scheme' => 'http',                 // optional, default http
    'host'   => 'localhost',            // optional, default localhost
    'port'   => 9798,                   // optional, default 9798
    'user'   => 'rpcuser',              // required
    'pass'   => 'rpcpassword',          // required
    'ca'     => '/etc/ssl/ca-cert.pem'  // optional, for use with https scheme
]);
```

Then call methods defined in [Dash Core API Documentation](https://dash-docs.github.io/en/developer-reference#dash-core-apis) with magic:

```
/**
 * Get block info.
 */
$block = $azartd->getBlock('000009b9903dae4466d48db6c264d711ac554492da34cd0bfa4c0b6d230f29c9');

$block('hash')->get();     // 000009b9903dae4466d48db6c264d711ac554492da34cd0bfa4c0b6d230f29c9
$block['height'];          // 0 (array access)
$block->get('tx.0');       // 44701bbc011bdd471b75fa83e42acc8e067759a69cdeef723df57181a33e5467
$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 = $azartd->sendToAddress('AqUM31KtkxgbMwYrrpUi6RVjaftK3Mv5mG', 0.1);
$txid = $result->get();

/**
 * Get transaction amount.
 */
$result = $azartd->listSinceBlock();
$totalAmount = $result->sum('transactions.*.amount');
$totalSatoshi = AzartClient::toSatoshi($totalAmount);
```

To send asynchronous request, add Async to method name:

```
use AzartPay\Azart\AzartdResponse;

$promise = $azartd->getBlockAsync(
    '000009b9903dae4466d48db6c264d711ac554492da34cd0bfa4c0b6d230f29c9',
    function (AzartdResponse $success) {
        //
    },
    function (\Exception $exception) {
        //
    }
);

$promise->wait();
```

You can also send requests using request method:

```
/**
 * Get block info.
 */
$block = $azartd->request('getBlock', '000009b9903dae4466d48db6c264d711ac554492da34cd0bfa4c0b6d230f29c9');

$block('hash');            // 000009b9903dae4466d48db6c264d711ac554492da34cd0bfa4c0b6d230f29c9
$block['height'];          // 0 (array access)
$block->get('tx.0');       // 44701bbc011bdd471b75fa83e42acc8e067759a69cdeef723df57181a33e5467
$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 = $azartd->request('sendtoaddress', ['AqUM31KtkxgbMwYrrpUi6RVjaftK3Mv5mG', 0.06]);
$txid = $result->get();
```

or requestAsync method for asynchronous calls:

```
use AzartPay\Azart\AzartdResponse;

$promise = $azartd->requestAsync(
    'getBlock',
    '000009b9903dae4466d48db6c264d711ac554492da34cd0bfa4c0b6d230f29c9',
    function (AzartdResponse $success) {
        //
    },
    function (\Exception $exception) {
        //
    }
);

$promise->wait();
```

License
-------

[](#license)

This product is distributed under MIT license.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

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

Total

17

Last Release

2895d ago

Major Versions

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

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

v1.0.2PHP &gt;=5.6.0

### Community

---

Top Contributors

[![denpamusic](https://avatars.githubusercontent.com/u/16575433?v=4)](https://github.com/denpamusic "denpamusic (111 commits)")[![azartpay](https://avatars.githubusercontent.com/u/39407862?v=4)](https://github.com/azartpay "azartpay (7 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

### Embed Badge

![Health badge](/badges/azartpay-azart-rpc-php/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M316](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M292](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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