PHP code example of dve / cex.io-php

1. Go to this page and download the library: Download dve/cex.io-php 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/ */

    

dve / cex.io-php example snippets


$orderBook = $client->orderBook('BTC', 'EUR', 5);
 
foreach($orderBook->getBids() as $bid) {
    echo $bid->getAmount() . ' BTC @ ' . $bid->getRate() . ' EUR'."\n";
}
 
foreach($orderBook->getAsks() as $ask) {
    echo $ask->getAmount() . ' BTC @ ' . $ask->getRate() . ' EUR'."\n";
}


$response = $client->lastPrice('BTC', 'EUR');
echo 'The last price for BTC/EUR pair is ' . $response->getLprice() . ' EUR'."\n";

$balance = $client->balance();
echo 'You have ' . $balance->getXRP()->getAvailable() . ' XRP'."\n";