diff --git a/README.md b/README.md index 0534547..27f7b94 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,125 @@ $transaction = $card->createTransaction('foo@bar.com', '2.0', 'BTC'); $transaction->commit(); ``` +### Get all public transactions +```php +require_once 'vendor/autoload.php'; + +use \Bitreserve\BitreserveClient as Client; + +// Initialize the client. In this case, we don't need an +// AUTHORIZATION_TOKEN because the Ticker endpoint is public. +$client = new Client(); + +// Get all public transactions. +$transactions = $client->getReserve()->getTransactions(); +``` + +Or you could get a specific public transaction: + +```php +// Get one public transaction. +$transaction = $client->getReserve()->getTransactionById('a97bb994-6e24-4a89-b653-e0a6d0bcf634'); +``` + +### Get reserve status +```php +require_once 'vendor/autoload.php'; + +use \Bitreserve\BitreserveClient as Client; + +// Initialize the client. In this case, we don't need an +// AUTHORIZATION_TOKEN because the Ticker endpoint is public. +$client = new Client(); + +// Get the reserve summary of all the obligations and assets within it. +$statistics = $client->getReserve()->getStatistics(); +``` + +The above produces the output shown below: + +```php +Array +( + [0] => Array + ( + [currency] => BTC + [values] => Array + ( + [0] => Array + ( + [assets] => 2716.583268 + [currency] => BTC + [liabilities] => 2143.867814 + [rate] => 1.00 + ) + + [1] => Array + ( + [assets] => 580465.93 + [currency] => USD + [liabilities] => 458090.96 + [rate] => 213.67500 + ) + + [2] => Array + ( + [assets] => 514369.46 + [currency] => EUR + [liabilities] => 405929.07 + [rate] => 189.34382 + ) + + [3] => Array + ( + [assets] => 385269.26 + [currency] => GBP + [liabilities] => 304046.04 + [rate] => 141.82037 + ) + + [4] => Array + ( + [assets] => 3628492.53 + [currency] => CNY + [liabilities] => 2863526.59 + [rate] => 1335.68242 + ) + + [5] => Array + ( + [assets] => 68236672.40 + [currency] => JPY + [liabilities] => 53850882.80 + [rate] => 25118.56462 + ) + + [6] => Array + ( + [assets] => 452.05261064 + [currency] => XAU + [liabilities] => 356.74998941 + [rate] => 0.16640367 + ) + + ) + + [totals] => Array + ( + [commissions] => 116.74094 + [transactions] => 27631.76926 + [assets] => 4721.54444736 + [liabilities] => 4069.44806438 + ) + + ) + + <...> + +) +``` + + ## Contributing & Development #### Contributing