Browse Source

add v2/balance endpoint

activeAddress
Ivan Socolsky 9 years ago
parent
commit
4e7241e86d
  1. 10
      lib/expressapp.js
  2. 1
      test/storage.js

10
lib/expressapp.js

@ -314,6 +314,7 @@ ExpressApp.prototype.start = function(opts, cb) {
});
});
// DEPRECATED
router.get('/v1/balance/', function(req, res) {
getServerWithAuth(req, res, function(server) {
server.getBalance({}, function(err, balance) {
@ -323,6 +324,15 @@ ExpressApp.prototype.start = function(opts, cb) {
});
});
router.get('/v2/balance/', function(req, res) {
getServerWithAuth(req, res, function(server) {
server.getBalance2Steps({}, function(err, balance) {
if (err) return returnError(err, res, req);
res.json(balance);
});
});
});
// DEPRECATED
router.get('/v1/feelevels/', function(req, res) {
var opts = {};

1
test/storage.js

@ -77,6 +77,7 @@ describe('Storage', function() {
});
});
});
describe('Copayer lookup', function() {
it('should correctly store and fetch copayer lookup', function(done) {
var wallet = Model.Wallet.create({

Loading…
Cancel
Save