pxgamer/arionum-php

An API wrapper for the Arionum cryptocurrency node.

v2.2.0 2018-11-05 11:16 UTC

README

Latest Version on Packagist Software License Build Status Style CI Code Coverage Total Downloads

An API wrapper for the Arionum cryptocurrency node.

Install

Via Composer

$ composer require pxgamer/arionum-php

Usage

Set the node base URI

$arionum = new pxgamer\Arionum\Arionum('https://node-uri-here');

Get an address from a public key

$arionum->getAddress('public-key');

Get a Base58-encoded version of a string

$arionum->getBase58('string-data');

Get the balance for an address

$arionum->getBalance('address');

Get the pending balance for an address

$arionum->getPendingBalance('address');

Get the transactions for an address

$arionum->getTransactions('address');

Get the transactions for a public key

$arionum->getTransactionsByPublicKey('address');

Get the transaction by its id

$arionum->getTransaction('transaction-id');

Get the public key for an address

$arionum->getPublicKey('address');

Generate a new account

$arionum->generateAccount();

Get the current block

$arionum->getCurrentBlock();

Get a specific block by its height

$arionum->getBlock(1);

Get transactions for a specific block

$arionum->getBlockTransactions('block-id');

Get version of the current node

$arionum->getNodeVersion();

Get the number of transactions in the mempool

$arionum->getMempoolSize();

Get a random number based on a specified block

$arionum->getRandomNumber(1, 1, 1000);

Get a list of available masternodes on the network

$arionum->getMasternodes();

Get the alias for a specific address

$arionum->getAlias('address');

Send a transaction

$transaction = new Transaction();

$transaction->setValue(1);
$transaction->setDestinationAddress('...'); 
$transaction->setPublicKey('...');
$transaction->setSignature('...');
$transaction->setMessage('...');
$transaction->setDate(time());

$arionum->sendTransaction($transaction);

Get details about the nodes sanity process

$arionum->getSanityDetails();

Get details about the node

$arionum->getNodeInfo();

Check the validity of a signature

$arionum->checkSignature('signature', 'data', 'public_key');

Check the validity of an address

$arionum->checkAddress('address');

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email owzie123@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.