PHPackages                             digitalsloth/znn-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. digitalsloth/znn-php

ActiveLibrary[API Development](/categories/api)

digitalsloth/znn-php
====================

A PHP SDK for JSON-RPC endpoints of the zenon.network

1.0.0(1y ago)22.6kmitPHPPHP &gt;=8.2

Since Dec 3Pushed 1y ago2 watchersCompare

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

READMEChangelogDependencies (7)Versions (3)Used By (0)

znn-php
=======

[](#znn-php)

The ZNN-PHP package allows you to read the JSON-RPC endpoints of the [zenon.network](https://zenon.community/) as described [here](https://github.com/zenon-network/znn-wiki/blob/master/api.md). It also provides methods for working with the ABI data.

- RPC Endpoints
- ABI Decoding
- ABI Encoding
- Wallet &amp; Keyfile support
- Unit tests

Wallet and keyfile support is still a work in progress. PRs are welcome :)

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

[](#requirements)

PHP 8.2 and later.

```
composer require digitalsloth/znn-php

```

Usage
-----

[](#usage)

### RPC Setup

[](#rpc-setup)

- **Node Url** - By default, it will try and connect to a local node `127.0.0.1:35997` but you can pass in any public node URL.
- **Throw Errors** - You can choose to throw errors or not, defaults to `false`

Create a new instance of `$znn` calling the provider and method you want. All `accelerator`, `pillar`, `plasma`, `sentinel`, `stake`, `swap` , `token`, `ledger` and `stats` endpoints listed [here](https://github.com/zenon-network/znn-wiki/blob/master/api.md#embedded-smart-contracts) can be reached through the `$znn` instance.

```
// config
$nodeUrl = 'https://node.zenonhub.io:35997';
$throwErrors = true;

// zenon client
$znn = new \DigitalSloth\ZnnPhp\Zenon($nodeUrl, $throwErrors);

// load all pillars
$result = $znn->pillar->getAll();

if (! $result['status']) {
    die('Error loading data');
}

echo $result['data']->count;

foreach ($result['data']->list as $pillar) {
    var_dump($pillar);
}
```

### ABI Encoding/Decoding

[](#abi-encodingdecoding)

Create a new instance of a `$contract` to access the encode and decode methods:

```
// pick a contract to work with
$contract = new \DigitalSloth\ZnnPhp\Abi\Contracts\Accelerator();

$result = $contract->encode('CreateProject', ["Test", "Test", "Test.com", 1000000000, 10000000000]);
$result = base64_encode($result); // d8BEtgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7msoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlQL5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFRlc3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARUZXN0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIVGVzdC5jb20AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

$result = $contract->decode('CreateProject', base64_decode('d8BEtgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7msoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlQL5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFRlc3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARUZXN0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIVGVzdC5jb20AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='));
var_dump($result); // ["Test","Test","Test.com","1000000000","10000000000"]
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance40

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

504d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfdd403de24998099ee74e553f730e04ac3413a16cbfd1a1384245034be20ff2?d=identicon)[digitalSloth](/maintainers/digitalSloth)

---

Top Contributors

[![digitalSloth](https://avatars.githubusercontent.com/u/104867337?v=4)](https://github.com/digitalSloth "digitalSloth (60 commits)")

---

Tags

phpzenonznn

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/digitalsloth-znn-php/health.svg)

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

###  Alternatives

[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[packbackbooks/lti-1p3-tool

A library used for building IMS-certified LTI 1.3 tool providers in PHP.

51438.3k2](/packages/packbackbooks-lti-1p3-tool)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[hoels/app-store-server-library-php

The PHP server library for the App Store Server API and App Store Server Notifications.

44162.2k](/packages/hoels-app-store-server-library-php)[soneso/stellar-php-sdk

Stellar PHP SDK for the Stellar Network

4048.2k4](/packages/soneso-stellar-php-sdk)

PHPackages © 2026

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