btgexp-api
![Software License][ico-license]
![Code Coverage][ico-code-quality]
, (*1)
An API wrapper for BTGexp.com, (*2)
Structure
src/
tests/
vendor/
Install
Via Composer, (*3)
``` bash
$ composer require pxgamer/btgexp-api, (*4)
## Usage
### Basic methods
Initialise the `Basic` class.
```php
$basic = new pxgamer\BTGExp\Basic();
Retrieve the current difficulty as a double
., (*5)
$basic->getDifficulty();
Retrieve the current connection count as an integer
., (*6)
$basic->getConnectionCount();
Retrieve the current block count as an integer
., (*7)
$basic->getBlockCount();
Retrieve the block hash for a specified index., (*8)
$basic->getBlockHashByIndex(int $index);
Retrieve a Block
instance by hash., (*9)
$basic->getBlockByHash(string $hash);
Retrieve a transaction as a string
or a Transaction
instance., (*10)
// 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
., (*11)
$basic->getNetworkHashRate();
Extended methods
Initialise the Extended
class., (*12)
$extended = new pxgamer\BTGExp\Extended();
Retrieve the current money supply as a double
., (*13)
$extended->getMoneySupply();
Retrieve the current network details as a Network
instance., (*14)
$extended->getNetwork();
Retrieve information for an address as an Address
instance., (*15)
$extended->getAddress(string $address);
Retrieve the balance for an address as a double
., (*16)
$extended->getBalance(string $address);
Retrieve the latest transactions as an array., (*17)
$extended->getLastTransactions();
$extended->getLastTransactions(int $count);
$extended->getLastTransactions(int $count, int $min);
Retrieve the last 7 blocks as an array., (*18)
$extended->getLastBlocks();
Retrieve a Block
instance specified by it's height., (*19)
$extended->getBlockByHeight(int $height);
Change log
Please see CHANGELOG for more information on what has changed recently., (*20)
Testing
bash
$ composer test
, (*21)
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details., (*22)
Security
If you discover any security related issues, please email owzie123@gmail.com instead of using the issue tracker., (*23)
Credits
License
The MIT License (MIT). Please see License File for more information., (*24)