PHP code example of aleksandrzhiliaev / yii2-altcoind

1. Go to this page and download the library: Download aleksandrzhiliaev/yii2-altcoind 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/ */

    

aleksandrzhiliaev / yii2-altcoind example snippets


...
'components' => [
        'bitcoin' => [
            'class' => 'aleksandrzhiliaev\altcoind\components\Altcoin',
            'username' => 'rpc_username',
            'password' => 'rpc_password',
            'host' => 'rpc_host',
            'port' => 'rpc_port',
        ],
        'litecoin' => [
            'class' => 'aleksandrzhiliaev\altcoind\components\Altcoin',
            'username' => 'rpc_username',
            'password' => 'rpc_password',
            'host' => 'rpc_host',
            'port' => 'rpc_port',
        ],
        'ethereum' => [
            'class' => 'aleksandrzhiliaev\altcoind\components\Ethereum',
            'host' => 'rpc_host',
            'port' => 'rpc_port',
        ],
        'monero' => [
            'class' => 'aleksandrzhiliaev\altcoind\components\Monero',
            'host' => 'rpc_host',
            'port' => 'rpc_port',
        ],
        'ripple' => [
            'class' => 'aleksandrzhiliaev\altcoind\components\Ripple',
            'urlNode' => 'url',
            'address' => 'xrp_address',
            'secret' => 'xrp_secret',
        ],
        'zcash' => [
            'class' => 'aleksandrzhiliaev\altcoind\components\Altcoin',
            'username' => 'zec_account',
            'password' => 'zec_password',
            'host' => 'zec_host',
            'port' => 'zec_port',
        ],
        'bytecoin' => [
            'class' => 'aleksandrzhiliaev\altcoind\components\Bytecoin',
            'host' => 'bcn_host',           
        ],
    
        ...
]
...

$txid = Yii::$app->bitcoin->send('address', 0.0001);

$address = Yii::$app->bitcoin->generateAddress('account_name');

$walletInfo = Yii::$app->bitcoin->getInfo();

$generatedAddresses = Yii::$app->bitcoin->showAddresses('account_name');

'modules' => [
        ...
        'altcoind' => [
            'class' => 'aleksandrzhiliaev\altcoind\Module',
            'layout' => '@app/views/layouts/admin',
            'allowedUsers' => ['admin'],
            'wallets' => ['bitcoin', 'litecoin', 'ethereum', 'monero', 'ripple', 'zcash'],
            'mainPageCache' => 60 * 1,
        ],
        ...
]
...