Skip to content

Commit

Permalink
Update readme with reserve examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno Rafael Rocha committed Feb 1, 2015
1 parent 7401d1d commit b359524
Showing 1 changed file with 119 additions and 0 deletions.
119 changes: 119 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b359524

Please sign in to comment.