diff options
| author | Adam Soltys <[email protected]> | 2020-03-11 15:10:40 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-03-11 15:10:40 -0700 |
| commit | c0888fab024cc9f7c99812bfabf9d7774312dbf7 (patch) | |
| tree | cad95683af97432f6092a2c2bae10fbb7a588db5 /routes/lightning/query.js | |
| parent | bf2b51f0c2ae9b8f0f330dde6411e45fc0da8a25 (diff) | |
| download | coinos-server-c0888fab024cc9f7c99812bfabf9d7774312dbf7.tar.gz coinos-server-c0888fab024cc9f7c99812bfabf9d7774312dbf7.zip | |
refactor
Diffstat (limited to 'routes/lightning/query.js')
| -rw-r--r-- | routes/lightning/query.js | 7 |
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 })); +}; |
