AddressProperty for totalSent
This commit is contained in:
parent
f88fdff88c
commit
306f2cd1e3
|
@ -45,3 +45,16 @@ exports.totalReceived = function(req, res, next) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
exports.totalSent = function(req, res, next) {
|
||||
var a = getAddr(req, res, next);
|
||||
if (a)
|
||||
a.update(function(err) {
|
||||
if (err) {
|
||||
return common.handleErrors(err, res);
|
||||
}
|
||||
else {
|
||||
return res.jsonp(a.totalSentSat);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -36,6 +36,7 @@ module.exports = function(app) {
|
|||
var addressProperties = require('../app/controllers/addressProperties.js');
|
||||
app.get(apiPrefix + '/addr/:addr/balance', addressProperties.balance);
|
||||
app.get(apiPrefix + '/addr/:addr/totalReceived', addressProperties.totalReceived);
|
||||
app.get(apiPrefix + '/addr/:addr/totalSent', addressProperties.totalSent);
|
||||
|
||||
// Status route
|
||||
var st = require('../app/controllers/status');
|
||||
|
|
Loading…
Reference in New Issue