PHP code example of chendujin / bitcoin

1. Go to this page and download the library: Download chendujin/bitcoin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

chendujin / bitcoin example snippets


'providers' => [
    // Other service providers...

    Chendujin\Bitcoin\BitcoinServiceProvider::class,
],

use Chendujin\Bitcoin\Facade\Bitcoin;

'aliases' => [
    ...
    'Bitcoin' => Chendujin\Bitcoin\Facade\Bitcoin::class,
],

try{
        $ret = \Chendujin\Bitcoin\Facade\Bitcoin::getnewaddress('123456');
        print_r($ret);
    }catch (Exception $e){
        echo $e->getMessage();
    }

$bitcoin = app('Bitcoin');

$result=$bitcoin->getnewaddress('123456');
bash
php artisan vendor:publish --provider="Chendujin\Bitcoin\BitcoinServiceProvider"