Update api.js

Add blocks api call.
Add immature balance to api.
This commit is contained in:
hellcatz 2017-09-01 19:07:15 -07:00 committed by GitHub
parent 589ec86400
commit 9911037d1b
1 changed files with 7 additions and 1 deletions

View File

@ -22,6 +22,12 @@ module.exports = function(logger, portalConfig, poolConfigs){
res.header('Content-Type', 'application/json');
res.end(JSON.stringify(portalStats.statPoolHistory));
return;
case 'blocks':
portalStats.getBlocks(function(data){
res.header('Content-Type', 'application/json');
res.end(JSON.stringify(data));
});
break;
case 'payments':
var poolBlocks = [];
for(var pool in portalStats.stats.pools) {
@ -82,7 +88,7 @@ module.exports = function(logger, portalConfig, poolConfigs){
}
}
}
res.end(JSON.stringify({miner: address, totalHash: totalHash, totalShares: totalShares, networkSols: networkSols, balance: balances.totalHeld, paid: balances.totalPaid, workers: workers, history: history}));
res.end(JSON.stringify({miner: address, totalHash: totalHash, totalShares: totalShares, networkSols: networkSols, immature: balances.totalImmature, balance: balances.totalHeld, paid: balances.totalPaid, workers: workers, history: history}));
});
});
} else {