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