aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-04-13 06:04:18 +0000
committerAdam Soltys <[email protected]>2025-04-13 06:04:18 +0000
commit19d0997d10d4ed9054cf63328ea148c9367ef40e (patch)
treec58694e587ef2dbc63498756342e1e92d89228cb
parentfb5ae5bb2e3471df9471cb334e0c31fc6c9dcfcb (diff)
downloadcoinos-server-19d0997d10d4ed9054cf63328ea148c9367ef40e.tar.gz
coinos-server-19d0997d10d4ed9054cf63328ea148c9367ef40e.zip
put metadata in payment memo
-rw-r--r--lib/nwc.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/nwc.ts b/lib/nwc.ts
index 9629ebb5..c659141a 100644
--- a/lib/nwc.ts
+++ b/lib/nwc.ts
@@ -102,7 +102,7 @@ export default () => {
const handle = (method, params, ev, app, user) =>
({
async pay_invoice() {
- const { invoice: pr } = params;
+ const { invoice: pr, metadata } = params;
const { amount_msat, payee } = await ln.decode(pr);
const { id } = await ln.getinfo();
const amount = Math.round(amount_msat / 1000);
@@ -198,6 +198,7 @@ const handle = (method, params, ev, app, user) =>
fee: max_fee || Math.round(amount * 0.01),
user,
pr,
+ memo: JSON.stringify(metadata)
});
await db.lPush(`${pubkey}:payments`, pid);