aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-03 21:26:57 -0800
committerAdam Soltys <[email protected]>2026-03-03 21:26:57 -0800
commit9507e040a03834f7d603c5c13a1f69ae6ef48b3a (patch)
treec82658ef1110105f1ac3f056a462b7e251db657d /routes
parent82f7ae5f84da70e8c5692ff4fffa7263784a7800 (diff)
downloadcoinos-server-9507e040a03834f7d603c5c13a1f69ae6ef48b3a.tar.gz
coinos-server-9507e040a03834f7d603c5c13a1f69ae6ef48b3a.zip
bip353
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/routes/users.ts b/routes/users.ts
index 941a0a3b..6948fb28 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -26,6 +26,7 @@ import { authenticator } from "otplib";
import { v4 } from "uuid";
import { setCookie } from "hono/cookie";
+import { setupBip353, teardownBip353 } from "$lib/bip353";
import { PaymentType } from "$lib/types";
import { createBalanceAccount, getBalance, getCredit, getPending } from "$lib/tb";
import { importAccountHistory } from "$lib/payments";
@@ -297,6 +298,7 @@ export default {
"arkAddress",
"autowithdraw",
"banner",
+ "bip353",
"currencies",
"currency",
"destination",
@@ -353,6 +355,11 @@ export default {
await s(`user:${user.id}`, user);
if (user.nip5) await db.sAdd("nip5", `${user.username}:${user.pubkey}`);
+ if (typeof body.bip353 !== "undefined") {
+ if (user.bip353) setupBip353(user).catch((e) => warn("BIP 353 setup failed", e.message));
+ else teardownBip353(user).catch((e) => warn("BIP 353 teardown failed", e.message));
+ }
+
emit(user.id, "user", user);
return c.json({ user });
} catch (e) {