v1.49.4: auditoría en frío, tanda B3 — wallet propia y simulador sin asustar

- Informe de wallet: cuáles reutilizadas, txid de cada grupo, CoinJoin propios, aviso si no coincide, salud con números.
- Polvo después de la valoración y como «posible»; «Quitar la wallet de Txoko»; consolidar es normal; banda del historial explicada.
- Cargar la wallet: solo lectura, calcular, SeedSigner y BitBox, selector explicado, errores con qué hacer.
- Simulador y Analizar transacción: textos de la tanda B3 (S-01…S-14, T-01…T-04).
- test33 ajustado al nuevo texto.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5npnUYgSPkAaHkdaeUqBr
This commit is contained in:
2026-10-25 18:11:10 +01:00
co-authored by Claude Opus 5.5
parent 1abb01c94e
commit 5cea7d7bfa
8 changed files with 154 additions and 107 deletions
+8 -8
View File
@@ -52,7 +52,7 @@
const f = await getStrict("/api/v1/fees/recommended");
const v = Number(f && f.halfHourFee);
if (!(v > 0)) throw new Error("respuesta sin halfHourFee");
tarifa = v; tarifaInfo = "la que da tu nodo para entrar en un bloque en media hora (halfHourFee)";
tarifa = v; tarifaInfo = "la que da tu nodo para entrar en un bloque en unos 30 minutos";
} catch (e) { tarifa = TARIFA_SIMULADOR_DEFECTO; tarifaInfo = `tu nodo no la ha dado (${(e && e.message) || "sin respuesta"}), así que se usan ${TARIFA_SIMULADOR_DEFECTO} sat/vB`; }
} else { tarifa = TARIFA_SIMULADOR_DEFECTO; tarifaInfo = `sin nodo no hay tarifa de referencia, así que se usan ${TARIFA_SIMULADOR_DEFECTO} sat/vB`; }
if (g !== gen.current) return;
@@ -88,7 +88,7 @@
<Card glow={C.amber}>
<div style={{ fontSize: "0.65rem", color: C.amber, fontFamily: C.mono, fontWeight: 700, marginBottom: 6 }}>¿QUÉ REVELARÍA ESTE GASTO?</div>
<div style={{ fontSize: "0.68rem", color: C.t2, lineHeight: 1.55, marginBottom: 10 }}>
Elige monedas y un destino y mira qué quedaría a la vista si se gastaran así. No se construye ni se firma nada: es una simulación con el mismo análisis que una transacción real.
Elige monedas y un destino y mira qué quedaría a la vista si se gastaran así. No se construye ni se firma nada: es una simulación con el mismo análisis que una transacción real. Solo se pregunta a tu nodo por la dirección de destino, y solo al pulsar «Simular».
</div>
{!listo ? (
<div style={{ fontSize: "0.66rem", color: C.t2, lineHeight: 1.6, padding: "8px 10px", border: `1px dashed ${C.border}`, borderRadius: 6 }}>
@@ -103,7 +103,7 @@
) : (<>
{walletReport.scanComplete === false && (
<div style={{ fontSize: "0.64rem", color: C.amber, lineHeight: 1.5, marginBottom: 8, padding: "6px 9px", border: `1px solid ${C.amber}40`, borderRadius: 6 }}>
⚠ El informe de la wallet está incompleto: puede faltar alguna moneda, o salir como sin gastar una que ya se gastó.
⚠ El informe de la wallet está incompleto: puede faltar alguna moneda, o salir como sin gastar una que ya se gastó. Vuelve a pulsar «⊙ Analizar wallet» antes de fiarte de esta lista.
</div>)}
{utxos.length === 0 ? (
<div style={{ fontSize: "0.66rem", color: C.t2, marginBottom: 8 }}>No se ve ninguna moneda sin gastar en las direcciones analizadas.</div>
@@ -121,7 +121,7 @@
{rama && <span style={{ fontSize: "0.56rem", color: C.t3, fontFamily: C.mono }}>{rama}</span>}
{lbl && <span style={{ fontSize: "0.6rem", color: C.purple, fontFamily: C.mono }}>🏷 {lbl}</span>}
<span style={{ fontSize: "0.56rem", color: gr >= 0 ? C.amber : C.t3, fontFamily: C.mono, marginLeft: "auto" }}>{gr >= 0 ? `grupo ${gr + 1}` : "suelta"}</span>
{esPolvoMoneda(m) && <span style={{ fontSize: "0.56rem", color: C.amber, fontFamily: C.mono }}>polvo</span>}
{esPolvoMoneda(m) && <span style={{ fontSize: "0.56rem", color: C.amber, fontFamily: C.mono }}>¿polvo?</span>}
{!m.confirmada && <span style={{ fontSize: "0.56rem", color: C.t3, fontFamily: C.mono }}>sin confirmar</span>}
</label>);
})}
@@ -130,8 +130,8 @@
</div>)}
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit,minmax(160px,1fr))", gap: 8, marginBottom: 8 }}>
<input value={destino} onChange={e => { setDestino(filtrarSecreto(e.target.value)); setRes(null); }} placeholder="Dirección de destino" spellCheck={false} autoComplete="off" style={{ ...campo, gridColumn: "1 / -1" }} />
<input value={importeTxt} onChange={e => { setImporteTxt(e.target.value); setRes(null); }} placeholder="Importe en BTC (vacío = enviar todo)" inputMode="decimal" style={campo} />
<input value={tarifaTxt} onChange={e => { setTarifaTxt(e.target.value); setRes(null); }} placeholder={`Tarifa sat/vB (vacío = la de tu nodo, o ${TARIFA_SIMULADOR_DEFECTO})`} inputMode="decimal" style={campo} />
<input value={importeTxt} onChange={e => { setImporteTxt(e.target.value); setRes(null); }} placeholder="Importe en BTC (vacío: enviar todo)" inputMode="decimal" style={campo} />
<input value={tarifaTxt} onChange={e => { setTarifaTxt(e.target.value); setRes(null); }} placeholder={`Tarifa en sat/vB (vacío: la de tu nodo, o ${TARIFA_SIMULADOR_DEFECTO})`} inputMode="decimal" style={campo} />
</div>
<div style={{ display: "flex", gap: 8, flexWrap: "wrap" }}>
<button onClick={simular} disabled={cargando || !marcadas.size || !destino.trim()}
@@ -154,7 +154,7 @@
{(() => { const s = res.sim, c = s.cambio, cp = res.cambioPrevisto; return (
<div style={{ fontSize: "0.66rem", color: C.t1, lineHeight: 1.7, marginBottom: 10, padding: "10px 12px", background: C.bgCard, border: `1px solid ${C.border}`, borderRadius: 6 }}>
<div>Entradas: {s.tx.vin.length} moneda{s.tx.vin.length > 1 ? "s" : ""}, {fmtBtc(s.totalIn)}.</div>
<div>Salida 0: {s.enviarTodo ? "todo" : "el pago"}, {fmtBtc(s.tx.vout[0].value)} a <span style={{ fontFamily: C.mono }}>{abrevDirSim(s.tx.vout[0].scriptpubkey_address)}</span> ({formatoDir(s.tx.vout[0].scriptpubkey_type)}).</div>
<div>Salida 0: {s.enviarTodo ? "todo" : "el pago"}, {fmtBtc(s.tx.vout[0].value)} a <span style={{ fontFamily: C.mono }}>{abrevDirSim(s.tx.vout[0].scriptpubkey_address)}</span> (formato {formatoDir(s.tx.vout[0].scriptpubkey_type)}).</div>
{c ? <div>Salida 1: el cambio, {fmtBtc(c.value)} a {c.ficticia ? <span style={{ color: C.amber }}>una dirección de cambio ficticia ({formatoDir(c.scriptpubkey_type)}), porque {cp.motivo}</span> : <>tu dirección de cambio {c.indice} (<span style={{ fontFamily: C.mono }}>{abrevDirSim(c.address)}</span>), la primera sin usar</>}.</div>
: s.enviarTodo ? <div>Sin cambio: se envía todo menos la comisión.</div>
: <div>Sin cambio: lo que sobraba ({fmtEnt(s.sobranteAComision)} sat) es menos que el mínimo de la red y se suma a la comisión, como hacen los monederos.</div>}
@@ -163,7 +163,7 @@
</div>); })()}
{res.hechos.length > 0 && (
<div style={{ marginBottom: 10, padding: "10px 12px", background: C.bgCard, border: `1px solid ${C.borderBright}`, borderRadius: 6 }}>
<div style={{ fontSize: "0.6rem", color: C.t2, fontFamily: C.mono, letterSpacing: "0.12em", fontWeight: 700, marginBottom: 8 }}>LO QUE SABE TU WALLET Y NO VE EL ANÁLISIS DE UNA SOLA TRANSACCIÓN</div>
<div style={{ fontSize: "0.6rem", color: C.t2, fontFamily: C.mono, letterSpacing: "0.12em", fontWeight: 700, marginBottom: 8 }}>LO QUE AÑADE TU WALLET (y no ve el análisis de una sola transacción)</div>
<div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
{res.hechos.map(h => (
<div key={h.id} style={{ display: "flex", gap: 8, alignItems: "flex-start", flexWrap: "wrap" }}>