Download the PHP package headzoo/bitcoin-wallet-api without Composer

On this page you can find all versions of the php package headzoo/bitcoin-wallet-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

Please rate this library. Is it a good library?

All versions of bitcoin-wallet-api with dependencies

Informations about the package bitcoin-wallet-api

Bitcoin Wallet API v0.4.0

PHP library which facilitates communication with the Bitcoin JSON-RPC API. The rest of this documentation refers to the Bitcoin wallet, but this library works with any Bitcoin wallet descendant. Including wallets for Litecoin and Dogecoin.

Overview

The goal of this project is to provide more than a thin PHP wrapper to the Bitcoin JSON-RPC API; there are plenty of PHP libraries for that purpose. This library is meant to be more powerful than other libraries by offering the following features:

See the Bitcoin API wiki for information on each method.

Requirements

Installing

Add the project to your composer.json as a dependency.

And then run composer update.

Wallet Configuration

You will need to configure you wallet to act as a server before using this library. This is done by adding a few configuration values to the bitcoin.conf file. Shut down your wallet if it's running, and find your Bitcoin data directory. By default the data directory is located at /home/[user]/.bitcoin on Linux systems, and /Users/[user]/AppData/Roaming/Bitcoin on Windows systems. Create the bitcoin.conf file in the data directory if it does not already exist.

Add the following lines:

You will of course want to choose a strong username and password combination. Non-Bitcoin wallets are configured in the same way. For example the Litecoin data directory is located at /home/[user]/.litecoin on Linux systems, and /Users/[user]/AppData/Roaming/Litecoin on Windows systems, and the configuration file is named litecoin.conf.

Note: You will also need to add txindex=1 to your configuration if you want to query the wallet for non-wallet transactions. You may need to start your wallet with the -rescan switch for the first time after adding this configuration directive.

Quick Start

Class Documentation

The full class API documentation is available in the /docs directory.

Headzoo\Bitcoin\Wallet\Api\JsonRPC

Core class which directly communicates with Bitcoin wallets supporting the JSON-RPC API. This class provides a single query($method, array $params = []) method via the Headzoo\Bitcoin\Wallet\Api\JsonRPCInterface interface. Although you may use this class directly to query a wallet, it's best to use an instance of Headzoo\Bitcoin\Wallet\Api\Wallet instead.

Headzoo\Bitcoin\Wallet\Api\Wallet

Wraps an instance of Headzoo\Bitcoin\Wallet\Api\JsonRPCInterface to provide a higher level interface to the wallet API. This class has methods for every single API call, eg Headzoo\Bitcoin\Wallet\Api\Wallet::getInfo(), Headzoo\Bitcoin\Wallet\Api\Wallet::backup($destination), Headzoo\Bitcoin\Wallet\Api\Wallet::getAccount($account), etc. Using this class instead of directly using Headzoo\Bitcoin\Wallet\Api\JsonRPC makes it easier to catch programming errors, and allows IDEs to provide auto-complete and type hinting.

Headzoo\Bitcoin\Wallet\Api\RPCPool

Wallet servers may be clustered and queried randomly using the Headzoo\Bitcoin\Wallet\Api\RPCPool class. Both Headzoo\Bitcoin\Wallet\Api\JsonRPC and Headzoo\Bitcoin\Wallet\Api\RPCPool implement Headzoo\Bitcoin\Wallet\Api\JsonRPCInterface, which means either may be passed to the Headzoo\Bitcoin\Wallet\Api\Wallet constructor.

Change Log

v0.4.0 - 2014/03/23
v0.3.0 - 2014/03/23
v0.2.0 - 2013/12/31
v0.1.0 - 2013/12/18

TODO

License

This content is released under the MIT License. See the included LICENSE for more information.

I write code because I like writing code, and writing code is a reward in itself, but donations are always welcome.

Bitcoin: 1Headz2mYtpBRo6KFaaUEtcm5Kce6BZRJM
Litecoin: LheadzBgTNAitxYxUTUTTQ3RT7zR5jnkfq


Version
Requires php Version >=5.4.0
ext-simplexml Version *
psr/log Version dev-master
headzoo/web-tools Version dev-master

The package headzoo/bitcoin-wallet-api contains the following files

Loading the files please wait ....