An API wrapper for BTGexp.com
src/
tests/
vendor/
Via Composer
$ composer require pxgamer/btgexp-api
Initialise the Basic
class.
$basic = new pxgamer\BTGExp\Basic();
Retrieve the current difficulty as a double
.
$basic->getDifficulty();
Retrieve the current connection count as an integer
.
$basic->getConnectionCount();
Retrieve the current block count as an integer
.
$basic->getBlockCount();
Retrieve the block hash for a specified index.
$basic->getBlockHashByIndex(int $index);
Retrieve a Block
instance by hash.
$basic->getBlockByHash(string $hash);
Retrieve a transaction as a string
or a Transaction
instance.
// As a Transaction instance (default).
$basic->getTransactionById(string $hash, true);
// As an encrypted string.
$basic->getTransactionById(string $hash, false);
Retrieve the current network hash rate (hash/s) as a double
.
$basic->getNetworkHashRate();
Initialise the Extended
class.
$extended = new pxgamer\BTGExp\Extended();
Retrieve the current money supply as a double
.
$extended->getMoneySupply();
Retrieve the current network details as a Network
instance.
$extended->getNetwork();
Retrieve information for an address as an Address
instance.
$extended->getAddress(string $address);
Retrieve the balance for an address as a double
.
$extended->getBalance(string $address);
Retrieve the latest transactions as an array.
$extended->getLastTransactions();
$extended->getLastTransactions(int $count);
$extended->getLastTransactions(int $count, int $min);
Retrieve the last 7 blocks as an array.
$extended->getLastBlocks();
Retrieve a Block
instance specified by it's height.
$extended->getBlockByHeight(int $height);
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email owzie123@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.