From 5d6215a0e34e7a321e10db2b65fda0c85b00a0ab Mon Sep 17 00:00:00 2001 From: Joey Date: Fri, 4 Dec 2015 12:09:19 -0500 Subject: [PATCH 1/7] Update tools.class.php - add bleutrade api support Adds support for bleutrade api for the ticker --- include/classes/tools.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/classes/tools.class.php b/include/classes/tools.class.php index 06b3626e..d556d8ff 100644 --- a/include/classes/tools.class.php +++ b/include/classes/tools.class.php @@ -83,6 +83,8 @@ class Tools extends Base { return 'mintpal'; } else if (preg_match('/bittrex.com/', $url)) { return 'bittrex'; + } else if (preg_match('/bleutrade.com/', $url)) { + return 'bittrex'; } $this->setErrorMessage("API URL unknown"); return false; @@ -118,7 +120,10 @@ class Tools extends Base { case 'mintpal': return @$aData['0']['last_price']; break; - case 'bittrex': + case 'bittrex': + return @$aData['result']['Last']; + break; + case 'bleutrade': return @$aData['result']['Last']; break; } From c24f7bb397dea4197e41e56b066f11cbb06077dc Mon Sep 17 00:00:00 2001 From: Joey Date: Fri, 4 Dec 2015 12:12:38 -0500 Subject: [PATCH 2/7] Update tools.class.php --- include/classes/tools.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/classes/tools.class.php b/include/classes/tools.class.php index d556d8ff..672dfad8 100644 --- a/include/classes/tools.class.php +++ b/include/classes/tools.class.php @@ -84,7 +84,7 @@ class Tools extends Base { } else if (preg_match('/bittrex.com/', $url)) { return 'bittrex'; } else if (preg_match('/bleutrade.com/', $url)) { - return 'bittrex'; + return 'bleutrade'; } $this->setErrorMessage("API URL unknown"); return false; From 239550083670fcf0ef12d9473b3784f1c4f4a4ef Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 4 Dec 2015 19:52:40 +0100 Subject: [PATCH 3/7] Revert "Update tools.class.php - add bleutrade api support" --- include/classes/tools.class.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/classes/tools.class.php b/include/classes/tools.class.php index 672dfad8..06b3626e 100644 --- a/include/classes/tools.class.php +++ b/include/classes/tools.class.php @@ -83,8 +83,6 @@ class Tools extends Base { return 'mintpal'; } else if (preg_match('/bittrex.com/', $url)) { return 'bittrex'; - } else if (preg_match('/bleutrade.com/', $url)) { - return 'bleutrade'; } $this->setErrorMessage("API URL unknown"); return false; @@ -120,10 +118,7 @@ class Tools extends Base { case 'mintpal': return @$aData['0']['last_price']; break; - case 'bittrex': - return @$aData['result']['Last']; - break; - case 'bleutrade': + case 'bittrex': return @$aData['result']['Last']; break; } From e15695e1ffd5afa7320ee4d84ea35196e9cdd99d Mon Sep 17 00:00:00 2001 From: reappergrimd Date: Wed, 27 Jan 2016 22:13:52 +0200 Subject: [PATCH 4/7] Added cryptopia Api Call Change Allows Site admin to pull last price from this exchange. Configuration example $config['price']['enabled'] = true; $config['price']['url'] = 'https://www.cryptopia.co.nz/';; $config['price']['target'] = 'api/GetMarket/2274'; // API call to get market via market id of coin (api/GetMarket/{coin market id} $config['price']['currency'] = 'BTC'; // --- include/classes/tools.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/classes/tools.class.php b/include/classes/tools.class.php index 06b3626e..a21e07e8 100644 --- a/include/classes/tools.class.php +++ b/include/classes/tools.class.php @@ -77,6 +77,8 @@ class Tools extends Base { return 'btce'; } else if (preg_match('/cryptsy.com/', $url)) { return 'cryptsy'; + } else if (preg_match('/cryptopia.co.nz/', $url)) { + return 'cryptopia'; } else if (preg_match('/cryptorush.in/', $url)) { return 'cryptorush'; } else if (preg_match('/mintpal.com/', $url)) { @@ -112,6 +114,9 @@ class Tools extends Base { case 'cryptsy': return @$aData['return']['markets'][$strCurrency]['lasttradeprice']; break; + case 'cryptopia': + return @$aData['Data']['LastPrice']; + break; case 'cryptorush': return @$aData["$strCurrency/" . $this->config['price']['currency']]['last_trade']; break; From d6d68cb8b08ef7b5cda5394c897ce4dc27bc3d15 Mon Sep 17 00:00:00 2001 From: Jonny Bravo Date: Sun, 21 Feb 2016 13:41:10 -0500 Subject: [PATCH 5/7] Changed shares to BIGINT data type to account for BTC having far more shares than can be handled by standard INT datatype --- sql/000_base_structure.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/000_base_structure.sql b/sql/000_base_structure.sql index 8466915b..839789eb 100644 --- a/sql/000_base_structure.sql +++ b/sql/000_base_structure.sql @@ -182,10 +182,10 @@ CREATE TABLE IF NOT EXISTS `statistics_shares` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `account_id` int(10) unsigned NOT NULL, `block_id` int(10) unsigned NOT NULL, - `valid` int(11) NOT NULL, - `invalid` int(11) NOT NULL DEFAULT '0', - `pplns_valid` int(11) NOT NULL, - `pplns_invalid` int(11) NOT NULL DEFAULT '0', + `valid` bigint(20) NOT NULL, + `invalid` bigint(20) NOT NULL DEFAULT '0', + `pplns_valid` bigint(20) NOT NULL, + `pplns_invalid` bigint(20) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `account_id` (`account_id`), KEY `block_id` (`block_id`) From bc88b04ae96a034fed24a7819c292137ab7b4162 Mon Sep 17 00:00:00 2001 From: Jonny Bravo Date: Mon, 22 Feb 2016 13:41:16 -0500 Subject: [PATCH 6/7] added PH and EH --- include/smarty_globals.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/smarty_globals.inc.php b/include/smarty_globals.inc.php index bf0cd8f7..3c165261 100644 --- a/include/smarty_globals.inc.php +++ b/include/smarty_globals.inc.php @@ -47,7 +47,7 @@ if (! $statistics_ajax_refresh_interval = $setting->getValue('statistics_ajax_re if (! $statistics_ajax_long_refresh_interval = $setting->getValue('statistics_ajax_long_refresh_interval')) $statistics_ajax_long_refresh_interval = 10; // Small helper array -$aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' ); +$aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s', '0.000000000001' => 'PH/s', '0.000000000000001' => 'EH/s' ); // Global data for Smarty $aGlobal = array( From 7f7a1894c6733f18b8525f91452bfc66b2174f8a Mon Sep 17 00:00:00 2001 From: Jonny Bravo Date: Mon, 22 Feb 2016 13:41:34 -0500 Subject: [PATCH 7/7] added PH and EH --- include/config/admin_settings.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/config/admin_settings.inc.php b/include/config/admin_settings.inc.php index 9b88597e..3dd2a4da 100644 --- a/include/config/admin_settings.inc.php +++ b/include/config/admin_settings.inc.php @@ -197,21 +197,21 @@ $aSettings['statistics'][] = array( ); $aSettings['statistics'][] = array( 'display' => 'Pool Hashrate Modifier', 'type' => 'select', - 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' ), + 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s', '0.000000000001' => 'PH/s', '0.000000000000001' => 'EH/s' ), 'default' => '1', 'name' => 'statistics_pool_hashrate_modifier', 'value' => $setting->getValue('statistics_pool_hashrate_modifier'), 'tooltip' => 'Auto-adjust displayed pool hashrates to a certain limit.' ); $aSettings['statistics'][] = array( 'display' => 'Network Hashrate Modifier', 'type' => 'select', - 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' ), + 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s', '0.000000000001' => 'PH/s', '0.000000000000001' => 'EH/s' ), 'default' => '1', 'name' => 'statistics_network_hashrate_modifier', 'value' => $setting->getValue('statistics_network_hashrate_modifier'), 'tooltip' => 'Auto-adjust displayed network hashrates to a certain limit.' ); $aSettings['statistics'][] = array( 'display' => 'Personal Hashrate Modifier', 'type' => 'select', - 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' ), + 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s', '0.000000000001' => 'PH/s', '0.000000000000001' => 'EH/s' ), 'default' => '1', 'name' => 'statistics_personal_hashrate_modifier', 'value' => $setting->getValue('statistics_personal_hashrate_modifier'), 'tooltip' => 'Auto-adjust displayed personal hashrates to a certain limit.'