Browse Source

v2/wallets/ endpoint

activeAddress
Ivan Socolsky 10 years ago
parent
commit
0ee0161e10
  1. 42
      lib/expressapp.js

42
lib/expressapp.js

@ -159,43 +159,23 @@ ExpressApp.prototype.start = function(opts, cb) {
}); });
}); });
// DEPRECATED
router.get('/v1/wallets/', function(req, res) { router.get('/v1/wallets/', function(req, res) {
getServerWithAuth(req, res, function(server) { getServerWithAuth(req, res, function(server) {
var result = {}; server.getStatus({
async.parallel([ includeExtendedInfo: true
}, function(err, status) {
function(next) { if (err) return returnError(err, res, req);
server.getWallet({}, function(err, wallet) { res.json(status);
if (err) return next(err);
result.wallet = wallet;
next();
}); });
},
function(next) {
server.getBalance({}, function(err, balance) {
if (err) return next(err);
result.balance = balance;
next();
}); });
},
function(next) {
server.getPendingTxs({}, function(err, pendingTxps) {
if (err) return next(err);
result.pendingTxps = pendingTxps;
next();
}); });
},
function(next) { router.get('/v2/wallets/', function(req, res) {
server.getPreferences({}, function(err, preferences) { getServerWithAuth(req, res, function(server) {
if (err) return next(err); server.getStatus({}, function(err, status) {
result.preferences = preferences;
next();
});
},
], function(err) {
if (err) return returnError(err, res, req); if (err) return returnError(err, res, req);
res.json(result); res.json(status);
}); });
}); });
}); });

Loading…
Cancel
Save