aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorRan Guin <[email protected]>2021-08-21 01:39:43 -0700
committerRan Guin <[email protected]>2021-08-21 01:39:43 -0700
commit6724a8660b9d47dcbac362122006cf454f13512f (patch)
tree4e91b5f9a09a4371502c65c66b6c5d080a050f7b /routes
parentc0106191e9d25ac51b3142a79cb749b11616e20f (diff)
parent71feadc098cf374f37bb168204dee443aa9a50f0 (diff)
downloadcoinos-server-6724a8660b9d47dcbac362122006cf454f13512f.tar.gz
coinos-server-6724a8660b9d47dcbac362122006cf454f13512f.zip
Merge branch 'dev' of https://github.com/coinos/coinos-server into dev
Diffstat (limited to 'routes')
-rw-r--r--routes/info.js9
-rw-r--r--routes/send.js4
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`);