-
Notifications
You must be signed in to change notification settings - Fork 498
Expand file tree
/
Copy pathproxy_config.php
More file actions
30 lines (24 loc) · 916 Bytes
/
proxy_config.php
File metadata and controls
30 lines (24 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
require '../php-binance-api.php';
$proxyConf = [
'proto' => 'http',
'address' => '192.168.1.1',
'port' => '8080',
'user' => 'dude',
'pass' => 'd00d'
];
// @see home_directory_config.php
// use config from ~/.confg/jaggedsoft/php-binance-api.json
$api = new Binance\API("","",["useServerTime"=>false],$proxyConf);
$tickers = $api->prices();
print_r($tickers); // List prices of all symbols
// Get balances for all of your positions, including estimated BTC value
$balances = $api->balances($tickers);
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;