Skip to content

πŸ”— Library for lists of transactions Bitcoin

License

Notifications You must be signed in to change notification settings

vaneves/bitcoin-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”— Query to Bitcoin via PHP

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:[email protected]: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:[email protected]: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

About

πŸ”— Library for lists of transactions Bitcoin

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages