mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
Revert "api: handle cryptobridge public balances"
This explorer data seems fully random and incomplete, useless so
This reverts commit a36f11d6ba
.
This commit is contained in:
parent
f7018873f5
commit
0a5f7c681d
5 changed files with 0 additions and 80 deletions
|
@ -54,7 +54,6 @@ define('EXCH_CEXIO_KEY', '');
|
||||||
define('EXCH_COINMARKETS_USER', '');
|
define('EXCH_COINMARKETS_USER', '');
|
||||||
define('EXCH_COINMARKETS_PIN', '');
|
define('EXCH_COINMARKETS_PIN', '');
|
||||||
define('EXCH_CREX24_KEY', '');
|
define('EXCH_CREX24_KEY', '');
|
||||||
define('EXCH_CRYPTOBRIDGE_ID', '');
|
|
||||||
define('EXCH_BINANCE_KEY', '');
|
define('EXCH_BINANCE_KEY', '');
|
||||||
define('EXCH_BITSTAMP_ID','');
|
define('EXCH_BITSTAMP_ID','');
|
||||||
define('EXCH_BITSTAMP_KEY','');
|
define('EXCH_BITSTAMP_KEY','');
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
# API able to query balances
|
|
||||||
# https://cryptofresh.com/api/account/balances?account=...
|
|
||||||
|
|
||||||
function cryptobridge_api_user($method, $params='')
|
|
||||||
{
|
|
||||||
$uri = "https://cryptofresh.com/api/{$method}";
|
|
||||||
if (!empty($params)) $uri .= "?{$params}";
|
|
||||||
|
|
||||||
$ch = curl_init($uri);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
|
||||||
|
|
||||||
$execResult = strip_tags(curl_exec($ch));
|
|
||||||
$arr = json_decode($execResult, true);
|
|
||||||
|
|
||||||
return $arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
function doCryptobridgeTrading($quick=false)
|
|
||||||
{
|
|
||||||
$exchange = 'cryptobridge';
|
|
||||||
$updatebalances = true;
|
|
||||||
|
|
||||||
if (empty(EXCH_CRYPTOBRIDGE_ID)) return;
|
|
||||||
if (exchange_get($exchange, 'disabled')) return;
|
|
||||||
|
|
||||||
$balances = cryptobridge_api_user('account/balances','account='.EXCH_CRYPTOBRIDGE_ID);
|
|
||||||
if (!is_array($balances)) return;
|
|
||||||
|
|
||||||
$savebalance = getdbosql('db_balances', "name='$exchange'");
|
|
||||||
if (is_object($savebalance)) {
|
|
||||||
$savebalance->balance = 0;
|
|
||||||
$savebalance->onsell = 0;
|
|
||||||
$savebalance->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($balances as $asset => $balance)
|
|
||||||
{
|
|
||||||
$parts = explode('.', $asset);
|
|
||||||
$symbol = arraySafeVal($parts,1);
|
|
||||||
if (empty($symbol) || $parts[0] != 'BRIDGE') continue;
|
|
||||||
|
|
||||||
if ($symbol == 'BTC') {
|
|
||||||
if (is_object($savebalance)) {
|
|
||||||
$savebalance->balance = arraySafeVal($balance,'balance',0);
|
|
||||||
$savebalance->onsell = arraySafeVal($balance,'orders',0);
|
|
||||||
$savebalance->save();
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($updatebalances) {
|
|
||||||
// store available balance in market table
|
|
||||||
$coins = getdbolist('db_coins', "symbol=:symbol OR symbol2=:symbol",
|
|
||||||
array(':symbol'=>$symbol)
|
|
||||||
);
|
|
||||||
if (empty($coins)) continue;
|
|
||||||
foreach ($coins as $coin) {
|
|
||||||
$market = getdbosql('db_markets', "coinid=:coinid AND name='$exchange'", array(':coinid'=>$coin->id));
|
|
||||||
if (!$market) continue;
|
|
||||||
$market->balance = arraySafeVal($balance,'balance',0);
|
|
||||||
$market->ontrade = arraySafeVal($balance,'orders',0);
|
|
||||||
$market->balancetime = time();
|
|
||||||
$market->save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!YAAMP_ALLOW_EXCHANGE) return;
|
|
||||||
|
|
||||||
// more could be done i guess
|
|
||||||
}
|
|
|
@ -9,7 +9,6 @@ require_once('yobit_trading.php');
|
||||||
require_once('alcurex_trading.php');
|
require_once('alcurex_trading.php');
|
||||||
require_once('coinsmarkets_trading.php');
|
require_once('coinsmarkets_trading.php');
|
||||||
require_once('crex24_trading.php');
|
require_once('crex24_trading.php');
|
||||||
require_once('cryptobridge_trading.php');
|
|
||||||
require_once('cryptopia_trading.php');
|
require_once('cryptopia_trading.php');
|
||||||
require_once('hitbtc_trading.php');
|
require_once('hitbtc_trading.php');
|
||||||
require_once('kucoin_trading.php');
|
require_once('kucoin_trading.php');
|
||||||
|
@ -83,7 +82,6 @@ function runExchange($exchangeName=false)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'cryptobridge':
|
case 'cryptobridge':
|
||||||
doCryptobridgeTrading(true);
|
|
||||||
updateCryptoBridgeMarkets();
|
updateCryptoBridgeMarkets();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ if (!defined('EXCH_CCEX_KEY')) define('EXCH_CCEX_KEY', '');
|
||||||
if (!defined('EXCH_CEXIO_ID')) define('EXCH_CEXIO_ID', '');
|
if (!defined('EXCH_CEXIO_ID')) define('EXCH_CEXIO_ID', '');
|
||||||
if (!defined('EXCH_CEXIO_KEY')) define('EXCH_CEXIO_KEY', '');
|
if (!defined('EXCH_CEXIO_KEY')) define('EXCH_CEXIO_KEY', '');
|
||||||
if (!defined('EXCH_CREX24_KEY')) define('EXCH_CREX24_KEY', '');
|
if (!defined('EXCH_CREX24_KEY')) define('EXCH_CREX24_KEY', '');
|
||||||
if (!defined('EXCH_CRYPTOBRIDGE_ID')) define('EXCH_CRYPTOBRIDGE_ID', '');
|
|
||||||
if (!defined('EXCH_CRYPTOPIA_KEY')) define('EXCH_CRYPTOPIA_KEY', '');
|
if (!defined('EXCH_CRYPTOPIA_KEY')) define('EXCH_CRYPTOPIA_KEY', '');
|
||||||
if (!defined('EXCH_HITBTC_KEY')) define('EXCH_HITBTC_KEY', '');
|
if (!defined('EXCH_HITBTC_KEY')) define('EXCH_HITBTC_KEY', '');
|
||||||
if (!defined('EXCH_POLONIEX_KEY')) define('EXCH_POLONIEX_KEY', '');
|
if (!defined('EXCH_POLONIEX_KEY')) define('EXCH_POLONIEX_KEY', '');
|
||||||
|
|
|
@ -142,7 +142,6 @@ class CronjobController extends CommonController
|
||||||
doBinanceTrading();
|
doBinanceTrading();
|
||||||
doCCexTrading();
|
doCCexTrading();
|
||||||
doBleutradeTrading();
|
doBleutradeTrading();
|
||||||
doCryptobridgeTrading();
|
|
||||||
doKuCoinTrading();
|
doKuCoinTrading();
|
||||||
doNovaTrading();
|
doNovaTrading();
|
||||||
doYobitTrading();
|
doYobitTrading();
|
||||||
|
|
Loading…
Add table
Reference in a new issue