mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 08:48:07 +00:00
commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
- [Fetch Balance](./examples/php/)
|
||||
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
include dirname(dirname(dirname(__FILE__))) . '/ccxt.php';
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
$exchange = new \ccxt\okx(array(
|
||||
// 'verbose' => true, // for debugging
|
||||
// 'timeout' => 30000,
|
||||
"apiKey" => "YOUR_API_KEY",
|
||||
"secret" => "YOUR_API_SECRET",
|
||||
));
|
||||
|
||||
try {
|
||||
// about balance, read docs at : https://github.com/ccxt/ccxt/wiki/Manual#balance-structure
|
||||
$result = $exchange->fetch_balance ();
|
||||
print_r ($result);
|
||||
|
||||
} catch (\ccxt\NetworkError $e) {
|
||||
echo '[Network Error] ' . $e->getMessage() . "\n";
|
||||
} catch (Exception $e) {
|
||||
echo '[Error] ' . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user