diff options
| author | Adam Soltys <[email protected]> | 2024-12-26 20:45:52 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-12-26 20:45:52 -0800 |
| commit | fb75896a4000fa689a940d86f61824a65e13454e (patch) | |
| tree | 87e15c4ab6db98eff451604ce63acf8d76ec32c6 | |
| parent | cc0e94b7db8ec2e8adefc4f9145b0061684dba96 (diff) | |
| download | coinos-server-fb75896a4000fa689a940d86f61824a65e13454e.tar.gz coinos-server-fb75896a4000fa689a940d86f61824a65e13454e.zip | |
fix lookup invoice (fixes #69)
| -rw-r--r-- | lib/nwc.ts | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -212,7 +212,7 @@ const handle = (method, params, user, ev) => }, async lookup_invoice() { - const { invoice, payment_hash } = params; + let { invoice, payment_hash } = params; const { invoices } = await ln.listinvoices({ invstring: invoice, @@ -224,15 +224,17 @@ const handle = (method, params, user, ev) => amount_received_msat: amount, description, expires_at, - preimage, + payment_preimage, paid_at: settled_at, } = invoices[0]; + ({ bolt11: invoice, payment_hash } = invoices[0]); + return result({ type: "incoming", invoice, description, - preimage, + preimage: payment_preimage, payment_hash, amount, fees_paid: 0, @@ -255,6 +257,8 @@ const handle = (method, params, user, ev) => completed_at: settled_at, } = pays[0]; + ({ bolt11: invoice, payment_hash } = pays[0]); + return result({ type: "outgoing", invoice, |
