PHP code example of openclerk / cryptocurrencies

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

    

openclerk / cryptocurrencies example snippets


use \Monolog\Logger;

$logger = new Logger("log");

$currency = new \Cryptocurrencies\Dogecoin();
$balance = $currency->getBalance("D64vbPp9TvqQ67xc6we5GnEtcKqiTXfp1S", $logger);

$currency = new \Cryptocurrencies\Bitcoin();
$balance = $currency->getBalanceWithConfirmations("17eTMdqaFRSttfBYB9chKEzHubECZPTS6p", 6, $logger);

$currency = new \Cryptocurrencies\Litecoin();
$balance = $currency->getDifficulty($logger);

$currency = new \Cryptocurrencies\Bitcoin();
return $currency->isValid("17eTMdqaFRSttfBYB9chKEzHubECZPTS6p");

vendor/bin/phpunit --bootstrap "vendor/autoload.php" test/DogecoinTest