From eb4e11fd5e90284585e5c3c7bc9e86febaa29114 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 31 Oct 2024 09:04:09 -0700 Subject: detect internal payments --- src/lib/parse.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/lib/parse.ts') diff --git a/src/lib/parse.ts b/src/lib/parse.ts index fcce7e1e..0ebbe003 100644 --- a/src/lib/parse.ts +++ b/src/lib/parse.ts @@ -29,6 +29,14 @@ export default async (t, host) => { if (t.includes("/fund")) redirect(307, t.substring(t.indexOf("/fund"))); + // invoice + let invoice; + try { + invoice = await get(`/invoice/${t}`); + } catch (e) {} + + if (invoice) redirect(307, `/send/invoice/${invoice.id}`); + // lightning if (t.toLowerCase().startsWith("lightning:")) t = t.toLowerCase().replace("lightning:", ""); @@ -69,12 +77,4 @@ export default async (t, host) => { } catch (e) {} if (fund) redirect(307, `/send/fund/${t}`); - - // invoice - let invoice; - try { - invoice = await get(`/invoice/${t}`); - } catch (e) {} - - if (invoice) redirect(307, `/send/invoice/${invoice.id}`); }; -- cgit v1.2.3