Browse Source

add express endpoint

activeAddress
Ivan Socolsky 9 years ago
parent
commit
6f69282db0
No known key found for this signature in database GPG Key ID: FAECE6A05FAA4F56
  1. 8
      lib/expressapp.js

8
lib/expressapp.js

@ -401,10 +401,12 @@ ExpressApp.prototype.start = function(opts, cb) {
router.get('/v1/sendmaxinfo/', function(req, res) {
getServerWithAuth(req, res, function(server) {
var q = req.query;
var opts = {};
opts.feePerKb = +req.query.feePerKb;
if (req.query.excludeUnconfirmedUtxos == '1') opts.excludeUnconfirmedUtxos = true;
if (req.query.returnInputs == '1') opts.returnInputs = true;
if (q.feePerKb) opts.feePerKb = +q.feePerKb;
if (q.feeLevel) opts.feeLevel = q.feeLevel;
if (q.excludeUnconfirmedUtxos == '1') opts.excludeUnconfirmedUtxos = true;
if (q.returnInputs == '1') opts.returnInputs = true;
server.getSendMaxInfo(opts, function(err, info) {
if (err) return returnError(err, res, req);
res.json(info);

Loading…
Cancel
Save