Expose getUtxos to public
This commit is contained in:
parent
12c53dd611
commit
55f3a46b77
|
@ -276,6 +276,15 @@ ExpressApp.prototype.start = function(opts, cb) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.get('/v1/utxos/', function(req, res) {
|
||||||
|
getServerWithAuth(req, res, function(server) {
|
||||||
|
server.getUtxos(function(err, utxos) {
|
||||||
|
if (err) return returnError(err, res, req);
|
||||||
|
res.json(utxos);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
router.post('/v1/txproposals/:id/signatures/', function(req, res) {
|
router.post('/v1/txproposals/:id/signatures/', function(req, res) {
|
||||||
getServerWithAuth(req, res, function(server) {
|
getServerWithAuth(req, res, function(server) {
|
||||||
req.body.txProposalId = req.params['id'];
|
req.body.txProposalId = req.params['id'];
|
||||||
|
|
|
@ -621,10 +621,9 @@ WalletService.prototype._getBlockchainExplorer = function(network) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _getUtxos
|
* Returns list of UTXOs
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
WalletService.prototype._getUtxos = function(cb) {
|
WalletService.prototype.getUtxos = function(cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
||||||
|
@ -735,7 +734,7 @@ WalletService.prototype._computeKbToSendMax = function(utxos, amount, cb) {
|
||||||
WalletService.prototype.getBalance = function(opts, cb) {
|
WalletService.prototype.getBalance = function(opts, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self._getUtxos(function(err, utxos) {
|
self.getUtxos(function(err, utxos) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
var balance = self._totalizeUtxos(utxos);
|
var balance = self._totalizeUtxos(utxos);
|
||||||
|
@ -867,7 +866,7 @@ WalletService.prototype._selectTxInputs = function(txp, cb) {
|
||||||
return _.pluck(_.sortBy(list, 'order'), 'utxo');
|
return _.pluck(_.sortBy(list, 'order'), 'utxo');
|
||||||
};
|
};
|
||||||
|
|
||||||
self._getUtxos(function(err, utxos) {
|
self.getUtxos(function(err, utxos) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
var balance = self._totalizeUtxos(utxos);
|
var balance = self._totalizeUtxos(utxos);
|
||||||
|
|
Loading…
Reference in New Issue