aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/withdraw.js
diff options
context:
space:
mode:
authorGyulai Zoltan <[email protected]>2021-10-12 13:53:33 +0300
committerGyulai Zoltan <[email protected]>2021-10-12 13:53:33 +0300
commit92ffc6e2e597867a55b592a20b16c233efad9cef (patch)
tree9bfad78872592637a241624de9edde36986b4b07 /routes/lightning/withdraw.js
parent5f949a00ab98792db22bb5ab0104a06c714932f2 (diff)
downloadcoinos-server-withdraw.tar.gz
coinos-server-withdraw.zip
feat: added lightning withdrawal with hardcoded fee estimationwithdraw
Diffstat (limited to 'routes/lightning/withdraw.js')
-rw-r--r--routes/lightning/withdraw.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/routes/lightning/withdraw.js b/routes/lightning/withdraw.js
new file mode 100644
index 00000000..d1712d39
--- /dev/null
+++ b/routes/lightning/withdraw.js
@@ -0,0 +1,11 @@
+module.exports = ah(async (req, res) => {
+ let { amount, memo, payreq } = req.body;
+ let { user } = req;
+
+ try {
+ res.send(await send(amount, memo, payreq, user, true));
+ } catch (e) {
+ l.error("problem sending lightning withdrawal", user.username, e.message, e.stack);
+ res.status(500).send(e.message);
+ }
+});