shucream0117 / btcphp
Bitcoin library for PHP
dev-master
2018-02-05 10:16 UTC
Requires
- php: >=7.1.0
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- phpunit/phpunit: 6.0.*
This package is auto-updated.
Last update: 2025-03-18 23:59:00 UTC
README
Bitcoin(Litecoin, Monacoin) library for PHP.
Requirement
- PHP ≧ 7.1
Installation
via composer.
$ curl -sS https://getcomposer.org/installer | php $ php composer.phar require shucream0117/btcphp:dev-master
Example
$btc = new \Shucream0117\Bitcoin\Bitcoin( 'username', // rpcuser 'password', // rpcpassword 'localhost', // host 19402, // port false // if use HTTPS ); $response = $btc->callApi('getinfo'); $responseArray = json_decode($response->getBody()->getContents(), true); var_dump($responseArray); // arguments can be passed as array // array[0] is argument1, array[1] is argument2... $response = $btc->callApi( 'gettransaction', ['dee2406ae3ed5e1edc923d69ba795edfc9e01e5cc632ed8b7bb4365df5b106c9'] );