From 0340bf523df9d2cfca0e1349cbe38c5fdc6d143e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Uslu?= Date: Mon, 13 Jan 2014 23:57:26 +0200 Subject: [PATCH] added two brand new api calls; getblockstats and getpoolinfo --- .../include/pages/api/getblockstats.inc.php | 19 ++++++++++ public/include/pages/api/getpoolinfo.inc.php | 35 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 public/include/pages/api/getblockstats.inc.php create mode 100644 public/include/pages/api/getpoolinfo.inc.php diff --git a/public/include/pages/api/getblockstats.inc.php b/public/include/pages/api/getblockstats.inc.php new file mode 100644 index 00000000..9d6200d5 --- /dev/null +++ b/public/include/pages/api/getblockstats.inc.php @@ -0,0 +1,19 @@ +isActive(); + +// Check user token +$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']); + +$blocks = $statistics->getLastBlocksbyTime(); + +// Output JSON format +echo $api->get_json($blocks); + +// Supress master template +$supress_master = 1; +?> diff --git a/public/include/pages/api/getpoolinfo.inc.php b/public/include/pages/api/getpoolinfo.inc.php new file mode 100644 index 00000000..799c249b --- /dev/null +++ b/public/include/pages/api/getpoolinfo.inc.php @@ -0,0 +1,35 @@ +isActive(); + +// Check user token +$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']); + +// Output JSON format +$data = array( + // coin info + 'currency' => $config[currency], + 'coinname' => $config[gettingstarted][coinname], + // coin algorithm info + 'cointarget' => $config[cointarget], + 'coindiffchangetarget' => $config[coindiffchangetarget], + 'algorithm' => $config[algorithm], + // stratum + 'stratumport' => $config[gettingstarted][stratumport], + // payments + 'payout_system' => $config[payout_system], + 'min_ap_threshold' => $config[ap_threshold][min], + 'max_ap_threshold' => $config[ap_threshold][max], + 'txfee' => $config[txfee], + 'fees' => $config[fees], +); + +echo $api->get_json($data); + +// Supress master template +$supress_master = 1; +?>