Download the PHP package jeankassio/electrumphp without Composer
On this page you can find all versions of the php package jeankassio/electrumphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeankassio/electrumphp
More information about jeankassio/electrumphp
Files in jeankassio/electrumphp
Package electrumphp
Short Description PHP library to connect in Electrum JSON-RPC
License MIT
Informations about the package electrumphp
ElectrumPHP
ElectrumPHP is a PHP library designed to interact with the Electrum wallet through RPC calls. With this library, you can manage wallets, generate addresses, check balances, make Bitcoin payments and much more using the Electrum daemon.
Update: You can also calculate the ideal estimated fee for your transaction before you make it.
Requirements
- PHP 8 or higher
- Curl enabled
- putenv enabled
- exec enabled (to start Electrum)
- Electrum installed and configured on your server
Installation
The package can be installed using Composer
Usage
Instantiate the ElectrumPHP Class
Tips
The recommendation is that you start it even if you know that the daemon is already running, as the "start" function checks whether the daemon is running and communicating correctly before trying to execute the code to start the daemon.
Methods
Start the Electrum Daemon (if you need)
Stop the Electrum Daemon (if you need)
Check if Daemon is Running
Validate a Bitcoin Address
Create a New Wallet and receive Seed
Create a New Wallet with your seed
Create a New Address
Get Address Balance
Get Wallet Balance
Get Transaction Details
Get Number of Confirmations
Pay to a Bitcoin Address
Pay to Multiple Addresses
Load a Wallet
Get Wallets Currently Open
Notify of Address Changes (Webhooks) [Not recommended, could fail]
Delete Address Notification
Get Private Key of Address in wallet
Get Seed of the Wallet
If the method you need doesn't exist, make a custom call.
Get estimate fee, bests inputs and suggest change address.
And result are:
Error Handling
Every RPC call that fails will throw an exception.
You can handle these exceptions using simple try-catch blocks:
Contribution:
Contributions are welcome! If you find a bug or have suggestions for improvements.
Feel free to open an issue or submit a Pull Request.
License:
This project is licensed under the MIT License - see the LICENSE.md file for details.