diff options
| author | Adam Soltys <[email protected]> | 2021-12-16 20:44:08 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-12-16 20:46:19 -0800 |
| commit | 544cb8011dd20b316a676d0b10e3705eb4c050c2 (patch) | |
| tree | c2ff88d3f603485db0b2be6cb1c007296b476a47 | |
| parent | 6af2c1597081094d76494936494ee2c693a50f02 (diff) | |
| download | coinos-server-544cb8011dd20b316a676d0b10e3705eb4c050c2.tar.gz coinos-server-544cb8011dd20b316a676d0b10e3705eb4c050c2.zip | |
encode endpoint
| -rw-r--r-- | routes/lnurl.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/routes/lnurl.js b/routes/lnurl.js index 65118108..dee43170 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -251,6 +251,13 @@ app.get( ); app.get( + "/encode", + ah(async (req, res, next) => { + res.send(lnurl.encode(req.query.text)); + }) +); + +app.get( "/decode", ah(async (req, res, next) => { const { text } = req.query; @@ -281,9 +288,9 @@ app.get( }) ); -lnurlServer.on('payRequest:action:processed', async function(event) { - const { secret, params, result } = event; - const { id, invoice } = result; +lnurlServer.on("payRequest:action:processed", async function(event) { + const { secret, params, result } = event; + const { id, invoice } = result; const recipient = recipients[secret]; let payreq = bolt11.decode(invoice); |
