From 25cf51c8dbb6f3cea93c10832a05b9a65743bfee Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 26 Jul 2025 16:20:47 -0700 Subject: add missing make_invoice fields (fixes #78) --- lib/nwc.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/nwc.ts') diff --git a/lib/nwc.ts b/lib/nwc.ts index c659141a..d82d35e2 100644 --- a/lib/nwc.ts +++ b/lib/nwc.ts @@ -198,7 +198,7 @@ const handle = (method, params, ev, app, user) => fee: max_fee || Math.round(amount * 0.01), user, pr, - memo: JSON.stringify(metadata) + memo: JSON.stringify(metadata), }); await db.lPush(`${pubkey}:payments`, pid); @@ -277,7 +277,11 @@ const handle = (method, params, ev, app, user) => expiry, }; - const { hash, created: created_at } = await generate({ invoice, user }); + const { + hash, + created: created_at, + paymentHash, + } = await generate({ invoice, user }); return result({ type: "incoming", @@ -287,6 +291,8 @@ const handle = (method, params, ev, app, user) => amount, created_at, expires_at: created_at + expiry, + fees_paid: 0, + payment_hash: paymentHash, metadata: {}, }); }, -- cgit v1.2.3