aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lnurl.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-24 13:18:42 -0800
committerAdam Soltys <[email protected]>2026-02-24 13:18:42 -0800
commitad7b09b43323d0ffc0a8ddabb43e4838a184c697 (patch)
treefbf2a59f81771b2938f474c8e7b35a497d2960e4 /routes/lnurl.ts
parent9e97e040617bfa0b40150c0eba298bf186bbeeaf (diff)
downloadcoinos-server-ad7b09b43323d0ffc0a8ddabb43e4838a184c697.tar.gz
coinos-server-ad7b09b43323d0ffc0a8ddabb43e4838a184c697.zip
formatting
Diffstat (limited to 'routes/lnurl.ts')
-rw-r--r--routes/lnurl.ts19
1 files changed, 5 insertions, 14 deletions
diff --git a/routes/lnurl.ts b/routes/lnurl.ts
index 0358488e..cb74e2b5 100644
--- a/routes/lnurl.ts
+++ b/routes/lnurl.ts
@@ -19,9 +19,7 @@ export default {
query: { address },
} = req;
const [name, domain] = address.split("@");
- const url = `https://${domain}/.well-known/lnurlp/${name
- .toLowerCase()
- .replace(/\s/g, "")}`;
+ const url = `https://${domain}/.well-known/lnurlp/${name.toLowerCase().replace(/\s/g, "")}`;
try {
const r = await got(url).json();
@@ -41,9 +39,7 @@ export default {
query: { text },
} = req;
try {
- const url = Buffer.from(
- bech32.fromWords(bech32.decode(text, 20000).words),
- ).toString();
+ const url = Buffer.from(bech32.fromWords(bech32.decode(text, 20000).words)).toString();
const r = await got(url).json();
res.send(r);
@@ -59,11 +55,7 @@ export default {
} = req;
try {
const user = await getUser(
- username
- .replace("lightning:", "")
- .replace(/\s/g, "")
- .replace("=", "")
- .toLowerCase(),
+ username.replace("lightning:", "").replace(/\s/g, "").replace("=", "").toLowerCase(),
);
if (!user) fail(`User ${username} not found`);
@@ -208,9 +200,8 @@ export default {
]);
const id = v4();
-
- const total =
- (parseInt(invoice.amount || 0) + parseInt(invoice.tip || 0)) * 1000;
+
+ const total = (parseInt(invoice.amount || 0) + parseInt(invoice.tip || 0)) * 1000;
await s(`lnurl:${id}`, uid);
if (total > 0) await s(`lnurl:${id}:invoice`, invoice.id);