From c0888fab024cc9f7c99812bfabf9d7774312dbf7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Mar 2020 15:10:40 -0700 Subject: refactor --- routes/lightning/query.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 routes/lightning/query.js (limited to 'routes/lightning/query.js') 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 })); +}; -- cgit v1.2.3