Created
January 13, 2018 21:40
-
-
Save bakman2/2c27c2346b8dd09eb5c3eb4ac41de522 to your computer and use it in GitHub Desktop.
debug.php
This file contains hidden or 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
<?php | |
include 'functions.php'; | |
include platformSlashes("lib/ccxt.php"); | |
$allcoins = file_get_contents(platformSlashes('lib/data/coinlist.json')); | |
$coinList = json_decode($allcoins, true); | |
echo "debug..."; | |
echo sizeof($config['api']). " keys found.<br/><br/>"; | |
if(isset($config['api']) && sizeof($config['api'])>0){ | |
foreach ($config['api'] as $key => $value) { | |
$c = '\ccxt\\'.$key; | |
try { | |
$out = new $c ( array ( 'apiKey' => $config['api'][$key]['api'], 'secret' => $config['api'][$key]['secret'] )); | |
foreach ($out->fetch_balance()['total'] as $k => $v) { | |
if($v>0.0009){ | |
if(isset($coinList['Data'][$k]['CoinName'])){ | |
echo $key . ": symbol: ".$k." : ". $coinList['Data'][$k]['CoinName']. " balance:". $v."<br/>"; | |
$coindata['coins'][$key][$k]['wallettype'] = 'exchange'; | |
$coindata['coins'][$key][$k]['walletname'] = $key; | |
$coindata['coins'][$key][$k]['name'] = $coinList['Data'][$k]['CoinName']; | |
$coindata['coins'][$key][$k]['fullname'] = $coinList['Data'][$k]['FullName']; | |
$coindata['coins'][$key][$k]['owned'] = $v; | |
} | |
} | |
} | |
} | |
catch (Exception $e) { | |
echo $e->getMessage (); | |
} | |
} | |
} | |
if(isset($coindata) && sizeof($coindata)>0){ | |
foreach ($coindata['coins'] as $key => $val) { | |
foreach ($val as $i => $v) { | |
if($v['owned']>0.001 || $v['walletname']=='watch'){ | |
$output[] = array("symbol"=>$i, "name"=>$v['name'], "wallettype"=>$v['wallettype'], "walletname"=>$v['walletname'], "coinsOwned"=>$v['owned'], "fullName"=>$v['fullname'], "image"=>symbol_lookup($i)); | |
$coins = $output; | |
} | |
} | |
} | |
} | |
echo "<br/>"; | |
print_r($coins); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment