Download the PHP package padrio/php-electrum-api without Composer

On this page you can find all versions of the php package padrio/php-electrum-api. 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 php-electrum-api

Packagist GitHub code size in bytes

php-electrum-api - Electrum library

Please note, this library is by far not completed and but can be used in production. Until now i only implemented the most commonly used API-Calls. If you think im missing something, just create an issue or fork the project.

Setting up Electrum

First you need to setup a new Electrum wallet. Follow the instructions according to your OS at the Electrum Download Page. After the successfull installation you need to set a rpcport by typing:

Then we can create a default wallet, dont forget to note your generated seed, it's nescessary if you want to recover it one day:

Now we can go ahead and start Electrum in daemon mode:

Since some new version electrum wants you to load your wallet by hand on startup:

Requirements

On the PHP side there are not much requirements, you only need at least PHP 5.6 and the curl-Extension installed. Then you can go ahead ans it through Composer which will do everything else for you.

Install

First you need to install Composer, after you accomplished this you can go ahead:

Then you can simply include the autoloader and begin using the library:

Examples

Basic example

A very basic useage example. Every API-Call has it's own request-object. You simply create one and execute it.

Create new wallet

Create default wallet:

This code is similar to the command:

You can also create more wallets with custom names specifying flag of the new wallet.

This code is similar to the command:

Response will be:

Load wallet

`

List wallets

Get list of all loaded wallets:

Get new address

Create new address for wallet

Make a new Payment

Custom Client Configuration

Every Request/Method takes a Electrum\Client-instance as parameter which replaces the default one. A custom instance can be usefull if you want to set custom config params like another Hostname or Port.

Advanced exception handling

Dealing with exceptions is easy. You can catch two types of exceptions which indicates whether it's an Request or Response fault.


All versions of php-electrum-api with dependencies

PHP Build Version
Package Version
Requires zendframework/zend-hydrator Version ^2.2
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 padrio/php-electrum-api contains the following files

Loading the files please wait ....