The ZNN-PHP package provides access to the read-only JSON-RPC endpoints of the zenon.network as described here.
PHP 7.4 and later.
composer require digitalsloth/znn-php
- Node Url - By default, it will try and connect to a local node
127.0.0.1:35997but you can pass in any public node URL. - Throw Errors - You can choose to throw errors or not, defaults to
false
// config
$nodeUrl = 'ws://public.deeZNNodez.com:35998';
$throwErrors = true;
// zenon client
$znn = new \DigitalSloth\ZnnPhp\Zenon($nodeUrl, $throwErrors);Once you have your $znn instance you can make requests:
// 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);
}All accelerator, pillar, plasma, sentinel, stake, swap , token, ledger and stats endpoints listed here can be reached through the $znn instance.