From 3a493d30daa964b8dcb0bf1c74df995d8dc9fa32 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 17 Sep 2024 06:50:06 +0000 Subject: pass invoice for internal --- lib/payments.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/payments.ts') diff --git a/lib/payments.ts b/lib/payments.ts index 8f197044..66e725c7 100644 --- a/lib/payments.ts +++ b/lib/payments.ts @@ -12,7 +12,6 @@ import { fail, fiat, getInvoice, - getUser, sleep, SATS, sats, @@ -605,14 +604,14 @@ export let sendLightning = async ({ } }; -export let sendInternal = async ({ amount, recipient, sender }) => { - let inv = await generate({ +export let sendInternal = async ({ amount, invoice = undefined, recipient, sender }) => { + if (!invoice) invoice = await generate({ invoice: { amount, type: "lightning" }, user: recipient, sender, }); - let { hash } = inv; + let { hash } = invoice; let memo; let p = await debit({ hash, amount, memo, user: sender }); -- cgit v1.2.3