Fix Inscriboor detection flow

This commit is contained in:
matcha committed 2026-10-05 05:29:30 +00:00
1 parent 84f684ad0d
commit c9c18e85f6
3 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@
<div id="status" role="status" aria-live="polite">Choose Inscriboor or a local test wallet to start your first loop.</div>
<section class="workspace">
<article class="panel wallet"><div class="panel-title"><span class="step">01</span><h2>Your test wallet</h2><span id="wallet-state" class="tag">NOT CREATED</span></div>
<div id="empty-wallet"><p>One wallet. A whole chain to play with.</p><button id="connect-inscriboor" class="primary">Connect Inscriboor <span>↗</span></button> <a class="quiet button-link" href="/downloads/inscriboor-extension-v0.2.zip" download>Get Inscriboor ↓</a> <button id="create-wallet" class="quiet">Use local test wallet</button><p id="inscriboor-status" class="muted">Looking for the extension…</p><details class="install-help"><summary>Install Inscriboor</summary><ol><li>Download and unzip Inscriboor.</li><li>Open <code>chrome://extensions</code> (or Brave extensions).</li><li>Turn on Developer mode.</li><li>Choose <strong>Load unpacked</strong> and select the unzipped <code>extension</code> folder.</li><li>Refresh this page, then click <strong>Connect Inscriboor</strong>.</li></ol></details></div>
<div id="empty-wallet"><p>One wallet. A whole chain to play with.</p><button id="connect-inscriboor" class="primary">Get Inscriboor ↓</button> <button id="create-wallet" class="quiet">Use local test wallet</button><p id="inscriboor-status" class="muted">Looking for the extension…</p><details class="install-help"><summary>Install Inscriboor</summary><ol><li>Download and unzip Inscriboor.</li><li>Open <code>chrome://extensions</code> (or Brave extensions).</li><li>Turn on Developer mode.</li><li>Choose <strong>Load unpacked</strong> and select the unzipped <code>extension</code> folder.</li><li>Refresh this page. The button above will change from <strong>Get Inscriboor</strong> to <strong>Connect Inscriboor</strong>.</li></ol></details></div>
<div id="active-wallet" hidden><p class="label">FAKE BTC BALANCE</p><div class="balance"><span id="balance">0</span><small>BTC</small></div><p id="reserved" class="muted"></p><label for="address">Local regtest-format address</label><input id="address" readonly><button id="export-wallet" class="quiet">↓ Save test wallet</button></div>
<div class="wallet-footer"><label class="file-button" for="load-wallet">↑ Load test wallet or lab backup</label><input id="load-wallet" type="file" accept=".json,application/json"><p class="muted">Saved on this device. Local-wallet backups contain their test key; Inscriboor backups contain only a public descriptor. A lab backup also preserves the chain.</p></div>
</article>
Binary file not shown.
+4 -3
View File
@@ -169,8 +169,9 @@ function render() {
const disabled = busy || failed;
$('empty-wallet').hidden = !!wallet; $('active-wallet').hidden = !wallet;
$('wallet-state').textContent = wallet ? (wallet.kind === 'extension-wallet' ? 'INSCRIBOOR / TEST' : 'LOCAL / TEST ONLY') : 'NOT CREATED';
$('create-wallet').disabled = disabled; $('connect-inscriboor').disabled = disabled || !inscriboorProvider; $('load-wallet').disabled = disabled;
$('inscriboor-status').textContent = inscriboorProvider ? 'Inscriboor detected - extension key stays outside this page.' : 'Inscriboor not detected. Reload the extension or use the local test wallet.';
$('create-wallet').disabled = disabled; $('connect-inscriboor').disabled = disabled; $('load-wallet').disabled = disabled;
$('connect-inscriboor').textContent = inscriboorProvider ? 'Connect Inscriboor ↗' : 'Get Inscriboor ↓';
$('inscriboor-status').textContent = inscriboorProvider ? 'Inscriboor detected - extension key stays outside this page.' : 'Inscriboor not detected. Install it, refresh, then connect.';
$('mine').disabled = disabled || !wallet;
$('miner-interval').disabled = disabled || !wallet;
$('miner-interval').value = String(lab?.miner?.interval ?? 0);
@@ -240,7 +241,7 @@ $('create-wallet').onclick = () => mutate(next => {
$('connect-inscriboor').onclick = async () => {
try {
const provider = inscriboorProvider ?? window.inscriboor;
if (!provider?.request) throw new Error('Inscriboor extension not detected.');
if (!provider?.request) { location.href = '/downloads/inscriboor-extension-v0.2.1.zip'; return; }
const account = (await provider.request({ method:'bitcoin_getAccounts' }))?.[0];
await mutate(next => {
if (next.wallet) throw new Error('A wallet already exists in this browser. Reset or restore a different lab first.');