added two brand new api calls; getblockstats and getpoolinfo
This commit is contained in:
parent
175402fa85
commit
0340bf523d
19
public/include/pages/api/getblockstats.inc.php
Normal file
19
public/include/pages/api/getblockstats.inc.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Make sure we are called from index.php
|
||||||
|
if (!defined('SECURITY')) die('Hacking attempt');
|
||||||
|
|
||||||
|
// Check if the API is activated
|
||||||
|
$api->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;
|
||||||
|
?>
|
||||||
35
public/include/pages/api/getpoolinfo.inc.php
Normal file
35
public/include/pages/api/getpoolinfo.inc.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Make sure we are called from index.php
|
||||||
|
if (!defined('SECURITY')) die('Hacking attempt');
|
||||||
|
|
||||||
|
// Check if the API is activated
|
||||||
|
$api->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;
|
||||||
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user