-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
require '../php-binance-api.php'; | ||
|
||
$proxyConf = [ | ||
'proto' => 'tcp', | ||
'address' => '192.168.1.1', | ||
'port' => '8080', | ||
'user' => 'dude', | ||
'pass' => 'd00d' | ||
]; | ||
|
||
$api = new Binance\API("<key>","<secret>",["useServerTime"=>false],$proxyConf); | ||
|
||
$ticker = $api->prices(); | ||
print_r($ticker); // List prices of all symbols | ||
echo "Price of BNB: {$ticker['BNBBTC']} BTC.".PHP_EOL; | ||
|
||
// Get balances for all of your positions, including estimated BTC value | ||
$balances = $api->balances($ticker); | ||
print_r($balances); | ||
echo "BTC owned: ".$balances['BTC']['available'].PHP_EOL; | ||
echo "ETH owned: ".$balances['ETH']['available'].PHP_EOL; | ||
echo "Estimated Value: ".$api->btc_value." BTC".PHP_EOL; | ||
|
||
// Getting 24hr ticker price change statistics for a symbol | ||
$prevDay = $api->prevDay("BNBBTC"); | ||
print_r($prevDay); | ||
echo "BNB price change since yesterday: ".$prevDay['priceChangePercent']."%".PHP_EOL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters