PHP code example of hexim / zcash-bundle

1. Go to this page and download the library: Download hexim/zcash-bundle 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/ */

    

hexim / zcash-bundle example snippets


public function yourAction(Request $request)
{
        $wallet = $this->get('hexim_zcash.wallet');
        if (!$walletInfo = $wallet->getWalletInfo()) {
            throw new \Exception('Error: ' . $wallet->getError());
        }

        ...
}

public function yourAction(Request $request)
{
        $wallet = $this->get('hexim_zcash.wallet');
        $walletInfo = $wallet->getWalletInfo();
        $transactions = $wallet->listTransactions($walletInfo['result']['txcount']);
        
        ...
}

public function yourAction(Request $request)
{
        $myAddress = "t1ededed...";

        $zcashUtil = $this->get('hexim_zcash.util');
        if ($data = $zcashUtil->validateAddress($myAddress) {
            if (!$data['result']['isvalid']) {
                $this->addFlash('error', ' Sorry but this tAddress is not valid zcash address.');
                return $this->render('any.html.twig', [
                    'anyForm' => $form->createView(),
                ]);
            }
        }

        ...
}
 php
    // app/AppKernel.php
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Hexim\HeximZcashBundle\HeximZcashBundle(),
            // ...
        );
    }