diff options
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/info.js | 9 | ||||
| -rw-r--r-- | routes/send.js | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/routes/info.js b/routes/info.js index 6d9d5f32..8d098a2f 100644 --- a/routes/info.js +++ b/routes/info.js @@ -1,6 +1,15 @@ const sequelize = require("sequelize"); const { Op } = sequelize; +/** + * @api {get} /info Request server information + * @apiName GetInfo + * @apiGroup Info + * + * @apiSuccess {Object} fx Exchange rates relative to USD - fx.CUR is the value of one CUR in USD. + * @apiSuccess {String[]} networks Array of supported networks; possible values are "bitcoin", "liquid" and "lightning". + * @apiSuccess {String} clientVersion the current git commit of the ui + */ app.get("/info", ah(async (req, res, next) => { const { clientVersion } = config; diff --git a/routes/send.js b/routes/send.js index 9b4396ef..e8fdb79c 100644 --- a/routes/send.js +++ b/routes/send.js @@ -68,7 +68,6 @@ module.exports = ah(async (req, res, next) => { emit(user.username, "payment", payment); emit(user.username, "account", account); - emit(user.username, "user", user); if (username) { let recipient = await db.User.findOne( @@ -85,6 +84,7 @@ module.exports = ah(async (req, res, next) => { let text = address || payreq; params = { where: { user_id: recipient.id }, + order: [["id", "DESC"]], }; if (text) params.where.text = text; let invoice = await db.Invoice.findOne(params); @@ -164,8 +164,8 @@ module.exports = ah(async (req, res, next) => { p2 = p2.get({ plain: true }); p2.account = a2.get({ plain: true }); - emit(recipient.username, "account", p2.account); emit(recipient.username, "payment", p2); + emit(recipient.username, "account", p2.account); l.info("received internal", recipient.username, amount); notify(recipient, `Received ${amount} ${a2.ticker} sats`); |
