Download the PHP package limikael/blockchainwalletmock without Composer

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

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blockchainwalletmock

blockchainwalletmock

Mocked version of the blockchain.info wallet API for automated testing.

About

This is a mocked version of the API at https://blockchain.info/api/blockchain_wallet_api that uses a local database to store transactions. No bitcoins will be moved to or from any wallet and no fees involving real coins will have to be paied. Since we are dealing with financial software, it doesn't hurt if we get into the habit of writing tests for our code. In order to do that, e we can use this tool to see if we deal with responses and handle callbacks in the correct way.

Getting started

First, install with:

And the run with:

Once it is started we can see that it is up with:

Which should gice us the result:

The JSON comes out as raw text, it has been formatted here for readability. We can create a new address in the same way as we would using the blockchin.info api:

Now let's simulate an incoming payment:

Let's list our addresses again:

You get the idea.

This way we can test our code before deployment, as well as create unit test using e.g. PHPUnit, without having to worry about what happens to our bitcoins.

Configuration

There are various configuration options we can set, for example what minimum transaction the should be accepted. We can also set a callback url in the same way as we do in the blockchain.info "Account Settings", and this url will be called using the same parameters. Run blockchainwalletmock without parameters to see a list of available options.

Starting from within a test

API

The goal is that the API should follow that of https://blockchain.info/api/blockchain_wallet_api, but it is not 100% complete currently. I have only implemented what I need for my own purpose so far. If there is something missing give me a shout and I might be interested in adding the functions you need, or feel free to contribute... :)

The ID:s for addresses and transaction hashes are not real bitcoin addresses, but actually random MD5 sums. This is deliberate in order to not confuse them with real bitcoin addresses.

Apart from the functions docummented there, there are some special ones prefixed with debug_ that we can use for debugging.

/debug_incoming?address=$address&amount=$amount

Simulates an incoming transactions. If we have a callback registered it will be called in the same way as when we use the blockchain.info API.

debug_confirmation?address=$address&transaction=$transaction&confirmations=$confirmations

Simulates one or several confirmations. Both the address and transaction hash is optional, in which case all transactions will receive a confirmation.

/debug_clear

Clear all the data in the database.


All versions of blockchainwalletmock with dependencies

PHP Build Version
Package Version
Requires youngj/httpserver Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package limikael/blockchainwalletmock contains the following files

Loading the files please wait ....