From 2a408a3a7486464296e4e7f996fc2140a664d407 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 26 Nov 2025 10:56:20 -0800 Subject: ark --- lib/invoices.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/invoices.ts') diff --git a/lib/invoices.ts b/lib/invoices.ts index ad0b604e..9666d217 100644 --- a/lib/invoices.ts +++ b/lib/invoices.ts @@ -22,6 +22,7 @@ export const generate = async ({ invoice, user }) => { expiry, fiat, id, + hash, tip, amount, items = [], @@ -59,11 +60,21 @@ export const generate = async ({ invoice, user }) => { if (!id) id = v4(); - let hash; let text; let paymentHash; - if (type === PaymentType.lightning) { + if (account.seed) { + if (type !== PaymentType.ark) { + type = PaymentType.bitcoin; + const node = rpc({ ...config[type], wallet: aid }); + hash = await node.getNewAddress({ address_type }); + text = bip21(hash, invoice); + + ({ hdkeypath: path } = await node.getAddressInfo(hash)); + } else { + text = hash; + } + } else if (type === PaymentType.lightning) { let r; if (bolt11) { const { id: nodeid } = await ln.getinfo(); -- cgit v1.2.3