From c7c6ee7ba59467b8ddcfe8196b4f7586a864f3c0 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 13 Feb 2026 21:07:55 -0800 Subject: account level currency and autowithdraw settings --- lib/invoices.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/invoices.ts') diff --git a/lib/invoices.ts b/lib/invoices.ts index e6b6e146..bf6c511e 100644 --- a/lib/invoices.ts +++ b/lib/invoices.ts @@ -52,7 +52,10 @@ export const generate = async ({ invoice, user }) => { aid = account.id; const rates = await g("rates"); - if (!currency) currency = user.currency; + if (!currency) { + const acct = aid ? await g(`account:${aid}`) : null; + currency = acct?.currency || user.currency; + } if (!rate) rate = rates[currency]; if (fiat) amount = Math.round((SATS * fiat) / rate); if (amount < 0) fail("invalid amount"); -- cgit v1.2.3