aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/query.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/lightning/query.js')
-rw-r--r--routes/lightning/query.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/routes/lightning/query.js b/routes/lightning/query.js
new file mode 100644
index 00000000..8e25293c
--- /dev/null
+++ b/routes/lightning/query.js
@@ -0,0 +1,7 @@
+const bolt11 = require("bolt11");
+
+module.exports = async (req, res) => {
+ let hash = req.body.payreq;
+ let payreq = bolt11.decode(hash);
+ res.send(await lna.queryRoutes({ pub_key: payreq.payeeNodeKey, amt: payreq.satoshis }));
+};