02/03
2018
Library for lists of transactions Bitcoin
Via Composer, (*1)
composer require vaneves/bitcoin-php
Creates a new address., (*2)
use Vaneves\Bitcoin\Network; use Vaneves\Bitcoin\Bitcoin; use Vaneves\Bitcoin\BitcoinException; try { $network = new Network('http://username:password@127.0.0.1:18332'); $bitcoin = new Bitcoin($network); $address = $bitcoin->account('vaneves')->newAddress(); echo $address; } catch (BitcoinException $e) { echo $e->getMessage(); } catch (\Exception $e) { echo $e->getMessage(); }
List all transactions received and sent., (*3)
use Vaneves\Bitcoin\Network; use Vaneves\Bitcoin\Bitcoin; use Vaneves\Bitcoin\BitcoinException; try { $network = new Network('http://username:password@127.0.0.1:18332'); $bitcoin = new Bitcoin($network); $offset = 0; $limit = 100; $transactions = $bitcoin->transaction()->paginate($offset, $limit); print_r($transactions); } catch (BitcoinException $e) { echo $e->getMessage(); } catch (\Exception $e) { echo $e->getMessage(); }
The MIT License (MIT), (*4)
Bitcoin address: 1H6ssXbPbLeDVQNf9PqaarTEeG9sjurEgm, (*5)
, (*6)