aboutsummaryrefslogtreecommitdiffstats
path: root/lib/invoices.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/invoices.ts')
-rw-r--r--lib/invoices.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/invoices.ts b/lib/invoices.ts
index 0a94334c..30ae8402 100644
--- a/lib/invoices.ts
+++ b/lib/invoices.ts
@@ -13,6 +13,7 @@ const lq = rpc(config.liquid);
export const generate = async ({ invoice, user }) => {
let {
bolt11,
+ bolt12,
aid,
currency,
expiry,
@@ -71,6 +72,13 @@ export const generate = async ({ invoice, user }) => {
if (r.payee !== nodeid) fail("invalid invoice");
amount = Math.round(r.amount_msat / 1000);
r.bolt11 = bolt11;
+ } else if (bolt12) {
+ r = await ln.offer({
+ amount_msat: amount ? `${amount + tip}sat` : "any",
+ label: id,
+ description: memo || "",
+ absolute_expiry: expiry,
+ });
} else {
expiry ||= 60 * 60 * 24 * 30;
r = await ln.invoice({