vaneves/bitcoin-php

There is no license information available for the latest version (0.0.1) of this package.

Library for lists of transactions Bitcoin

0.0.1 2018-02-28 03:21 UTC

This package is auto-updated.

Last update: 2024-04-19 08:57:07 UTC


README

Installing

Via Composer

composer require vaneves/bitcoin-php

Usage

Create Address

Creates a new address.

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 Transactions

List all transactions received and sent.

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();
}

License

The MIT License (MIT)

Donate

Bitcoin address: 1H6ssXbPbLeDVQNf9PqaarTEeG9sjurEgm

68747470733a2f2f63686172742e676f6f676c65617069732e636f6d2f63686172743f6368743d7172266368733d323330783233302663686c3d3148367373586250624c654456514e663950716161725445654739736a757245676d