aboutsummaryrefslogtreecommitdiffstats
path: root/names/server.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-01 22:46:19 -0700
committerAdam Soltys <[email protected]>2026-08-01 22:46:19 -0700
commitc8e6de17311e3eaa18a73c2aa0688c80e89db254 (patch)
tree7055365768c8358d45ae99c3496db65babc26100 /names/server.js
parent94f8f449bdce9ee66424a282ced51e2cfaddca93 (diff)
downloadcoinosv3-c8e6de17311e3eaa18a73c2aa0688c80e89db254.tar.gz
coinosv3-c8e6de17311e3eaa18a73c2aa0688c80e89db254.zip
Get an address immediately, without waiting on a signer prompt
The passive setup path asked the browser extension to sign the claim, so it sat behind a permission popup — 20s per attempt, retried, hence the minute-long spinner ending in the manual form. The wallet's own key now makes that claim: no signer, no prompt, no wait. Tying the address to the user's real npub happens at login instead, where the signer is already live, and nominates the wallet key to manage the record after. Failures are visible now rather than hidden: the pane shows why setup failed, the watchdog is 12s instead of 60s, internal timeouts are tighter, and the registrar logs every refusal with its reason. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'names/server.js')
-rw-r--r--names/server.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/names/server.js b/names/server.js
index 8f1971a..903fa68 100644
--- a/names/server.js
+++ b/names/server.js
@@ -242,7 +242,9 @@ function rateOk(ip, limit = 10) {
// HTTP
// ---------------------------------------------------------------------------
-const json = (body, status = 200) => new Response(JSON.stringify(body), {
+const json = (body, status = 200) => {
+ if (status >= 400) log(`→ ${status} ${JSON.stringify(body).slice(0, 120)}`);
+ return new Response(JSON.stringify(body), {
status,
headers: {
'content-type': 'application/json',
@@ -250,7 +252,8 @@ const json = (body, status = 200) => new Response(JSON.stringify(body), {
'access-control-allow-headers': 'content-type,authorization',
'access-control-allow-methods': 'GET,POST,DELETE,OPTIONS',
},
-});
+ });
+};
Bun.serve({
port: CFG.port || 8798,