sirius/js/register-flow.js

912 lines
46 KiB
JavaScript
Raw Normal View History

feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
// Reusable name-registration mint flow — the modal + wallet setup + on-chain
// mint sequence that used to live inside register.html. Any Sirius.X page can
// include this module and call `window.siriusRegisterName(fullName)` to open
// the flow for a specific `<label>.<tld>`. The landing's search cards call
// it directly; a legacy register.html redirect keeps old links working.
//
// Injects its own modal HTML into <body> and its own CSS into <head> on load
// so the host page needs nothing but a single script include.
feat(registrar): 90/10 revenue split — TLD owner earns from name mints Every second-level name registration under a TLD now routes 90% of the service fee to whoever holds that TLD's certificate on chain, with 10% going to the platform address. That's the economic incentive for minting a TLD: you earn from every name registered under it. The mechanism, end to end: 1. resolver-web.js fetchTldMap now also records mintScriptHex — the scriptPubKey of the TREG output that carries each TLD's NFT. Exported so registrar can decode it into a cashaddr with libauth. MVP: this is the ORIGINAL owner; NFT transfers after mint are not traced yet (a follow-up will walk the chain of transfers). 2. registrar.js gains findTldOwnerAddress(client, tld) and splitServiceFee(sats). The split constants live at the top of the file (TLD_OWNER_SHARE_NUM/DEN = 90/100) so the ratio moves in one place. Rounding: BigInt division favours the platform on odd sat counts so the two shares always sum EXACTLY to the input. 3. quoteRegistration wraps the existing flow: it derives the TLD from the name, looks up the TLD owner, and if the owner ≠ buyer it asks buildRegistrationTx to add a second fee output. If the owner couldn't be resolved (TLD not registered, decode failure) the full fee stays on the platform address — the buyer still pays the same amount either way. 4. register-tx.js buildRegistrationTx accepts tldFeeAddress/tldFeeSats and, when set, emits an extra P2PKH output for the TLD owner. Sits between the beacon dust and the platform-fee output; outputMap records .tldOwnerFee so callers can find it. costs also carries tldOwnerFeeSats and netCostSats includes it. 5. priceSummary in registrar-config splits the 'Service fee' row into 'Service fee — TLD owner (90%)' + 'Service fee — platform (10%)' whenever tldOwnerFeeSats > 0, with a per-line note explaining where the money goes. Bundle: re-exported findTldOwnerAddress + splitServiceFee from register-entry.js. Rebuilt bns-register.js (~34 kB) and deployed; cache-buster bumped to ?v=20260908split on portal / admin / register-flow.js. Verified live: findTldOwnerAddress('.bch') returns the operator cashaddr; quoteRegistration('tester42.bch') builds cleanly with a 9,000/1,000 split output pair on a 10,000-sat fee; priceSummary renders both lines. No regressions on the TLD-mint flow (buyer IS the TLD owner there — split short-circuits and it stays a single fee output as before).
2026-09-08 02:42:16 +02:00
import * as BNS from "https://silentmode.st/js/bns-register.js?v=20260908split";
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
const $ = (id) => document.getElementById(id);
const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ "&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;" }[c]));
const sats = (v) => Number(v).toLocaleString("en-US");
// ---------- inject CSS + modal HTML ----------
// The style block is a straight copy of register.html's modal/sheet styling
// — kept scoped by prefixing every selector with #sirius-register-modal so it
// cannot collide with the host page's own .modal / .sheet classes.
(function injectAssets() {
if (document.getElementById("sirius-register-flow-css")) return;
const css = document.createElement("style");
css.id = "sirius-register-flow-css";
css.textContent = `
#sirius-register-modal{position:fixed;inset:0;background:rgba(6,9,14,.82);backdrop-filter:blur(3px);
display:none;align-items:flex-start;justify-content:center;padding:3vh 1rem;overflow-y:auto;z-index:100}
#sirius-register-modal.open{display:flex}
#sirius-register-modal .sheet{background:var(--panel,#141a24);border:1px solid var(--line,rgba(255,255,255,.09));
border-radius:16px;max-width:620px;width:100%;padding:26px 28px 28px;color:var(--ink,#e7eaf1)}
#sirius-register-modal .sheet h3{margin:0 0 .2rem;font-size:1.25rem}
#sirius-register-modal .sheet .sub{color:var(--mut,#8b98a9);font-size:14px;margin:0 0 1.2rem}
#sirius-register-modal .sheet label{display:block;font-size:13px;color:var(--mut,#8b98a9);margin:14px 0 5px}
#sirius-register-modal .sheet input[type=text],
#sirius-register-modal .sheet input[type=password],
#sirius-register-modal .sheet textarea,
#sirius-register-modal .sheet select{
width:100%;padding:11px 13px;border-radius:10px;border:1px solid #ffffff22;background:#0e131b;
color:var(--ink,#e7eaf1);font-size:14px;font-family:inherit;outline:none}
#sirius-register-modal .sheet textarea{min-height:76px;resize:vertical;font-family:ui-monospace,monospace;font-size:13px}
#sirius-register-modal .sheet input:focus,
#sirius-register-modal .sheet textarea:focus{border-color:#4b7bec}
#sirius-register-modal .row{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
#sirius-register-modal .row.end{justify-content:flex-end}
#sirius-register-modal .x{position:absolute;top:14px;right:18px;background:none;border:none;color:var(--dim,#5e6678);font-size:22px;cursor:pointer}
#sirius-register-modal .sheetwrap{position:relative;width:100%;max-width:620px}
#sirius-register-modal .phrase{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}
#sirius-register-modal .phrase span{background:#0e131b;border:1px solid var(--line,rgba(255,255,255,.09));
border-radius:8px;padding:8px 10px;font-family:ui-monospace,monospace;font-size:13px}
#sirius-register-modal .phrase span b{color:var(--dim,#5e6678);font-weight:400;margin-right:6px;font-size:11px}
#sirius-register-modal .addr{display:flex;gap:8px;align-items:center;margin-top:8px}
#sirius-register-modal .addr code{flex:1;word-break:break-all;background:#0e131b;
border:1px solid var(--line,rgba(255,255,255,.09));border-radius:8px;padding:9px 11px;
font-family:ui-monospace,monospace;font-size:12.5px}
#sirius-register-modal table.price{width:100%;border-collapse:collapse;margin-top:12px;font-size:14px}
#sirius-register-modal table.price td{padding:7px 0;border-bottom:1px solid var(--line,rgba(255,255,255,.09));color:var(--mut,#8b98a9)}
#sirius-register-modal table.price td:last-child{text-align:right;font-family:ui-monospace,monospace;color:var(--ink,#e7eaf1)}
#sirius-register-modal table.price tr.total td{border-bottom:none;color:var(--ink,#e7eaf1);font-weight:600;padding-top:12px}
#sirius-register-modal table.price tr.total td:last-child{color:var(--acid,#d6ff3d)}
#sirius-register-modal table.price td small{display:block;color:var(--dim,#5e6678);font-size:11.5px}
#sirius-register-modal .steps-log{margin-top:14px;font-family:ui-monospace,monospace;font-size:12.5px;
color:var(--mut,#8b98a9);background:#0e131b;border:1px solid var(--line,rgba(255,255,255,.09));
border-radius:10px;padding:12px 14px;max-height:180px;overflow-y:auto}
#sirius-register-modal .steps-log div::before{content:" ";color:var(--acid,#d6ff3d)}
#sirius-register-modal .err{color:var(--taken,#f6768a);font-size:13.5px;margin-top:12px}
#sirius-register-modal .ok{color:var(--ok,#4fd1a5)}
#sirius-register-modal .pill{display:inline-block;font-size:11px;padding:2px 8px;border-radius:999px;
background:rgba(214,255,61,.13);color:var(--acid,#d6ff3d);margin-left:8px;vertical-align:middle}
#sirius-register-modal .pill.soon{background:rgba(255,255,255,.07);color:var(--dim,#5e6678)}
#sirius-register-modal .wopt{display:flex;gap:14px;align-items:flex-start;background:var(--panel2,#18202c);
border:1px solid var(--line,rgba(255,255,255,.09));border-radius:12px;padding:14px 16px;cursor:pointer;
text-align:left;width:100%;color:inherit;font:inherit;margin-top:10px}
#sirius-register-modal .wopt:hover{border-color:#4b7bec}
#sirius-register-modal .wopt:disabled{opacity:.45;cursor:not-allowed}
#sirius-register-modal .wopt .ic{font-size:22px;line-height:1}
#sirius-register-modal .wopt b{display:block;font-size:14.5px}
#sirius-register-modal .wopt span{color:var(--mut,#8b98a9);font-size:13px}
#sirius-register-modal .chk{display:flex;gap:9px;align-items:flex-start;margin-top:14px;font-size:13.5px;color:var(--mut,#8b98a9)}
#sirius-register-modal .chk input{margin-top:3px}
feat(sirius-x): admin TLD hide/unhide + tabbed sign-in modal (4 direct actions) Two features: 1. Operator can hide TLDs from the public /api/tlds listing so hidden TLDs stop appearing in name-search UIs. On-chain registrations under a hidden TLD keep resolving — this is a UX filter, not enforcement. Gateway (public-gateway.mjs): - Persistent HIDDEN_TLDS set backed by hidden-tlds.json next to the service script - GET /api/tld-visibility -> {hidden:[...]} (public) - POST /api/tld-visibility -> updates the list (operator-gated by Bearer BNS_OPERATOR_TOKEN env var; if unset, all writes refused so we default-deny) - /api/tlds filters out HIDDEN_TLDS; add ?include_hidden=1 to see everything (used by the admin panel to show all rows) - Operator token installed via systemd override on the VPS Admin panel: - New 'Operator token' card at the top of the TLD-registry section; token stored in sessionStorage (not localStorage) so a full browser close forgets it - Each TLD row got a 'Hidden from public' checkbox that POSTs on toggle and refreshes the table; failures roll back the checkbox and surface the error next to the token field 2. Wallet dropdown restored to 4 direct actions (Unlock / Create a wallet / Import a wallet / WizardConnect) and the shared mint/sign-in modal grew a tab strip so users can switch between the four wallet actions from any step without going back to a choice screen. register-flow.js: - renderTabs(active) prepended to stepCreate/stepImport/stepUnlock/ stepExternal when signInOnly is set. Unlock tab only appears when a saved wallet exists. - Delegated click handler on the sheet routes tab clicks to the matching step; switching away from a live WC session tears it down first so we don't leak WebSockets. profile-menu.js: - Restored 4-item onboarding menu (Create/Import/WC plus Unlock when saved). Each item is a direct entry point; the tabbed modal lets the user pivot to any other option without closing. Cache-buster bumped on all 8 sirius-x pages to ?v=20260908tabs.
2026-09-08 02:19:41 +02:00
#sirius-register-modal .signin-tabs{
display:flex;gap:2px;margin:-8px -12px 18px;padding:0 4px 0;
border-bottom:1px solid var(--line,rgba(255,255,255,.09));overflow-x:auto
}
#sirius-register-modal .signin-tabs button{
background:none;border:none;color:var(--mut,#8b98a9);font-family:inherit;font-size:12.5px;
padding:10px 12px;cursor:pointer;border-bottom:2px solid transparent;
white-space:nowrap;letter-spacing:.2px;transition:color .1s,border-color .1s
}
#sirius-register-modal .signin-tabs button:hover{color:var(--ink,#e7eaf1)}
#sirius-register-modal .signin-tabs button.active{
color:var(--acid,#d6ff3d);border-bottom-color:var(--acid,#d6ff3d)
}
/* Inline-sheet variant: same step content styling as the modal, but
rendered as a normal page section (no fixed positioning, no backdrop,
no shadow). Portal.html uses this so the tabbed sign-in IS the page. */
.sirius-inline-sheet{
background:var(--panel,#141a24);border:1px solid var(--line,rgba(255,255,255,.09));
border-radius:16px;padding:22px 24px;color:var(--ink,#e7eaf1)
}
.sirius-inline-sheet h3{margin:0 0 .2rem;font-size:1.15rem}
.sirius-inline-sheet .sub{color:var(--mut,#8b98a9);font-size:14px;margin:0 0 1.2rem}
.sirius-inline-sheet label{display:block;font-size:13px;color:var(--mut,#8b98a9);margin:14px 0 5px}
.sirius-inline-sheet input[type=text],
.sirius-inline-sheet input[type=password],
.sirius-inline-sheet textarea,
.sirius-inline-sheet select{
width:100%;padding:11px 13px;border-radius:10px;border:1px solid #ffffff22;background:#0e131b;
color:var(--ink,#e7eaf1);font-size:14px;font-family:inherit;outline:none
}
.sirius-inline-sheet textarea{min-height:76px;resize:vertical;font-family:ui-monospace,monospace;font-size:13px}
.sirius-inline-sheet input:focus,.sirius-inline-sheet textarea:focus{border-color:#4b7bec}
.sirius-inline-sheet .row{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.sirius-inline-sheet .row.end{justify-content:flex-end}
.sirius-inline-sheet .phrase{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}
.sirius-inline-sheet .phrase span{background:#0e131b;border:1px solid var(--line,rgba(255,255,255,.09));
border-radius:8px;padding:8px 10px;font-family:ui-monospace,monospace;font-size:13px}
.sirius-inline-sheet .phrase span b{color:var(--dim,#5e6678);font-weight:400;margin-right:6px;font-size:11px}
.sirius-inline-sheet .addr{display:flex;gap:8px;align-items:center;margin-top:8px}
.sirius-inline-sheet .addr code{flex:1;word-break:break-all;background:#0e131b;
border:1px solid var(--line,rgba(255,255,255,.09));border-radius:8px;padding:9px 11px;
font-family:ui-monospace,monospace;font-size:12.5px}
.sirius-inline-sheet .steps-log{margin-top:14px;font-family:ui-monospace,monospace;font-size:12.5px;
color:var(--mut,#8b98a9);background:#0e131b;border:1px solid var(--line,rgba(255,255,255,.09));
border-radius:10px;padding:12px 14px;max-height:180px;overflow-y:auto}
.sirius-inline-sheet .steps-log div::before{content:" ";color:var(--acid,#d6ff3d)}
.sirius-inline-sheet .err{color:var(--taken,#f6768a);font-size:13.5px;margin-top:12px}
.sirius-inline-sheet .ok{color:var(--ok,#4fd1a5)}
.sirius-inline-sheet .note{background:var(--panel2,#18202c);border:1px solid var(--line,rgba(255,255,255,.09));
border-left:3px solid var(--acid,#d6ff3d);border-radius:10px;padding:14px 18px;
color:var(--mut,#8b98a9);font-size:14px;margin-top:1.4rem}
.sirius-inline-sheet .note.warn{border-left-color:var(--warn,#ffc75f)}
.sirius-inline-sheet .note b{color:var(--ink,#e7eaf1)}
.sirius-inline-sheet .mono{background:#0e131b;border:1px solid var(--line,rgba(255,255,255,.09));
border-radius:6px;padding:1px 6px;font-family:ui-monospace,monospace;font-size:13px}
.sirius-inline-sheet .chk{display:flex;gap:9px;align-items:flex-start;margin-top:14px;font-size:13.5px;color:var(--mut,#8b98a9)}
.sirius-inline-sheet .chk input{margin-top:3px}
.sirius-inline-sheet .signin-tabs{
display:flex;gap:2px;margin:-6px -8px 18px;padding:0 4px;
border-bottom:1px solid var(--line,rgba(255,255,255,.09));overflow-x:auto
}
.sirius-inline-sheet .signin-tabs button{
background:none;border:none;color:var(--mut,#8b98a9);font-family:inherit;font-size:13px;
padding:10px 14px;cursor:pointer;border-bottom:2px solid transparent;
white-space:nowrap;letter-spacing:.2px;transition:color .1s,border-color .1s
}
.sirius-inline-sheet .signin-tabs button:hover{color:var(--ink,#e7eaf1)}
.sirius-inline-sheet .signin-tabs button.active{
color:var(--acid,#d6ff3d);border-bottom-color:var(--acid,#d6ff3d)
}
.sirius-inline-sheet .btn{display:inline-block;text-decoration:none;padding:10px 18px;border-radius:10px;
background:#4b7bec;color:#fff;font-size:14px;border:none;cursor:pointer;font-family:inherit}
.sirius-inline-sheet .btn.ghost{background:transparent;border:1px solid var(--line,rgba(255,255,255,.09));color:var(--ink,#e7eaf1)}
.sirius-inline-sheet .btn.acid{background:var(--acid,#d6ff3d);color:#0b0e14;font-weight:600}
.sirius-inline-sheet .btn:hover{filter:brightness(1.12)}
.sirius-inline-sheet .btn:disabled{opacity:.45;cursor:not-allowed;filter:none}
.sirius-inline-sheet .wopt{display:flex;gap:14px;align-items:flex-start;background:var(--panel2,#18202c);
border:1px solid var(--line,rgba(255,255,255,.09));border-radius:12px;padding:14px 16px;cursor:pointer;
text-align:left;width:100%;color:inherit;font:inherit;margin-top:10px}
.sirius-inline-sheet .wopt:hover{border-color:#4b7bec}
.sirius-inline-sheet .wopt .ic{font-size:22px;line-height:1}
.sirius-inline-sheet .wopt b{display:block;font-size:14.5px}
.sirius-inline-sheet .wopt span{color:var(--mut,#8b98a9);font-size:13px}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
#sirius-register-modal .btn{display:inline-block;text-decoration:none;padding:10px 18px;border-radius:10px;
background:#4b7bec;color:#fff;font-size:14px;border:none;cursor:pointer;font-family:inherit}
#sirius-register-modal .btn.ghost{background:transparent;border:1px solid var(--line,rgba(255,255,255,.09));color:var(--ink,#e7eaf1)}
#sirius-register-modal .btn.acid{background:var(--acid,#d6ff3d);color:#0b0e14;font-weight:600}
#sirius-register-modal .btn:hover{filter:brightness(1.12)}
#sirius-register-modal .btn:disabled{opacity:.45;cursor:not-allowed;filter:none}
#sirius-register-modal .mono{background:#0e131b;border:1px solid var(--line,rgba(255,255,255,.09));
border-radius:6px;padding:1px 6px;font-family:ui-monospace,monospace;font-size:13px}
#sirius-register-modal .muted{color:var(--dim,#5e6678);font-size:13px}
#sirius-register-modal .note{background:var(--panel,#141a24);border:1px solid var(--line,rgba(255,255,255,.09));
border-left:3px solid var(--acid,#d6ff3d);border-radius:10px;padding:14px 18px;
color:var(--mut,#8b98a9);font-size:14px;margin-top:1.4rem}
#sirius-register-modal .note b{color:var(--ink,#e7eaf1)}
#sirius-register-modal .note.warn{border-left-color:var(--warn,#ffc75f)}
`;
document.head.appendChild(css);
const modal = document.createElement("div");
modal.id = "sirius-register-modal";
modal.innerHTML = `
<div class="sheetwrap">
<button class="x" id="sirius-reg-close" title="close">×</button>
<div class="sheet" id="sirius-reg-sheet"></div>
</div>
`;
document.body.appendChild(modal);
})();
// ---------- flow state ----------
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
// signInOnly: when true, the flow is used for wallet onboarding from the nav
// dropdown — no name to mint, so instead of walking through Fund/Confirm/
// Register we stop at 'wallet is ready', write siriusProfile, and close.
// inlineTarget: when set, the flow renders into that page element instead
// of the modal sheet (portal.html uses this to embed the tabbed sign-in as
// the page's main content). The modal is left closed in inline mode.
const state = { name: null, signInOnly: false, inlineTarget: null, wallet: null, session: null, client: null, quote: null, result: null };
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
const modal = $("sirius-register-modal");
const modalSheet = $("sirius-reg-sheet");
// `sheet` is the element the step functions render into — the modal's sheet
// by default, or an inline container when siriusRenderSignInInline() is
// active. `let` so it can be reassigned per call.
let sheet = modalSheet;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
function open() {
// Inline mode never opens the modal — the sign-in UI lives on the page.
if (state.inlineTarget) return;
modal.classList.add("open");
}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
function close() {
// In inline mode we can't "close" — leave the content in place. State is
// still reset so the next call starts fresh.
if (!state.inlineTarget) modal.classList.remove("open");
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
if (state.client) { try { state.client.close(); } catch {} state.client = null; }
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
// Keep the WC session alive when signing in — later record edits or TLD
// mints will need it; only tear it down for the mint flow.
if (state.session && !state.signInOnly) { try { state.session.disconnect(); } catch {} state.session = null; }
state.signInOnly = false;
// Restore the modal sheet as the default render target so subsequent
// register/mint flows (which are modal-based) work.
if (state.inlineTarget) {
state.inlineTarget = null;
sheet = modalSheet;
}
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
}
// Persist wallet identity so profile-menu.js and any other tab see the
// signed-in state immediately (same as portal.html's writeProfile).
function writeProfile(w) {
try {
localStorage.setItem("siriusProfile", JSON.stringify({
address: w.address,
tokenAddress: w.tokenAddress,
source: w.source ?? "seed",
signedInAt: Date.now(),
}));
} catch {}
window.dispatchEvent(new Event("siriusProfileChanged"));
}
// A wallet was just loaded/created/connected. If we are in sign-in-only
// mode, mark siriusProfile and close the modal here; otherwise return
// false so the caller keeps going to Fund → Confirm → Register.
function finishSignIn(w) {
writeProfile({ address: w.address, tokenAddress: w.tokenAddress, source: w.source ?? "seed" });
// Expose the live wallet globally so the portal / TLD page can pick it up
// without re-prompting for a password. In-memory only — cleared on reload,
// sign-out, or navigation away.
window.siriusWallet = w;
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
if (state.signInOnly) {
render(`<h3><span class="ok">✓</span> Signed in</h3>
<p class="sub">You are signed in as <span class="mono">${esc(w.address)}</span>. Names you own
will appear in the wallet dropdown; the same wallet signs record edits and new registrations.</p>
<div class="row end"><button class="btn acid" id="fin">Done</button></div>`);
$("fin").onclick = close;
return true;
}
return false;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
}
$("sirius-reg-close").onclick = close;
modal.addEventListener("click", (e) => { if (e.target === modal) close(); });
// Step functions render into `sheet`, which is reassigned per call by
// renderSignInInline() when the flow is mounted inline on a host page
// (portal.html). Modal by default. Direct write — no separate variable
// needed since `sheet` above is the single mutable target.
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
function render(html) { sheet.innerHTML = html; }
feat(sirius-x): admin TLD hide/unhide + tabbed sign-in modal (4 direct actions) Two features: 1. Operator can hide TLDs from the public /api/tlds listing so hidden TLDs stop appearing in name-search UIs. On-chain registrations under a hidden TLD keep resolving — this is a UX filter, not enforcement. Gateway (public-gateway.mjs): - Persistent HIDDEN_TLDS set backed by hidden-tlds.json next to the service script - GET /api/tld-visibility -> {hidden:[...]} (public) - POST /api/tld-visibility -> updates the list (operator-gated by Bearer BNS_OPERATOR_TOKEN env var; if unset, all writes refused so we default-deny) - /api/tlds filters out HIDDEN_TLDS; add ?include_hidden=1 to see everything (used by the admin panel to show all rows) - Operator token installed via systemd override on the VPS Admin panel: - New 'Operator token' card at the top of the TLD-registry section; token stored in sessionStorage (not localStorage) so a full browser close forgets it - Each TLD row got a 'Hidden from public' checkbox that POSTs on toggle and refreshes the table; failures roll back the checkbox and surface the error next to the token field 2. Wallet dropdown restored to 4 direct actions (Unlock / Create a wallet / Import a wallet / WizardConnect) and the shared mint/sign-in modal grew a tab strip so users can switch between the four wallet actions from any step without going back to a choice screen. register-flow.js: - renderTabs(active) prepended to stepCreate/stepImport/stepUnlock/ stepExternal when signInOnly is set. Unlock tab only appears when a saved wallet exists. - Delegated click handler on the sheet routes tab clicks to the matching step; switching away from a live WC session tears it down first so we don't leak WebSockets. profile-menu.js: - Restored 4-item onboarding menu (Create/Import/WC plus Unlock when saved). Each item is a direct entry point; the tabbed modal lets the user pivot to any other option without closing. Cache-buster bumped on all 8 sirius-x pages to ?v=20260908tabs.
2026-09-08 02:19:41 +02:00
// Tab bar for sign-in mode — lets the user jump between the four wallet
// actions without going back to a wallet-choice screen. Prepended to the
// sheet content by each sign-in step. Only shown in signInOnly mode.
function renderTabs(active) {
if (!state.signInOnly) return "";
const saved = BNS.BuiltInWallet.exists();
const tabs = [];
if (saved) tabs.push(["unlock", "🔓 Unlock", "Wallet stored on this device"]);
tabs.push(["new", "🆕 Create", "Sign up · fresh phrase"]);
tabs.push(["import", "📥 Import", "Sign in · seed you have"]);
tabs.push(["wc", "🔗 WizardConnect", "Cashonize / Paytaca"]);
return `
<div class="signin-tabs" role="tablist">
${tabs.map(([id, label, hint]) => `
<button role="tab" data-tab="${id}" class="${id === active ? "active" : ""}"
title="${esc(hint)}">${label}</button>
`).join("")}
</div>
`;
}
// Wire tab clicks — document-level delegation so both the modal sheet and
// any inline container hosting the tabs work with one listener. Switching
// away from a live WC session tears it down first so we don't leak
// connections. Guarded to only match .signin-tabs buttons we render.
document.addEventListener("click", async (e) => {
const t = e.target.closest(".signin-tabs [data-tab]");
feat(sirius-x): admin TLD hide/unhide + tabbed sign-in modal (4 direct actions) Two features: 1. Operator can hide TLDs from the public /api/tlds listing so hidden TLDs stop appearing in name-search UIs. On-chain registrations under a hidden TLD keep resolving — this is a UX filter, not enforcement. Gateway (public-gateway.mjs): - Persistent HIDDEN_TLDS set backed by hidden-tlds.json next to the service script - GET /api/tld-visibility -> {hidden:[...]} (public) - POST /api/tld-visibility -> updates the list (operator-gated by Bearer BNS_OPERATOR_TOKEN env var; if unset, all writes refused so we default-deny) - /api/tlds filters out HIDDEN_TLDS; add ?include_hidden=1 to see everything (used by the admin panel to show all rows) - Operator token installed via systemd override on the VPS Admin panel: - New 'Operator token' card at the top of the TLD-registry section; token stored in sessionStorage (not localStorage) so a full browser close forgets it - Each TLD row got a 'Hidden from public' checkbox that POSTs on toggle and refreshes the table; failures roll back the checkbox and surface the error next to the token field 2. Wallet dropdown restored to 4 direct actions (Unlock / Create a wallet / Import a wallet / WizardConnect) and the shared mint/sign-in modal grew a tab strip so users can switch between the four wallet actions from any step without going back to a choice screen. register-flow.js: - renderTabs(active) prepended to stepCreate/stepImport/stepUnlock/ stepExternal when signInOnly is set. Unlock tab only appears when a saved wallet exists. - Delegated click handler on the sheet routes tab clicks to the matching step; switching away from a live WC session tears it down first so we don't leak WebSockets. profile-menu.js: - Restored 4-item onboarding menu (Create/Import/WC plus Unlock when saved). Each item is a direct entry point; the tabbed modal lets the user pivot to any other option without closing. Cache-buster bumped on all 8 sirius-x pages to ?v=20260908tabs.
2026-09-08 02:19:41 +02:00
if (!t) return;
const which = t.dataset.tab;
if (which !== "wc" && state.session) {
try { await state.session.disconnect(); } catch {}
state.session = null;
}
if (which === "unlock") stepUnlock();
else if (which === "new") stepCreate();
else if (which === "import") stepImport();
else if (which === "wc") stepExternal();
});
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
function err(e) {
sheet.querySelectorAll(".err").forEach((n) => n.remove());
const box = document.createElement("div");
box.className = "err";
box.textContent = e?.message ?? String(e);
sheet.appendChild(box);
}
async function client() {
if (!state.client) state.client = await BNS.connect();
return state.client;
}
// If the user already unlocked a wallet in this tab (via inline sign-in on
// portal.html or a prior mint), the register/TLD mint flow can skip the
// wallet-choice step entirely and go straight to Fund / Confirm. That's
// what stops the flow from asking for the password a second time on a
// TLD buy right after unlocking.
function adoptSignedInWallet() {
if (window.siriusWallet && !state.wallet) {
state.wallet = window.siriusWallet;
// WC-signed-in wallets carry a `session`; keep it plumbed for the mint.
if (window.siriusWallet.source === "wc" && window.siriusWallet.session) {
state.session = window.siriusWallet.session;
}
return true;
}
return false;
}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
function startFlow(name) {
state.name = name;
feat(sirius-x): pencil Register icon + TLD mint via shared modal Two UX polishes: 1. Register-tab icon flipped from 🪪 (identification-card emoji, renders as a hollow box in system-ui fonts without extended emoji) to ✏️ (pencil), which reads as 'edit/create' and ships in every emoji font worth targeting. Changed across the nav on all 8 pages plus the footer injector's Product column. Kept the Register nav item — six items total in the nav, and from any subpage it's one click to the search on landing. 2. tld.html no longer duplicates the wallet-choice + mint flow inline. The Register button on a search result now hands the label off to the shared register-flow.js modal — same modal that name registration uses — via a new window.siriusRegisterTld(label, {serviceFeeSats}) entry point. register-flow.js grew: - startTldFlow / window.siriusRegisterTld: sets state.tld and walks the modal through wallet-choice → Fund → stepConfirmTld → stepRegisterTld → stepDoneTld - stepConfirmTld: shows label + fee + owner, no per-name quote - stepRegisterTld: dispatches to registerTldWithBuiltInWallet or registerTldWithExternalWallet based on state.wallet/state.session - stepDoneTld: 'X is yours' with txid + certificate id + operator address, no record editor (a TLD certificate has no records to set immediately) - stepWallet / stepExternalConfirm branch on state.tld so the modal heading and the WC-confirm path route correctly tld.html trimmed: removed the entire signin-section + mint-section plus their inline handlers (~250 lines gone). Now just search + registered-TLDs list + a delegator to the shared modal. If a user is already signed in via the wallet dropdown, the modal recognises the saved wallet ('Unlock my browser wallet' button appears) instead of asking them to sign in again on this page.
2026-09-08 00:10:11 +02:00
state.tld = null;
state.signInOnly = false;
open();
if (adoptSignedInWallet()) stepFund();
else stepWallet();
feat(sirius-x): pencil Register icon + TLD mint via shared modal Two UX polishes: 1. Register-tab icon flipped from 🪪 (identification-card emoji, renders as a hollow box in system-ui fonts without extended emoji) to ✏️ (pencil), which reads as 'edit/create' and ships in every emoji font worth targeting. Changed across the nav on all 8 pages plus the footer injector's Product column. Kept the Register nav item — six items total in the nav, and from any subpage it's one click to the search on landing. 2. tld.html no longer duplicates the wallet-choice + mint flow inline. The Register button on a search result now hands the label off to the shared register-flow.js modal — same modal that name registration uses — via a new window.siriusRegisterTld(label, {serviceFeeSats}) entry point. register-flow.js grew: - startTldFlow / window.siriusRegisterTld: sets state.tld and walks the modal through wallet-choice → Fund → stepConfirmTld → stepRegisterTld → stepDoneTld - stepConfirmTld: shows label + fee + owner, no per-name quote - stepRegisterTld: dispatches to registerTldWithBuiltInWallet or registerTldWithExternalWallet based on state.wallet/state.session - stepDoneTld: 'X is yours' with txid + certificate id + operator address, no record editor (a TLD certificate has no records to set immediately) - stepWallet / stepExternalConfirm branch on state.tld so the modal heading and the WC-confirm path route correctly tld.html trimmed: removed the entire signin-section + mint-section plus their inline handlers (~250 lines gone). Now just search + registered-TLDs list + a delegator to the shared modal. If a user is already signed in via the wallet dropdown, the modal recognises the saved wallet ('Unlock my browser wallet' button appears) instead of asking them to sign in again on this page.
2026-09-08 00:10:11 +02:00
}
// Start a TLD mint. Same wallet-choice + fund flow as a name register, but
// the mint step calls registerTldWith(Built|External)Wallet instead of the
// name variant, and the "done" screen skips the record editor since a TLD
// certificate goes to the operator's token address as-is.
function startTldFlow(label, opts = {}) {
state.name = `.${label}`; // used for headings only
state.tld = { label, serviceFeeSats: BigInt(opts.serviceFeeSats ?? 0n) };
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
state.signInOnly = false;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
open();
if (adoptSignedInWallet()) stepFund();
else stepWallet();
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
}
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
// Sign-in-only entry point for the nav wallet dropdown. mode = 'new' opens
// the "create wallet" step directly, 'import' opens "import phrase", 'wc'
// starts a WizardConnect session. On success the flow writes siriusProfile
// and closes — no name context, no Fund/Confirm.
function startSignIn(mode) {
state.name = "your wallet"; // header text — used by stepWallet
feat(sirius-x): 🔓 Unlock my wallet in nav dropdown when a saved wallet exists Previously, the only way to unlock a wallet that had been saved in this browser was to click Register (name or TLD), open the modal, and pick 'Unlock my browser wallet' from the wallet-choice step. From the nav dropdown you could only start onboarding fresh (New / Import / WC). profile-menu.js now checks localStorage for the BuiltInWallet's storage key (bns.wallet.v1) at every render, and when a saved wallet is present inserts a '🔓 Unlock my wallet' item at the top of the not-signed-in dropdown — with a divider below it, so it reads as the primary action and the Onboarding options stay available for adding a different wallet. The dropdown click handler already lazy-loads register-flow.js and calls window.siriusSignInWallet(action); register-flow.js's startSignIn grew an 'unlock' mode that opens the modal directly at stepUnlock (the password prompt). Same success path as every other sign-in: on unlock success, siriusProfile is written and the modal closes with '✓ Signed in' — the nav pill flips to the address without a reload. Verified end-to-end on landing: saved wallet detected -> dropdown shows Unlock as first item -> click -> password -> '✓ Signed in' -> pill becomes 'qqyx49…zx8x seed ▾' with no reload. TLD mint from tld.html also verified end-to-end: search 'e2etldtest' -> Register -> modal -> Unlock -> password -> Fund -> Confirm (fee 1,250,000 sat + beacon dust ~1,300 sat) -> Register -> checking-availability -> loading-coins -> 'wallet is empty' (expected without chipnet funds; downstream code is the same registerTldWithBuiltInWallet path the CLI uses).
2026-09-08 00:24:54 +02:00
state.tld = null;
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
state.signInOnly = true;
open();
// "choose" (default) shows the wallet-choice screen with all four options;
// the other modes are still supported as direct-action entry points from
// deep-links like portal.html?mode=new — but the nav dropdown funnels to
// "choose" so the user always sees the options first.
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
if (mode === "new") stepCreate();
else if (mode === "import") stepImport();
else if (mode === "wc") stepExternal();
feat(sirius-x): 🔓 Unlock my wallet in nav dropdown when a saved wallet exists Previously, the only way to unlock a wallet that had been saved in this browser was to click Register (name or TLD), open the modal, and pick 'Unlock my browser wallet' from the wallet-choice step. From the nav dropdown you could only start onboarding fresh (New / Import / WC). profile-menu.js now checks localStorage for the BuiltInWallet's storage key (bns.wallet.v1) at every render, and when a saved wallet is present inserts a '🔓 Unlock my wallet' item at the top of the not-signed-in dropdown — with a divider below it, so it reads as the primary action and the Onboarding options stay available for adding a different wallet. The dropdown click handler already lazy-loads register-flow.js and calls window.siriusSignInWallet(action); register-flow.js's startSignIn grew an 'unlock' mode that opens the modal directly at stepUnlock (the password prompt). Same success path as every other sign-in: on unlock success, siriusProfile is written and the modal closes with '✓ Signed in' — the nav pill flips to the address without a reload. Verified end-to-end on landing: saved wallet detected -> dropdown shows Unlock as first item -> click -> password -> '✓ Signed in' -> pill becomes 'qqyx49…zx8x seed ▾' with no reload. TLD mint from tld.html also verified end-to-end: search 'e2etldtest' -> Register -> modal -> Unlock -> password -> Fund -> Confirm (fee 1,250,000 sat + beacon dust ~1,300 sat) -> Register -> checking-availability -> loading-coins -> 'wallet is empty' (expected without chipnet funds; downstream code is the same registerTldWithBuiltInWallet path the CLI uses).
2026-09-08 00:24:54 +02:00
else if (mode === "unlock") stepUnlock();
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
else stepWallet();
}
// Sign-in rendered inline on the host page (not in a modal). Pass a target
// element and portal-style tabs + form get painted into it. Used by
// portal.html so the "sign up / sign in" experience IS the page rather than
// an overlay on top of a launcher card.
function renderSignInInline(container, mode = "import") {
if (!container) return;
state.name = "your wallet";
state.tld = null;
state.signInOnly = true;
state.inlineTarget = container;
sheet = container;
// Give inline container the same visual bones as the modal sheet so the
// step content styling ports 1:1. Kept as a class so host CSS can override.
container.classList.add("sirius-inline-sheet");
if (mode === "new") stepCreate();
else if (mode === "import") stepImport();
else if (mode === "wc") stepExternal();
else if (mode === "unlock") stepUnlock();
else stepWallet();
}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
// Public API
window.siriusRegisterName = startFlow;
feat(sirius-x): pencil Register icon + TLD mint via shared modal Two UX polishes: 1. Register-tab icon flipped from 🪪 (identification-card emoji, renders as a hollow box in system-ui fonts without extended emoji) to ✏️ (pencil), which reads as 'edit/create' and ships in every emoji font worth targeting. Changed across the nav on all 8 pages plus the footer injector's Product column. Kept the Register nav item — six items total in the nav, and from any subpage it's one click to the search on landing. 2. tld.html no longer duplicates the wallet-choice + mint flow inline. The Register button on a search result now hands the label off to the shared register-flow.js modal — same modal that name registration uses — via a new window.siriusRegisterTld(label, {serviceFeeSats}) entry point. register-flow.js grew: - startTldFlow / window.siriusRegisterTld: sets state.tld and walks the modal through wallet-choice → Fund → stepConfirmTld → stepRegisterTld → stepDoneTld - stepConfirmTld: shows label + fee + owner, no per-name quote - stepRegisterTld: dispatches to registerTldWithBuiltInWallet or registerTldWithExternalWallet based on state.wallet/state.session - stepDoneTld: 'X is yours' with txid + certificate id + operator address, no record editor (a TLD certificate has no records to set immediately) - stepWallet / stepExternalConfirm branch on state.tld so the modal heading and the WC-confirm path route correctly tld.html trimmed: removed the entire signin-section + mint-section plus their inline handlers (~250 lines gone). Now just search + registered-TLDs list + a delegator to the shared modal. If a user is already signed in via the wallet dropdown, the modal recognises the saved wallet ('Unlock my browser wallet' button appears) instead of asking them to sign in again on this page.
2026-09-08 00:10:11 +02:00
window.siriusRegisterTld = startTldFlow;
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
window.siriusSignInWallet = startSignIn;
window.siriusRenderSignInInline = renderSignInInline;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
// ---------- step 1: wallet choice ----------
function stepWallet() {
const saved = BNS.BuiltInWallet.exists();
feat(sirius-x): pencil Register icon + TLD mint via shared modal Two UX polishes: 1. Register-tab icon flipped from 🪪 (identification-card emoji, renders as a hollow box in system-ui fonts without extended emoji) to ✏️ (pencil), which reads as 'edit/create' and ships in every emoji font worth targeting. Changed across the nav on all 8 pages plus the footer injector's Product column. Kept the Register nav item — six items total in the nav, and from any subpage it's one click to the search on landing. 2. tld.html no longer duplicates the wallet-choice + mint flow inline. The Register button on a search result now hands the label off to the shared register-flow.js modal — same modal that name registration uses — via a new window.siriusRegisterTld(label, {serviceFeeSats}) entry point. register-flow.js grew: - startTldFlow / window.siriusRegisterTld: sets state.tld and walks the modal through wallet-choice → Fund → stepConfirmTld → stepRegisterTld → stepDoneTld - stepConfirmTld: shows label + fee + owner, no per-name quote - stepRegisterTld: dispatches to registerTldWithBuiltInWallet or registerTldWithExternalWallet based on state.wallet/state.session - stepDoneTld: 'X is yours' with txid + certificate id + operator address, no record editor (a TLD certificate has no records to set immediately) - stepWallet / stepExternalConfirm branch on state.tld so the modal heading and the WC-confirm path route correctly tld.html trimmed: removed the entire signin-section + mint-section plus their inline handlers (~250 lines gone). Now just search + registered-TLDs list + a delegator to the shared modal. If a user is already signed in via the wallet dropdown, the modal recognises the saved wallet ('Unlock my browser wallet' button appears) instead of asking them to sign in again on this page.
2026-09-08 00:10:11 +02:00
const kind = state.tld ? "TLD" : "name";
const heading = state.signInOnly
? `Sign in <span style="color:var(--acid,#d6ff3d)">or</span> create a wallet`
: `Register ${esc(state.name)}`;
const intro = state.signInOnly
? `Pick one. Your keys stay in this browser — nothing is transmitted for sign-in.`
: `First, the wallet that will <b>own</b> the ${esc(kind)}. The certificate is minted straight to it — we never hold it.`;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
render(`
<h3>${heading}</h3>
<p class="sub">${intro}</p>
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
${saved ? `<button class="wopt" id="w-unlock"><span class="ic">🔓</span><span>
<b>Unlock my browser wallet</b>
<span>You already created one on this device.</span></span></button>` : ``}
<button class="wopt" id="w-new"><span class="ic"></span><span>
<b>Create a new wallet<span class="pill">easiest</span></b>
<span>Made here in your browser. You get a recovery phrase to write down it is the only key.</span></span></button>
<button class="wopt" id="w-import"><span class="ic">🔑</span><span>
<b>Import a recovery phrase</b>
<span>Restore a wallet you already have, from its 12-word phrase.</span></span></button>
<button class="wopt" id="w-wiz"><span class="ic">🪄</span><span>
<b>Connect a wallet WizardConnect<span class="pill">most private</span></b>
<span>Cashonize 0.9+ or Paytaca. Encrypted end-to-end over Nostr; the relay sees only
ciphertext. Your keys never leave your wallet.</span></span></button>
<div class="note" style="margin-top:18px">Everything below runs on <b>chipnet</b>, Bitcoin Cash's
test network. The coins are free and worth nothing this is an alpha, and it is the honest
place to try it before real money is involved.</div>
`);
if (saved) $("w-unlock").onclick = stepUnlock;
$("w-new").onclick = stepCreate;
$("w-import").onclick = stepImport;
$("w-wiz").onclick = () => stepExternal("wizard");
}
// ---------- WizardConnect (external wallet) ----------
async function stepExternal() {
const label = "WizardConnect";
feat(sirius-x): admin TLD hide/unhide + tabbed sign-in modal (4 direct actions) Two features: 1. Operator can hide TLDs from the public /api/tlds listing so hidden TLDs stop appearing in name-search UIs. On-chain registrations under a hidden TLD keep resolving — this is a UX filter, not enforcement. Gateway (public-gateway.mjs): - Persistent HIDDEN_TLDS set backed by hidden-tlds.json next to the service script - GET /api/tld-visibility -> {hidden:[...]} (public) - POST /api/tld-visibility -> updates the list (operator-gated by Bearer BNS_OPERATOR_TOKEN env var; if unset, all writes refused so we default-deny) - /api/tlds filters out HIDDEN_TLDS; add ?include_hidden=1 to see everything (used by the admin panel to show all rows) - Operator token installed via systemd override on the VPS Admin panel: - New 'Operator token' card at the top of the TLD-registry section; token stored in sessionStorage (not localStorage) so a full browser close forgets it - Each TLD row got a 'Hidden from public' checkbox that POSTs on toggle and refreshes the table; failures roll back the checkbox and surface the error next to the token field 2. Wallet dropdown restored to 4 direct actions (Unlock / Create a wallet / Import a wallet / WizardConnect) and the shared mint/sign-in modal grew a tab strip so users can switch between the four wallet actions from any step without going back to a choice screen. register-flow.js: - renderTabs(active) prepended to stepCreate/stepImport/stepUnlock/ stepExternal when signInOnly is set. Unlock tab only appears when a saved wallet exists. - Delegated click handler on the sheet routes tab clicks to the matching step; switching away from a live WC session tears it down first so we don't leak WebSockets. profile-menu.js: - Restored 4-item onboarding menu (Create/Import/WC plus Unlock when saved). Each item is a direct entry point; the tabbed modal lets the user pivot to any other option without closing. Cache-buster bumped on all 8 sirius-x pages to ?v=20260908tabs.
2026-09-08 02:19:41 +02:00
render(`${renderTabs("wc")}<h3>Connect with ${esc(label)}</h3><p class="sub">Starting the connection…</p>`);
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
let session;
try {
const mod = await import("https://silentmode.st/js/wizardconnect.js");
session = await mod.openWizardSession({
dappName: BNS.REGISTRAR.wizardConnect.dappName,
dappIcon: BNS.REGISTRAR.wizardConnect.dappIcon,
prefix: BNS.REGISTRAR.addressPrefix,
crypto: {
pubkeyToAddress: BNS.pubkeyToAddress,
pubkeyToLockingBytecode: BNS.pubkeyToLockingBytecode,
binToHex: BNS.binToHex,
txidOfHex: BNS.txidOfHex,
},
});
} catch (e) {
render(`<h3>Could not start ${esc(label)}</h3><p class="sub">${esc(e.message)}</p>
<div class="row end"><button class="btn ghost" id="back">Back</button></div>`);
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
$("back").onclick = state.signInOnly ? close : stepWallet;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
return;
}
const uri = session.qrUri ?? session.uri;
render(`
feat(sirius-x): admin TLD hide/unhide + tabbed sign-in modal (4 direct actions) Two features: 1. Operator can hide TLDs from the public /api/tlds listing so hidden TLDs stop appearing in name-search UIs. On-chain registrations under a hidden TLD keep resolving — this is a UX filter, not enforcement. Gateway (public-gateway.mjs): - Persistent HIDDEN_TLDS set backed by hidden-tlds.json next to the service script - GET /api/tld-visibility -> {hidden:[...]} (public) - POST /api/tld-visibility -> updates the list (operator-gated by Bearer BNS_OPERATOR_TOKEN env var; if unset, all writes refused so we default-deny) - /api/tlds filters out HIDDEN_TLDS; add ?include_hidden=1 to see everything (used by the admin panel to show all rows) - Operator token installed via systemd override on the VPS Admin panel: - New 'Operator token' card at the top of the TLD-registry section; token stored in sessionStorage (not localStorage) so a full browser close forgets it - Each TLD row got a 'Hidden from public' checkbox that POSTs on toggle and refreshes the table; failures roll back the checkbox and surface the error next to the token field 2. Wallet dropdown restored to 4 direct actions (Unlock / Create a wallet / Import a wallet / WizardConnect) and the shared mint/sign-in modal grew a tab strip so users can switch between the four wallet actions from any step without going back to a choice screen. register-flow.js: - renderTabs(active) prepended to stepCreate/stepImport/stepUnlock/ stepExternal when signInOnly is set. Unlock tab only appears when a saved wallet exists. - Delegated click handler on the sheet routes tab clicks to the matching step; switching away from a live WC session tears it down first so we don't leak WebSockets. profile-menu.js: - Restored 4-item onboarding menu (Create/Import/WC plus Unlock when saved). Each item is a direct entry point; the tabbed modal lets the user pivot to any other option without closing. Cache-buster bumped on all 8 sirius-x pages to ?v=20260908tabs.
2026-09-08 02:19:41 +02:00
${renderTabs("wc")}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
<h3>Open your wallet</h3>
<p class="sub">Scan or paste this into ${esc(label)}-capable wallet, then approve the connection.</p>
<div class="addr"><code id="uri">${esc(uri)}</code><button class="btn ghost" id="copy">Copy</button></div>
<div class="note warn" style="margin-top:16px">Waiting for your wallet
The link stays valid until you close this page.</div>
<div class="row end"><button class="btn ghost" id="cancel">Cancel</button></div>
`);
$("copy").onclick = () => navigator.clipboard?.writeText(uri);
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
$("cancel").onclick = async () => { try { await session.disconnect(); } catch {} (state.signInOnly ? close : stepWallet)(); };
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
try { await session.ready; } catch (e) { err(e); return; }
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
// Sign-in-only path: get the address and persist siriusProfile immediately,
// skip the whole "quote registration" branch since there is no name.
if (state.signInOnly) {
try {
const addresses = await session.getAddresses();
if (!addresses?.length) throw new Error("wallet returned no addresses");
state.session = session; // keep alive for record edits etc.
finishSignIn({
source: "wc",
address: addresses[0],
tokenAddress: BNS.toTokenAddress(addresses[0]),
watchedAddresses: addresses,
});
} catch (e) { err(e); }
return;
}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
stepExternalConfirm(session, label);
}
async function stepExternalConfirm(session, label) {
render(`<h3>Connected</h3><p class="sub">Reading your wallet and building the registration…</p>`);
try {
const c = await client();
const addresses = await session.getAddresses();
const owner = addresses[0];
const balance = await BNS.getBalance(c, addresses);
const genesis = BNS.describeGenesisRequirement(balance.hasGenesisInput);
if (balance.sats === 0n) {
render(`<h3>That wallet is empty</h3>
<p class="sub">Fund <span class="mono">${esc(owner)}</span> with chipnet coins and reconnect.</p>
<div class="row end"><button class="btn ghost" id="back">Back</button></div>`);
$("back").onclick = async () => { try { await session.disconnect(); } catch {} stepWallet(); };
return;
}
feat(sirius-x): pencil Register icon + TLD mint via shared modal Two UX polishes: 1. Register-tab icon flipped from 🪪 (identification-card emoji, renders as a hollow box in system-ui fonts without extended emoji) to ✏️ (pencil), which reads as 'edit/create' and ships in every emoji font worth targeting. Changed across the nav on all 8 pages plus the footer injector's Product column. Kept the Register nav item — six items total in the nav, and from any subpage it's one click to the search on landing. 2. tld.html no longer duplicates the wallet-choice + mint flow inline. The Register button on a search result now hands the label off to the shared register-flow.js modal — same modal that name registration uses — via a new window.siriusRegisterTld(label, {serviceFeeSats}) entry point. register-flow.js grew: - startTldFlow / window.siriusRegisterTld: sets state.tld and walks the modal through wallet-choice → Fund → stepConfirmTld → stepRegisterTld → stepDoneTld - stepConfirmTld: shows label + fee + owner, no per-name quote - stepRegisterTld: dispatches to registerTldWithBuiltInWallet or registerTldWithExternalWallet based on state.wallet/state.session - stepDoneTld: 'X is yours' with txid + certificate id + operator address, no record editor (a TLD certificate has no records to set immediately) - stepWallet / stepExternalConfirm branch on state.tld so the modal heading and the WC-confirm path route correctly tld.html trimmed: removed the entire signin-section + mint-section plus their inline handlers (~250 lines gone). Now just search + registered-TLDs list + a delegator to the shared modal. If a user is already signed in via the wallet dropdown, the modal recognises the saved wallet ('Unlock my browser wallet' button appears) instead of asking them to sign in again on this page.
2026-09-08 00:10:11 +02:00
// TLD external path: keep the session, hand off to the TLD confirm/mint
// steps which know to call registerTldWithExternalWallet.
if (state.tld) { state.session = session; return stepConfirmTld(); }
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
const quote = await BNS.quoteRegistration(c, { name: state.name, ownerAddress: owner, records: {} });
const rows = BNS.priceSummary(quote.costs).map((l) => `
<tr class="${l.total ? "total" : ""}"><td>${esc(l.label)}${l.note ? `<small>${esc(l.note)}</small>` : ""}</td>
<td>${sats(l.sats)} sat</td></tr>`).join("");
render(`
<h3>Confirm ${esc(quote.displayName)}</h3>
<p class="sub">Connected to ${esc(label)}. The certificate is minted to
<span class="mono">${esc(owner)}</span> your wallet, your key.</p>
<table class="price">${rows}</table>
${genesis.ready ? "" : `<div class="note warn" style="margin-top:16px">
<b>Two approvals needed.</b> ${esc(genesis.explanation)}</div>`}
<div class="row end"><button class="btn ghost" id="back">Back</button>
<button class="btn acid" id="go">Register approve in your wallet</button></div>
`);
$("back").onclick = async () => { try { await session.disconnect(); } catch {} stepWallet(); };
$("go").onclick = async () => {
render(`<h3>Approve in your wallet</h3>
<p class="sub">${esc(label)} has sent the transaction to your device. Check the details there
and approve. Do not close this tab.</p><div class="steps-log" id="log"></div>`);
const log = $("log");
const say = (s) => { const d = document.createElement("div"); d.textContent = s; log.appendChild(d); };
try {
const res = await BNS.registerWithExternalWallet(await client(), {
session, name: state.name, ownerAddress: owner, records: {}, onProgress: say,
});
state.result = res;
state.session = session;
stepDone();
} catch (e) {
err(e);
const row = document.createElement("div"); row.className = "row end";
row.innerHTML = `<button class="btn ghost" id="back">Back</button>`;
sheet.appendChild(row);
$("back").onclick = () => stepExternalConfirm(session, label);
}
};
} catch (e) { err(e); }
}
// ---------- built-in: create ----------
function stepCreate() {
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
// The Register button flow lands here via stepWallet, so "Back" returns to
// the wallet-choice step. The sign-in dropdown calls stepCreate directly
// with no chosen name, so "Back" should just close the modal in that case.
const goBack = state.signInOnly ? close : stepWallet;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
render(`
feat(sirius-x): admin TLD hide/unhide + tabbed sign-in modal (4 direct actions) Two features: 1. Operator can hide TLDs from the public /api/tlds listing so hidden TLDs stop appearing in name-search UIs. On-chain registrations under a hidden TLD keep resolving — this is a UX filter, not enforcement. Gateway (public-gateway.mjs): - Persistent HIDDEN_TLDS set backed by hidden-tlds.json next to the service script - GET /api/tld-visibility -> {hidden:[...]} (public) - POST /api/tld-visibility -> updates the list (operator-gated by Bearer BNS_OPERATOR_TOKEN env var; if unset, all writes refused so we default-deny) - /api/tlds filters out HIDDEN_TLDS; add ?include_hidden=1 to see everything (used by the admin panel to show all rows) - Operator token installed via systemd override on the VPS Admin panel: - New 'Operator token' card at the top of the TLD-registry section; token stored in sessionStorage (not localStorage) so a full browser close forgets it - Each TLD row got a 'Hidden from public' checkbox that POSTs on toggle and refreshes the table; failures roll back the checkbox and surface the error next to the token field 2. Wallet dropdown restored to 4 direct actions (Unlock / Create a wallet / Import a wallet / WizardConnect) and the shared mint/sign-in modal grew a tab strip so users can switch between the four wallet actions from any step without going back to a choice screen. register-flow.js: - renderTabs(active) prepended to stepCreate/stepImport/stepUnlock/ stepExternal when signInOnly is set. Unlock tab only appears when a saved wallet exists. - Delegated click handler on the sheet routes tab clicks to the matching step; switching away from a live WC session tears it down first so we don't leak WebSockets. profile-menu.js: - Restored 4-item onboarding menu (Create/Import/WC plus Unlock when saved). Each item is a direct entry point; the tabbed modal lets the user pivot to any other option without closing. Cache-buster bumped on all 8 sirius-x pages to ?v=20260908tabs.
2026-09-08 02:19:41 +02:00
${renderTabs("new")}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
<h3>Create your wallet</h3>
<p class="sub">Generated in this browser. The phrase is never sent anywhere not to us, not to anyone.</p>
<label for="pw">Password (encrypts the wallet on this device)</label>
<input type="password" id="pw" autocomplete="new-password" placeholder="at least 8 characters">
<label for="pw2">Repeat password</label>
<input type="password" id="pw2" autocomplete="new-password">
<div class="note warn" style="margin-top:16px"><b>There is no reset.</b> The password protects this
device; the recovery phrase you will see next <i>is</i> the wallet. Lose both and the name is gone
forever that is what self-custody means.</div>
<div class="row end"><button class="btn ghost" id="back">Back</button>
<button class="btn acid" id="next">Generate phrase </button></div>
`);
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
$("back").onclick = goBack;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
$("next").onclick = async () => {
const pw = $("pw").value, pw2 = $("pw2").value;
if (pw.length < 8) return err(new Error("password must be at least 8 characters"));
if (pw !== pw2) return err(new Error("passwords do not match"));
try {
const wallet = await BNS.BuiltInWallet.create();
await wallet.save(pw);
state.wallet = wallet;
stepPhrase();
} catch (e) { err(e); }
};
}
function stepPhrase() {
const words = state.wallet.mnemonic.split(" ");
render(`
<h3>Write this down. Now.</h3>
<p class="sub">These 12 words are your wallet. Anyone who has them owns your names; if you lose them,
nobody including us can recover anything.</p>
<div class="phrase">${words.map((w,i)=>`<span><b>${i+1}</b>${esc(w)}</span>`).join("")}</div>
<div class="row"><button class="btn ghost" id="copy">Copy phrase</button></div>
<label class="chk"><input type="checkbox" id="ack">
<span>I have written the phrase down somewhere safe and offline. I understand it cannot be reset.</span></label>
<div class="row end"><button class="btn acid" id="next" disabled>Continue </button></div>
`);
$("copy").onclick = () => navigator.clipboard?.writeText(state.wallet.mnemonic);
$("ack").onchange = (e) => { $("next").disabled = !e.target.checked; };
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
$("next").onclick = () => { if (!finishSignIn(state.wallet)) stepFund(); };
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
}
// ---------- built-in: import / unlock ----------
function stepImport() {
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
const goBack = state.signInOnly ? close : stepWallet;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
render(`
feat(sirius-x): admin TLD hide/unhide + tabbed sign-in modal (4 direct actions) Two features: 1. Operator can hide TLDs from the public /api/tlds listing so hidden TLDs stop appearing in name-search UIs. On-chain registrations under a hidden TLD keep resolving — this is a UX filter, not enforcement. Gateway (public-gateway.mjs): - Persistent HIDDEN_TLDS set backed by hidden-tlds.json next to the service script - GET /api/tld-visibility -> {hidden:[...]} (public) - POST /api/tld-visibility -> updates the list (operator-gated by Bearer BNS_OPERATOR_TOKEN env var; if unset, all writes refused so we default-deny) - /api/tlds filters out HIDDEN_TLDS; add ?include_hidden=1 to see everything (used by the admin panel to show all rows) - Operator token installed via systemd override on the VPS Admin panel: - New 'Operator token' card at the top of the TLD-registry section; token stored in sessionStorage (not localStorage) so a full browser close forgets it - Each TLD row got a 'Hidden from public' checkbox that POSTs on toggle and refreshes the table; failures roll back the checkbox and surface the error next to the token field 2. Wallet dropdown restored to 4 direct actions (Unlock / Create a wallet / Import a wallet / WizardConnect) and the shared mint/sign-in modal grew a tab strip so users can switch between the four wallet actions from any step without going back to a choice screen. register-flow.js: - renderTabs(active) prepended to stepCreate/stepImport/stepUnlock/ stepExternal when signInOnly is set. Unlock tab only appears when a saved wallet exists. - Delegated click handler on the sheet routes tab clicks to the matching step; switching away from a live WC session tears it down first so we don't leak WebSockets. profile-menu.js: - Restored 4-item onboarding menu (Create/Import/WC plus Unlock when saved). Each item is a direct entry point; the tabbed modal lets the user pivot to any other option without closing. Cache-buster bumped on all 8 sirius-x pages to ?v=20260908tabs.
2026-09-08 02:19:41 +02:00
${renderTabs("import")}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
<h3>Import a recovery phrase</h3>
<p class="sub">12 words, separated by spaces. It stays in this browser.</p>
<label for="mn">Recovery phrase</label>
<textarea id="mn" spellcheck="false" placeholder="word word word …"></textarea>
<label for="pw">Password to encrypt it on this device</label>
<input type="password" id="pw" autocomplete="new-password">
<div class="row end"><button class="btn ghost" id="back">Back</button>
<button class="btn acid" id="next">Import </button></div>
`);
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
$("back").onclick = goBack;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
$("next").onclick = async () => {
try {
if ($("pw").value.length < 8) throw new Error("password must be at least 8 characters");
const wallet = await BNS.BuiltInWallet.fromMnemonic($("mn").value);
await wallet.save($("pw").value);
state.wallet = wallet;
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
if (!finishSignIn(wallet)) stepFund();
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
} catch (e) { err(e); }
};
}
function stepUnlock() {
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
const goBack = state.signInOnly ? close : stepWallet;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
render(`
feat(sirius-x): admin TLD hide/unhide + tabbed sign-in modal (4 direct actions) Two features: 1. Operator can hide TLDs from the public /api/tlds listing so hidden TLDs stop appearing in name-search UIs. On-chain registrations under a hidden TLD keep resolving — this is a UX filter, not enforcement. Gateway (public-gateway.mjs): - Persistent HIDDEN_TLDS set backed by hidden-tlds.json next to the service script - GET /api/tld-visibility -> {hidden:[...]} (public) - POST /api/tld-visibility -> updates the list (operator-gated by Bearer BNS_OPERATOR_TOKEN env var; if unset, all writes refused so we default-deny) - /api/tlds filters out HIDDEN_TLDS; add ?include_hidden=1 to see everything (used by the admin panel to show all rows) - Operator token installed via systemd override on the VPS Admin panel: - New 'Operator token' card at the top of the TLD-registry section; token stored in sessionStorage (not localStorage) so a full browser close forgets it - Each TLD row got a 'Hidden from public' checkbox that POSTs on toggle and refreshes the table; failures roll back the checkbox and surface the error next to the token field 2. Wallet dropdown restored to 4 direct actions (Unlock / Create a wallet / Import a wallet / WizardConnect) and the shared mint/sign-in modal grew a tab strip so users can switch between the four wallet actions from any step without going back to a choice screen. register-flow.js: - renderTabs(active) prepended to stepCreate/stepImport/stepUnlock/ stepExternal when signInOnly is set. Unlock tab only appears when a saved wallet exists. - Delegated click handler on the sheet routes tab clicks to the matching step; switching away from a live WC session tears it down first so we don't leak WebSockets. profile-menu.js: - Restored 4-item onboarding menu (Create/Import/WC plus Unlock when saved). Each item is a direct entry point; the tabbed modal lets the user pivot to any other option without closing. Cache-buster bumped on all 8 sirius-x pages to ?v=20260908tabs.
2026-09-08 02:19:41 +02:00
${renderTabs("unlock")}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
<h3>Unlock your wallet</h3>
<p class="sub">Decrypts the wallet stored in this browser.</p>
<label for="pw">Password</label>
<input type="password" id="pw" autocomplete="current-password">
<div class="row end"><button class="btn ghost" id="back">Back</button>
<button class="btn acid" id="next">Unlock </button></div>
`);
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
$("back").onclick = goBack;
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
$("pw").onkeydown = (e) => { if (e.key === "Enter") $("next").click(); };
$("next").onclick = async () => {
feat(sirius-x): inline wallet dropdown — no navigation, no portal detour Wallet dropdown items (New / Import / WizardConnect) were navigating to portal.html?mode=X and asking the user to click again on arrival. That is 'the sign in landing page which is not functioning' from the user's perspective — a whole redirect for one form. Now every dropdown item opens the mint modal (register-flow.js) inline at the matching step, on whatever page the user is on: New -> stepCreate ('Create your wallet' — password + generate) Import -> stepImport ('Import a recovery phrase' — textarea) WizardConnect -> stepExternal ('Open your wallet' — QR/URI) register-flow.js grew a signInOnly mode: state.name is null, the step Back buttons close instead of going to a wallet-choice step there is no context for, and on wallet-loaded the flow writes siriusProfile and shows a 'Signed in' confirmation instead of Fund -> Confirm -> Mint. WC signInOnly keeps the session alive (state.session) so a later record edit can reuse it without a fresh QR handshake. profile-menu.js: menu items became <a data-action='new|import|wc'> and the click handler lazy-loads register-flow.js on demand — the docs/brand/theseus pages don't ship it in their initial payload, so their nav pill loads it the first time a wallet button is clicked and caches it for subsequent opens. Falls back to portal.html?mode=X if the module can't load. Cache-buster bumped so cached copies pick up the new behavior. Importmap for @bitauth/libauth added to docs/, brand/, theseus/ so the bundle's bare specifier resolves when register-flow.js is lazy-loaded from those pages. Verified end-to-end on the live docs page: all three dropdown items open the modal inline at the correct step, no console errors, no navigation.
2026-09-07 23:52:12 +02:00
try {
state.wallet = await BNS.BuiltInWallet.load($("pw").value);
if (!finishSignIn(state.wallet)) stepFund();
} catch (e) { err(e); }
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
};
}
// ---------- fund ----------
let fundTimer = null;
async function stepFund() {
const w = state.wallet;
const faucets = BNS.REGISTRAR.faucets
.map((f) => `<a href="${esc(f.url)}" target="_blank" rel="noopener" style="color:var(--acid,#d6ff3d)">${esc(f.name)}</a>`).join(" · ");
render(`
<h3>Fund your wallet</h3>
<p class="sub">Send test coins to this address. It is yours derived from your phrase.</p>
<div class="addr"><code id="a">${esc(w.address)}</code>
<button class="btn ghost" id="copy">Copy</button></div>
<div class="muted" style="margin-top:10px">Free chipnet coins: ${faucets}</div>
<div class="note" id="bal" style="margin-top:16px">checking balance</div>
<div class="row end"><button class="btn ghost" id="back">Back</button>
<button class="btn acid" id="next" disabled>Continue </button></div>
`);
$("copy").onclick = () => navigator.clipboard?.writeText(w.address);
$("back").onclick = () => { clearInterval(fundTimer); stepWallet(); };
$("next").onclick = () => { clearInterval(fundTimer); stepConfirm(); };
const poll = async () => {
try {
const b = await BNS.getBalance(await client(), w.watchedAddresses);
const enough = b.sats >= 20000n;
$("bal").innerHTML = b.sats > 0n
? `<b class="ok">${sats(b.sats)} sat</b> available (${b.coins} coin${b.coins===1?"":"s"})`
+ (enough ? "" : ` — a little more is needed to cover the registration.`)
: `Waiting for coins… this page is watching the chain live.`;
$("next").disabled = !enough;
} catch (e) { $("bal").textContent = "could not reach the chain: " + e.message; }
};
await poll();
clearInterval(fundTimer);
fundTimer = setInterval(poll, 6000);
}
// ---------- confirm ----------
async function stepConfirm() {
render(`<h3>Preparing…</h3><p class="sub">Building your registration transaction.</p>`);
try {
const c = await client();
feat(sirius-x): pencil Register icon + TLD mint via shared modal Two UX polishes: 1. Register-tab icon flipped from 🪪 (identification-card emoji, renders as a hollow box in system-ui fonts without extended emoji) to ✏️ (pencil), which reads as 'edit/create' and ships in every emoji font worth targeting. Changed across the nav on all 8 pages plus the footer injector's Product column. Kept the Register nav item — six items total in the nav, and from any subpage it's one click to the search on landing. 2. tld.html no longer duplicates the wallet-choice + mint flow inline. The Register button on a search result now hands the label off to the shared register-flow.js modal — same modal that name registration uses — via a new window.siriusRegisterTld(label, {serviceFeeSats}) entry point. register-flow.js grew: - startTldFlow / window.siriusRegisterTld: sets state.tld and walks the modal through wallet-choice → Fund → stepConfirmTld → stepRegisterTld → stepDoneTld - stepConfirmTld: shows label + fee + owner, no per-name quote - stepRegisterTld: dispatches to registerTldWithBuiltInWallet or registerTldWithExternalWallet based on state.wallet/state.session - stepDoneTld: 'X is yours' with txid + certificate id + operator address, no record editor (a TLD certificate has no records to set immediately) - stepWallet / stepExternalConfirm branch on state.tld so the modal heading and the WC-confirm path route correctly tld.html trimmed: removed the entire signin-section + mint-section plus their inline handlers (~250 lines gone). Now just search + registered-TLDs list + a delegator to the shared modal. If a user is already signed in via the wallet dropdown, the modal recognises the saved wallet ('Unlock my browser wallet' button appears) instead of asking them to sign in again on this page.
2026-09-08 00:10:11 +02:00
// TLD flow skips the name-availability check and the per-name quote —
// registerTldWith*Wallet builds the tx internally and checks the on-chain
// TLD registry itself. Just show a simple confirm screen with the fee.
if (state.tld) return stepConfirmTld();
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
const avail = await BNS.checkAvailability(c, state.name);
if (!avail.available) throw new Error(`"${avail.name}" was just registered by someone else`);
const quote = await BNS.quoteRegistration(c, {
name: state.name, ownerAddress: state.wallet.address, records: {},
});
state.quote = quote;
const rows = BNS.priceSummary(quote.costs).map((l) => `
<tr class="${l.total ? "total" : ""}"><td>${esc(l.label)}${l.note ? `<small>${esc(l.note)}</small>` : ""}</td>
<td>${sats(l.sats)} sat</td></tr>`).join("");
render(`
<h3>Confirm ${esc(quote.displayName)}</h3>
<p class="sub">One transaction. It mints the certificate to <b>your</b> address and pays the fees.</p>
<table class="price">${rows}</table>
<div class="note" style="margin-top:16px">The certificate will be minted to
<span class="mono">${esc(state.wallet.address)}</span> your key, your name.
You can set where it points immediately afterwards.</div>
<div class="row end"><button class="btn ghost" id="back">Back</button>
<button class="btn acid" id="go">Register sign &amp; broadcast</button></div>
`);
$("back").onclick = stepFund;
$("go").onclick = stepRegister;
} catch (e) {
render(`<h3>Could not prepare</h3><p class="sub">${esc(e.message)}</p>
<div class="row end"><button class="btn ghost" id="back">Back</button></div>`);
$("back").onclick = stepFund;
}
}
feat(sirius-x): pencil Register icon + TLD mint via shared modal Two UX polishes: 1. Register-tab icon flipped from 🪪 (identification-card emoji, renders as a hollow box in system-ui fonts without extended emoji) to ✏️ (pencil), which reads as 'edit/create' and ships in every emoji font worth targeting. Changed across the nav on all 8 pages plus the footer injector's Product column. Kept the Register nav item — six items total in the nav, and from any subpage it's one click to the search on landing. 2. tld.html no longer duplicates the wallet-choice + mint flow inline. The Register button on a search result now hands the label off to the shared register-flow.js modal — same modal that name registration uses — via a new window.siriusRegisterTld(label, {serviceFeeSats}) entry point. register-flow.js grew: - startTldFlow / window.siriusRegisterTld: sets state.tld and walks the modal through wallet-choice → Fund → stepConfirmTld → stepRegisterTld → stepDoneTld - stepConfirmTld: shows label + fee + owner, no per-name quote - stepRegisterTld: dispatches to registerTldWithBuiltInWallet or registerTldWithExternalWallet based on state.wallet/state.session - stepDoneTld: 'X is yours' with txid + certificate id + operator address, no record editor (a TLD certificate has no records to set immediately) - stepWallet / stepExternalConfirm branch on state.tld so the modal heading and the WC-confirm path route correctly tld.html trimmed: removed the entire signin-section + mint-section plus their inline handlers (~250 lines gone). Now just search + registered-TLDs list + a delegator to the shared modal. If a user is already signed in via the wallet dropdown, the modal recognises the saved wallet ('Unlock my browser wallet' button appears) instead of asking them to sign in again on this page.
2026-09-08 00:10:11 +02:00
// ---------- TLD confirm ----------
async function stepConfirmTld() {
const feeSats = state.tld.serviceFeeSats;
const owner = state.wallet ? state.wallet.address : (state.session ? (await state.session.getAddresses())[0] : "your address");
render(`
<h3>Confirm <b>${esc(state.name)}</b></h3>
<p class="sub">One transaction. It mints the TLD certificate to <b>your</b> token address; you become
the registry operator for every second-level name under it.</p>
<table class="price">
<tr><td>Service fee${feeSats === 0n ? " <small>(none on chipnet)</small>" : ""}</td>
<td>${sats(feeSats)} sat</td></tr>
<tr><td>Beacon dust + chain fee <small>(covered by wallet)</small></td>
<td>~1,300 sat</td></tr>
</table>
<div class="note" style="margin-top:16px">Minted to <span class="mono">${esc(owner)}</span>.
That wallet becomes the operator for this TLD.</div>
<div class="row end"><button class="btn ghost" id="back">Back</button>
<button class="btn acid" id="go">Register sign &amp; broadcast</button></div>
`);
$("back").onclick = stepFund;
$("go").onclick = stepRegisterTld;
}
async function stepRegisterTld() {
render(`<h3>Registering ${esc(state.name)}</h3>
<p class="sub">Signing in your browser and broadcasting to the chain. Do not close this tab.</p>
<div class="steps-log" id="log"></div>`);
const log = $("log");
const say = (s) => { const d = document.createElement("div"); d.textContent = s; log.appendChild(d); log.scrollTop = log.scrollHeight; };
const serviceFee = { address: BNS.REGISTRAR?.serviceFee?.address ?? null, sats: state.tld.serviceFeeSats };
try {
const res = state.session
? await BNS.registerTldWithExternalWallet(await client(), {
session: state.session, tld: state.tld.label, records: {},
serviceFee, tldListUrl: "https://navigate.st/api/tlds", onProgress: say,
})
: await BNS.registerTldWithBuiltInWallet(await client(), {
wallet: state.wallet, tld: state.tld.label, records: {},
serviceFee, tldListUrl: "https://navigate.st/api/tlds", onProgress: say,
});
state.result = res;
stepDoneTld();
} catch (e) {
err(e);
const row = document.createElement("div"); row.className = "row end";
row.innerHTML = `<button class="btn ghost" id="back">Back</button>`;
sheet.appendChild(row);
$("back").onclick = stepConfirmTld;
}
}
function stepDoneTld() {
const r = state.result;
render(`
<h3><span class="ok"></span> <b>.${esc(r.tld)}</b> is yours</h3>
<p class="sub">The TLD certificate is on the chain, held by your key. Second-level names under
<b>.${esc(r.tld)}</b> now live in your registry.</p>
<table class="price">
<tr><td>Transaction</td><td>${esc(r.txid.slice(0,20))}</td></tr>
<tr><td>Certificate ID</td><td>${esc(r.category.slice(0,20))}</td></tr>
<tr><td>Operator</td><td>${esc(r.ownerAddress.slice(0,22))}</td></tr>
</table>
<div class="row end"><button class="btn acid" id="fin">Done</button></div>
`);
$("fin").onclick = close;
}
feat(sirius-x): merge register.html into landing via shared mint flow Register.html and the landing were running duplicate name-search UIs. The register one was reported broken; the landing one already works inline. Merged both into the landing: - New js/register-flow.js — the full mint modal + wallet setup (Create / Import / Unlock / WizardConnect / Fund / Confirm / Register / Point it somewhere) extracted from register.html's <script type='module'> and turned into a shared module. Injects its own scoped modal HTML + CSS into the host page on load and exposes window.siriusRegisterName(fullName) as its public entry point. - Landing search results now have Register buttons that call the shared flow directly. The whole 'search -> pick name -> mint' journey stays on one page, no redirects, no duplicate search UI to maintain. - register.html reduced to a redirect stub: preserves ?q= if present, refreshes/JS-forwards to './' (landing), and shows a one-line 'Name search moved to the home page' fallback for JS-off users. Old links keep working; no /register.html deep links are broken. - All nav 'Register' entries now point at './#search-input' (or '../#search-input' on subpages), scrolling straight to the landing search box. Footer injector and every internal href updated the same way. Zero live href='.../register.html' left in the tree. Verified: register.html?q=hello redirects to /?q=hello; landing search 'fresh42abc' -> Register button -> modal opens with 'Register fresh42abc.bch' at the wallet-choice step.
2026-09-07 22:36:02 +02:00
// ---------- register ----------
async function stepRegister() {
render(`<h3>Registering ${esc(state.name)}</h3>
<p class="sub">Signing in your browser and broadcasting to the chain. Do not close this tab.</p>
<div class="steps-log" id="log"></div>`);
const log = $("log");
const say = (s) => { const d = document.createElement("div"); d.textContent = s; log.appendChild(d); log.scrollTop = log.scrollHeight; };
const words = {
"checking-availability": "checking the name is still free",
"loading-coins": "loading your coins",
"preparing-wallet": "preparing your wallet (one-off setup transaction)",
"prepared": "wallet prepared",
"building": "building the registration transaction",
"signing": "signing with your key — in this browser",
"broadcasting": "broadcasting to the Bitcoin Cash network",
"registered": "registered",
};
try {
const res = await BNS.registerWithBuiltInWallet(await client(), {
wallet: state.wallet, name: state.name, records: {},
onProgress: (s) => say(words[s] ?? s),
});
state.result = res;
stepDone();
} catch (e) {
err(e);
const row = document.createElement("div"); row.className = "row end";
row.innerHTML = `<button class="btn ghost" id="back">Back</button>`;
sheet.appendChild(row);
$("back").onclick = stepConfirm;
}
}
// ---------- done + point somewhere ----------
function stepDone() {
const r = state.result;
render(`
<h3><span class="ok"></span> ${esc(r.displayName)} is yours</h3>
<p class="sub">The certificate is on the chain, held by your key. Nobody can take it back.</p>
<table class="price">
<tr><td>Transaction</td><td>${esc(r.txid.slice(0,20))}</td></tr>
<tr><td>Certificate ID</td><td>${esc(r.category.slice(0,20))}</td></tr>
<tr><td>Owner</td><td>${esc(r.ownerAddress.slice(0,22))}</td></tr>
</table>
<h3 style="margin-top:24px;font-size:1.05rem">Point it somewhere</h3>
<p class="sub">Optional, and changeable any time only your key can.</p>
<label for="kind">Record type</label>
<select id="kind">
<option value="h">A tiny site stored on the chain itself (h)</option>
<option value="u">Redirect to a web address (u)</option>
<option value="ip">Your own server's IPv4 address (ip)</option>
<option value="tls">TLS certificate fingerprint (tls)</option>
</select>
<label for="val" id="vl">HTML kept small; it lives inside the transaction</label>
<textarea id="val" spellcheck="false" placeholder="&lt;h1&gt;hello&lt;/h1&gt;"></textarea>
<div class="muted" id="budget"></div>
<div class="row end"><button class="btn ghost" id="skip">Done for now</button>
<button class="btn acid" id="set">Publish record</button></div>
`);
const labels = {
h: ["HTML — kept small; it lives inside the transaction", "<h1>hello</h1>"],
u: ["The https:// address the name should open", "https://example.org"],
ip: ["IPv4 address of your server", "203.0.113.9"],
tls: ["SHA-256 fingerprint of your TLS certificate (hex)", "a1b2c3…"],
};
const budget = () => {
const used = new TextEncoder().encode($("val").value).length;
const max = 200 - 30 - r.name.length;
$("budget").textContent = `${used} / ~${max} bytes used`;
$("budget").style.color = used > max ? "var(--taken,#f6768a)" : "";
};
$("kind").onchange = () => { const [l, p] = labels[$("kind").value]; $("vl").textContent = l; $("val").placeholder = p; budget(); };
$("val").oninput = budget;
budget();
$("skip").onclick = close;
$("set").onclick = async () => {
const records = { [$("kind").value]: $("val").value };
const external = !state.wallet && state.session;
render(`<h3>Publishing record</h3><p class="sub">This moves the certificate — which is how the chain
proves you are the owner.${external ? " Approve it in your wallet." : ""}</p>
<div class="steps-log" id="log"></div>`);
const log = $("log");
const say = (s) => { const d = document.createElement("div"); d.textContent = s; log.appendChild(d); };
try {
const upd = external
? await BNS.setRecordsWithExternalWallet(await client(), {
session: state.session, name: r.displayName, records, onProgress: say,
})
: await BNS.setRecordsWithBuiltInWallet(await client(), {
wallet: state.wallet, name: r.displayName, records, onProgress: say,
});
render(`<h3><span class="ok">✓</span> ${esc(r.displayName)} now points somewhere</h3>
<p class="sub">Update transaction <span class="mono">${esc(upd.txid.slice(0,20))}</span> is on the chain.
Resolvers pick it up within a block.</p>
<div class="note">Open it with the Silent Mode resolver, or preview it at
<a href="https://navigate.st/bns/${encodeURIComponent(r.displayName)}" target="_blank" rel="noopener" style="color:var(--acid,#d6ff3d)">navigate.st</a>.</div>
<div class="row end"><button class="btn acid" id="fin">Finish</button></div>`);
$("fin").onclick = close;
} catch (e) {
err(e);
const row = document.createElement("div"); row.className = "row end";
row.innerHTML = `<button class="btn ghost" id="back">Back</button>`;
sheet.appendChild(row); $("back").onclick = stepDone;
}
};
}