PHP code example of 021 / ethereum-oracles

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

    

021 / ethereum-oracles example snippets


use O21\EthereumOracles\OffChain\Etherchain;
# ...

/** \O21\EthereumOracles\FeeStats\Stats $stats */
$stats = (new Etherchain)->getStats();

use O21\EthereumOracles\OffChain\EthGasStation;
use O21\EthereumOracles\FeeStats\Feature;
# ...

(new EthGasStation)->getStats(Feature::Speed, Feature::BlockNumber);