v2.1.1 (U2): suelo de letra: 11 px para etiquetas y 13 px para explicaciones

En un iPhone 13, en la pantalla de un análisis, el 61 % del texto iba
por debajo de 11 px y el 21 % por debajo de 10 px (medido en Chromium).

Suelo nuevo, aplicado a los 511 tamaños que quedaban por debajo:
- 11 px (0,69rem) para etiquetas y datos;
- 13 px (0,82rem) para el texto de explicación, que es el que lleva
  interlineado de 1,5 o más en su mismo estilo.
Los títulos y las cifras grandes no se tocan.

Después, en la misma pantalla: 0 % por debajo de 11 px, y la mitad del
texto (las explicaciones) a 13 px o más.

Prueba: tests/test56.js recorre los 689 tamaños de letra de src/, para
que el suelo no se pierda con el próximo texto que se añada.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfMP18trcnNTkAwJsMrev
This commit is contained in:
2026-11-16 11:35:07 +01:00
co-authored by Claude Fable 5.2
parent 4fad712701
commit 82d1748905
19 changed files with 543 additions and 496 deletions
+14 -14
View File
@@ -17,14 +17,14 @@
<path d="M9 6.5v11M11.5 5v2M11.5 17v2M9 6.5h4.2a2.6 2.6 0 0 1 0 5.2H9m0 0h4.8a2.9 2.9 0 0 1 0 5.8H9" fill="none" stroke={C.bg} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
);
const Badge = ({children, color}) => { const c=color||C.green; return <span style={{fontSize:"0.62rem",fontFamily:C.mono,letterSpacing:"0.07em",padding:"2px 6px",borderRadius:3,fontWeight:700,background:`${c}18`,color:c,border:`1px solid ${c}35`,whiteSpace:"nowrap"}}>{children}</span>; };
const Badge = ({children, color}) => { const c=color||C.green; return <span style={{fontSize:"0.69rem",fontFamily:C.mono,letterSpacing:"0.07em",padding:"2px 6px",borderRadius:3,fontWeight:700,background:`${c}18`,color:c,border:`1px solid ${c}35`,whiteSpace:"nowrap"}}>{children}</span>; };
const Card = ({children, style, glow, innerRef}) => <div ref={innerRef} style={{background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:8,padding:16,boxShadow:glow?`0 0 28px ${glow}12`:"none",...style}}>{children}</div>;
const SectionTitle = ({children, accent, icon}) => { const a=accent||C.green;
const h2 = C.serif
? {margin:0,fontSize:"1.08rem",fontFamily:C.serif,fontWeight:600,fontStyle:C.italica?"italic":"normal",letterSpacing:"0.01em",color:a}
: {margin:0,fontSize:"0.68rem",fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",color:a};
: {margin:0,fontSize:"0.69rem",fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",color:a};
return <div style={{display:"flex",alignItems:"center",gap:8,marginBottom:16}}>{icon&&<span style={{color:a,fontFamily:C.mono,fontSize:"0.8rem"}}>{icon}</span>}<h2 style={h2}>{children}</h2><div style={{flex:1,height:1,background:`linear-gradient(to right,${a}40,transparent)`}}/></div>; };
const Tag = ({label,value,color}) => <div style={{display:"flex",flexDirection:"column",gap:3}}><span style={{fontSize:"0.58rem",color:C.t2,textTransform:"uppercase",letterSpacing:"0.1em",fontFamily:C.mono}}>{label}</span><span style={{fontSize:"0.8rem",color:color||C.t1,fontFamily:C.mono,fontWeight:600}}>{value!=null?value:"-"}</span></div>;
const Tag = ({label,value,color}) => <div style={{display:"flex",flexDirection:"column",gap:3}}><span style={{fontSize:"0.69rem",color:C.t2,textTransform:"uppercase",letterSpacing:"0.1em",fontFamily:C.mono}}>{label}</span><span style={{fontSize:"0.8rem",color:color||C.t1,fontFamily:C.mono,fontWeight:600}}>{value!=null?value:"-"}</span></div>;
// Nota para encabezados de listas de salidas o entradas (v1.43): se
// numeran desde 0, como Bitcoin Core, Sparrow y Mempool. Una vez por lista.
const NotaDesdeCero = () => <span style={{fontSize:"0.9em",color:C.t3,textTransform:"none",letterSpacing:0,fontWeight:400}}> (se cuentan desde 0, como en Bitcoin Core, Sparrow o Mempool)</span>;
@@ -89,7 +89,7 @@
sinEnlaces: modo === "tor" && !web };
}
const AvisoSignet = ({modo, onAjustes}) => (
<div style={{padding:"12px 14px",background:C.purpleMuted||C.amberMuted,border:`1px solid ${C.purple||C.amber}66`,borderRadius:8,marginBottom:14,fontSize:"0.74rem",lineHeight:1.55}}>
<div style={{padding:"12px 14px",background:C.purpleMuted||C.amberMuted,border:`1px solid ${C.purple||C.amber}66`,borderRadius:8,marginBottom:14,fontSize:"0.82rem",lineHeight:1.55}}>
<div style={{fontFamily:C.mono,fontWeight:700,letterSpacing:"0.06em",color:C.purple||C.amber,marginBottom:4}}>SIGNET · RED DE PRUEBAS · LAS MONEDAS NO TIENEN VALOR</div>
<div style={{color:C.t1}}>
Estás viendo la red de pruebas, no la red principal. {modo === "tor"
@@ -100,7 +100,7 @@
? <>Falta la dirección: pon la de tu nodo en Ajustes (mainnet) o una Mempool de signet.</>
: <>Las consultas van a la Mempool de signet que has configurado.</>}
</div>
<button onClick={onAjustes} style={{marginTop:8,padding:"6px 12px",background:"none",border:`1px solid ${C.purple||C.amber}70`,borderRadius:6,color:C.purple||C.amber,fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer"}}>⚙ Cambiar de red</button>
<button onClick={onAjustes} style={{marginTop:8,padding:"6px 12px",background:"none",border:`1px solid ${C.purple||C.amber}70`,borderRadius:6,color:C.purple||C.amber,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>⚙ Cambiar de red</button>
</div>
);
@@ -121,7 +121,7 @@
return (
<a href={url} target="_blank" rel="noopener noreferrer"
title={tituloWebMempool(base)}
style={{fontSize:"0.58rem",fontFamily:C.mono,color:C.t2,textDecoration:"none",border:`1px solid ${C.border}`,borderRadius:4,padding:"2px 7px",whiteSpace:"nowrap"}}
style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,textDecoration:"none",border:`1px solid ${C.border}`,borderRadius:4,padding:"2px 7px",whiteSpace:"nowrap"}}
onMouseEnter={e=>{e.currentTarget.style.color=C.blue;e.currentTarget.style.borderColor=C.blue+"60";}}
onMouseLeave={e=>{e.currentTarget.style.color=C.t2;e.currentTarget.style.borderColor=C.border;}}>
{texto || "ver en Mempool ↗"}
@@ -142,7 +142,7 @@
const pulsar = async e => { e.preventDefault(); e.stopPropagation(); const ok = await copiarTexto(texto); setHecho(ok ? "ok" : "no"); setTimeout(() => setHecho(null), ok ? 1500 : 4000); };
return (
<button type="button" onClick={pulsar} title={`Copiar ${etiqueta || ""} entero`.replace(" "," ")} aria-label={`Copiar ${etiqueta || "el texto"} entero`}
style={{background:"none",border:`1px solid ${hecho==="ok"?C.green+"80":C.border}`,borderRadius:4,color:hecho==="ok"?C.green:hecho==="no"?C.red:C.t2,fontFamily:C.mono,fontSize:"0.62rem",padding:"1px 6px",cursor:"pointer",flexShrink:0,minWidth:34}}>
style={{background:"none",border:`1px solid ${hecho==="ok"?C.green+"80":C.border}`,borderRadius:4,color:hecho==="ok"?C.green:hecho==="no"?C.red:C.t2,fontFamily:C.mono,fontSize:"0.69rem",padding:"1px 6px",cursor:"pointer",flexShrink:0,minWidth:34}}>
{hecho==="ok" ? "✓" : hecho==="no" ? "✗ no se pudo copiar: selecciona el texto y cópialo a mano" : "⧉"}
</button>
);
@@ -154,7 +154,7 @@
const rutas = { tx:"tx", direccion:"address" };
const web = base ? webMempool(base) : null;
const url = web && rutas[tipo] ? `${web}/${rutas[tipo]}/${id}` : null;
const estilo = {fontSize:"0.68rem",fontFamily:C.mono,color:color||C.blue,textDecoration:"none",wordBreak:"break-all"};
const estilo = {fontSize:"0.69rem",fontFamily:C.mono,color:color||C.blue,textDecoration:"none",wordBreak:"break-all"};
return (
<span style={{display:"inline-flex",alignItems:"center",gap:6,minWidth:0}}>
{url
@@ -197,9 +197,9 @@
useEffect(() => { const l = () => forzar(x => x + 1); AVISO_SECRETO.listeners.add(l); return () => { AVISO_SECRETO.listeners.delete(l); }; }, []);
if (!AVISO_SECRETO.activo) return null;
return (
<div role="alert" style={{margin:"10px 12px 0",padding:"10px 12px",background:C.redMuted,border:`1px solid ${C.red}60`,borderRadius:6,fontSize:"0.68rem",color:C.t1,lineHeight:1.6}}>
<div role="alert" style={{margin:"10px 12px 0",padding:"10px 12px",background:C.redMuted,border:`1px solid ${C.red}60`,borderRadius:6,fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>
<strong style={{color:C.red}}>⚠ Eso era un secreto.</strong> Lo que has pegado o escrito parece una semilla o una clave privada, y con ella se puede gastar el dinero de esa wallet. Txoko nunca la necesita: se ha borrado del campo, no se ha procesado y no se ha guardado en ninguna parte. Si ese texto ha pasado por sitios que no controlas (un chat, una web, la nube), quien lo viera puede gastar ese dinero.
<button onClick={()=>{ AVISO_SECRETO.activo = false; AVISO_SECRETO.listeners.forEach(l => l()); }} style={{display:"block",marginTop:6,background:"none",border:`1px solid ${C.red}60`,borderRadius:5,padding:"4px 12px",color:C.red,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer"}}>Entendido</button>
<button onClick={()=>{ AVISO_SECRETO.activo = false; AVISO_SECRETO.listeners.forEach(l => l()); }} style={{display:"block",marginTop:6,background:"none",border:`1px solid ${C.red}60`,borderRadius:5,padding:"4px 12px",color:C.red,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>Entendido</button>
</div>
);
}
@@ -207,10 +207,10 @@
function EstadoNodoBanner({base, onAjustes}) {
const h = useNodeHealth(base);
const caja = (color, fondo, titulo, texto) => (
<div style={{padding:"12px 14px",background:fondo,border:`1px solid ${color}55`,borderRadius:8,color,fontSize:"0.74rem",lineHeight:1.55,marginBottom:14}}>
<div style={{padding:"12px 14px",background:fondo,border:`1px solid ${color}55`,borderRadius:8,color,fontSize:"0.82rem",lineHeight:1.55,marginBottom:14}}>
<div style={{fontFamily:C.mono,fontWeight:700,letterSpacing:"0.06em",marginBottom:4}}>{titulo}</div>
<div style={{color:C.t1}}>{texto}</div>
<button onClick={onAjustes} style={{marginTop:8,padding:"6px 12px",background:"none",border:`1px solid ${color}70`,borderRadius:6,color,fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer"}}>⚙ Abrir ajustes</button>
<button onClick={onAjustes} style={{marginTop:8,padding:"6px 12px",background:"none",border:`1px solid ${color}70`,borderRadius:6,color,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>⚙ Abrir ajustes</button>
</div>
);
if (!base) return caja(C.amber, C.amberMuted, "SIN NODO · MODO DEMOSTRACIÓN",
@@ -235,7 +235,7 @@
if (/^\/api\/v1\/prices/.test(r)) return "precio";
return r;
}
const EjemploAviso = ({texto}) => <div style={{padding:"8px 12px",background:C.amberMuted,border:`1px dashed ${C.amber}70`,borderRadius:6,color:C.amber,fontFamily:C.mono,fontSize:"0.68rem",lineHeight:1.5}}><strong>EJEMPLO</strong> · {texto||"Sin nodo no se puede consultar lo que has buscado: esto es un resultado de ejemplo para que veas cómo funciona."}</div>;
const EjemploAviso = ({texto}) => <div style={{padding:"8px 12px",background:C.amberMuted,border:`1px dashed ${C.amber}70`,borderRadius:6,color:C.amber,fontFamily:C.mono,fontSize:"0.82rem",lineHeight:1.5}}><strong>EJEMPLO</strong> · {texto||"Sin nodo no se puede consultar lo que has buscado: esto es un resultado de ejemplo para que veas cómo funciona."}</div>;
// Qué ha escrito la persona en el buscador. Antes cualquier cosa (hasta
// "hola") devolvía una dirección de demo, como si existiera.
@@ -298,7 +298,7 @@
];
return (
<Card style={{marginBottom:12}}>
<div style={{fontSize:"0.66rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.12em",marginBottom:10}}>¿Qué quieres hacer?</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.12em",marginBottom:10}}>¿Qué quieres hacer?</div>
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(200px,1fr))",gap:8}}>
{acciones.map(a=>(
<button key={a.destino} onClick={()=>onIr(a.destino)} style={{textAlign:"left",padding:"14px 14px",background:`${a.color}14`,border:`1px solid ${a.color}55`,borderRadius:8,cursor:"pointer"}}>
+56 -56
View File
@@ -25,12 +25,12 @@
votos.forEach(v => filas.push([v.idx, PISTA_FLUJO[v.señal] || v.señal]));
return (
<div style={{marginTop:10,padding:"10px 12px",background:C.bg,border:`1px solid ${C.border}`,borderRadius:6}}>
<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,letterSpacing:"0.12em",marginBottom:6}}>PISTAS · A QUÉ SALIDA APUNTA CADA UNA<NotaDesdeCero/></div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,letterSpacing:"0.12em",marginBottom:6}}>PISTAS · A QUÉ SALIDA APUNTA CADA UNA<NotaDesdeCero/></div>
{filas.map(([i, t], k) => (
<div key={k} style={{fontSize:"0.64rem",color:C.t1,fontFamily:C.mono,lineHeight:1.6}}>
<div key={k} style={{fontSize:"0.82rem",color:C.t1,fontFamily:C.mono,lineHeight:1.6}}>
<span style={{color:index===i?C.amber:C.t1,fontWeight:700}}>Salida {i}</span>{tx.vout[i]?<span style={{color:C.t2}}> ({fmtBtc(tx.vout[i].value)})</span>:null} ← {t}
</div>))}
<div style={{marginTop:6,fontSize:"0.64rem",color:C.t1,lineHeight:1.5}}>{veredicto} <span style={{color:C.t2}}>En el dibujo del flujo, arriba, la salida señalada va marcada.</span></div>
<div style={{marginTop:6,fontSize:"0.82rem",color:C.t1,lineHeight:1.5}}>{veredicto} <span style={{color:C.t2}}>En el dibujo del flujo, arriba, la salida señalada va marcada.</span></div>
</div>
);
}
@@ -103,7 +103,7 @@
<button onClick={()=>setAbierto(!abierto)} aria-expanded={abierto} style={{
width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,
padding:"10px 14px",background:C.bgCard,border:`1px solid ${abierto?C.purple+"60":C.border}`,
borderRadius:abierto?"6px 6px 0 0":6,cursor:"pointer",color:C.purple,fontFamily:C.mono,fontSize:"0.68rem",fontWeight:700,
borderRadius:abierto?"6px 6px 0 0":6,cursor:"pointer",color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",fontWeight:700,
letterSpacing:"0.1em",textTransform:"uppercase",textAlign:"left",
}}>
<span>Flujo de la transacción{g.simulada?" · simulación":""}</span>
@@ -112,7 +112,7 @@
{!abierto&&isMobile&&(()=>{ const conMarcas=[...g.entradas, ...derecha].filter(f=>f.marcas.length); return conMarcas.length ? (
<div style={{background:C.bgCard,border:`1px solid ${C.border}`,borderTop:"none",borderRadius:"0 0 6px 6px",padding:"8px 10px",display:"flex",flexDirection:"column",gap:6}}>
{conMarcas.map((f,k)=>(
<div key={k} style={{fontFamily:C.mono,fontSize:"0.64rem",lineHeight:1.5}}>
<div key={k} style={{fontFamily:C.mono,fontSize:"0.82rem",lineHeight:1.5}}>
<span style={{color:C.t1}}>{f.nombre}{f.importe?` · ${f.importe}`:""}</span>
<span style={{display:"flex",flexWrap:"wrap",gap:4,marginTop:2}}>
{f.marcas.map((m,q)=><span key={q} style={{border:`1px solid ${col(m.tono)}60`,color:col(m.tono),borderRadius:3,padding:"1px 5px"}}>{m.corto||m.texto}{m.certeza?` · ${m.certeza.toLowerCase()}`:""}</span>)}
@@ -121,7 +121,7 @@
</div>) : null; })()}
{abierto&&(
<div style={{background:C.bgCard,border:`1px solid ${C.purple}30`,borderTop:"none",borderRadius:"0 0 6px 6px",padding:isMobile?"10px 8px":"12px 14px"}}>
{g.simulada&&<div style={{marginBottom:8,fontSize:"0.6rem",fontFamily:C.mono,color:C.amber,fontWeight:700,letterSpacing:"0.08em"}}>SIMULACIÓN · no es una transacción real; el cambio y la comisión son estimados</div>}
{g.simulada&&<div style={{marginBottom:8,fontSize:"0.69rem",fontFamily:C.mono,color:C.amber,fontWeight:700,letterSpacing:"0.08em"}}>SIMULACIÓN · no es una transacción real; el cambio y la comisión son estimados</div>}
<div ref={caja} style={{width:"100%"}}>
<svg role="img" aria-label={g.aria} width={g.ancho} height={g.alto} viewBox={`0 0 ${g.ancho} ${g.alto}`} style={{display:"block",maxWidth:"100%",overflow:"visible"}}>
{/* v2.0.0: franjas en degradado, del gris de las entradas al color de cada salida. */}
@@ -145,23 +145,23 @@
</g>))}
</svg>
</div>
<div style={{marginTop:8,fontSize:"0.64rem",color:C.t2,lineHeight:1.6}}>
<div style={{marginTop:8,fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>
El grosor es el importe. La cadena no dice qué entrada paga qué salida: solo que todas las entradas juntas pagan todas las salidas.{g.coinbase?" Aquí no hay entradas: son monedas nuevas que crea el minero (subsidio más comisiones del bloque).":""} Se cuentan desde 0.
</div>
{g.letras.length>0&&<div style={{marginTop:4,fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>{g.letras.map((l,k)=><span key={l.letra} style={{whiteSpace:"nowrap"}}>{k>0?" · ":""}<b style={{color:C.purple}}>{l.letra}</b> {l.formato}</span>)}</div>}
{g.notas.map((n,k)=><div key={k} style={{marginTop:4,fontSize:"0.64rem",color:C.t1,lineHeight:1.5}}>{n}</div>)}
{g.letras.length>0&&<div style={{marginTop:4,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>{g.letras.map((l,k)=><span key={l.letra} style={{whiteSpace:"nowrap"}}>{k>0?" · ":""}<b style={{color:C.purple}}>{l.letra}</b> {l.formato}</span>)}</div>}
{g.notas.map((n,k)=><div key={k} style={{marginTop:4,fontSize:"0.82rem",color:C.t1,lineHeight:1.5}}>{n}</div>)}
<div style={{marginTop:6,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"}}>
<button onClick={()=>setVerLista(!verLista)} aria-expanded={verLista} style={{background:"none",border:"none",padding:"4px 0",color:C.purple,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer",minHeight:isMobile?36:undefined}}>
<button onClick={()=>setVerLista(!verLista)} aria-expanded={verLista} style={{background:"none",border:"none",padding:"4px 0",color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",minHeight:isMobile?36:undefined}}>
{verLista?"▲":"▼"} Ver como lista
</button>
{!isMobile&&<span style={{fontSize:"0.6rem",color:C.t3}}>Pasa el ratón por una fila para ver la dirección entera y el porqué de cada marca.</span>}
{!isMobile&&<span style={{fontSize:"0.69rem",color:C.t3}}>Pasa el ratón por una fila para ver la dirección entera y el porqué de cada marca.</span>}
</div>
{verLista&&(
<div style={{marginTop:4,display:"flex",flexDirection:"column",gap:2,fontFamily:C.mono,fontSize:"0.62rem",color:C.t1,lineHeight:1.5}}>
<div style={{marginTop:4,display:"flex",flexDirection:"column",gap:2,fontFamily:C.mono,fontSize:"0.82rem",color:C.t1,lineHeight:1.5}}>
{[...g.entradas, ...derecha].map((f,k)=>(
<div key={k} style={{wordBreak:"break-word"}}>
{textoFila(f)}
{isMobile&&f.marcas.filter(m=>m.detalle).map((m,q)=><div key={q} style={{paddingLeft:10,color:C.t2,fontSize:"0.6rem"}}>↳ {m.texto}: {m.detalle}</div>)}
{isMobile&&f.marcas.filter(m=>m.detalle).map((m,q)=><div key={q} style={{paddingLeft:10,color:C.t2,fontSize:"0.69rem"}}>↳ {m.texto}: {m.detalle}</div>)}
</div>))}
</div>
)}
@@ -435,39 +435,39 @@
</div>
{expanded===check.id&&(
<div style={{padding:"0 14px 12px 14px",borderTop:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6,paddingTop:10}}>{check.detail}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6,paddingTop:10}}>{check.detail}</div>
{/* v2.0.0: ¿tiene arreglo? y ¿quién puede verlo? (18-lectura-senal.js) */}
{tx&&(!check.pass||check.informational)&&(()=>{ const l=lecturaSenal(check, tx, analysis); return l ? (
<div style={{marginTop:8,display:"flex",flexDirection:"column",gap:4,fontSize:"0.66rem",lineHeight:1.55}}>
<div style={{marginTop:8,display:"flex",flexDirection:"column",gap:4,fontSize:"0.82rem",lineHeight:1.55}}>
<div><span style={{color:C.t1,fontFamily:C.mono,fontWeight:700}}>¿Tiene arreglo? </span><span style={{color:C.t2}}>{l.arreglo}</span></div>
<div><span style={{color:C.t1,fontFamily:C.mono,fontWeight:700}}>¿Quién puede verlo? </span><span style={{color:C.t2}}>{l.quien}</span></div>
</div>) : null; })()}
{check.id==="change_detection"&&tx&&<PistasCambio tx={tx} pistas={check.pistas}/>}
{check.id==="coinjoin"&&bz&&bz.completo&&(
<div style={{marginTop:6,fontSize:"0.66rem",color:C.t2,lineHeight:1.6}}>Contando solo los importes (entropía de Boltzmann): {resumenBoltzmann(bz).titulo.replace(/^Esta transacción admite /,"")}.</div>
<div style={{marginTop:6,fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>Contando solo los importes (entropía de Boltzmann): {resumenBoltzmann(bz).titulo.replace(/^Esta transacción admite /,"")}.</div>
)}
{/* Lo heredado no resta de la nota: antes enseñaba «Peso en la
banda: alto» en el pago por lotes, que no cuenta desde la
v1.17. Los cortes van sobre los pesos propios (máx. 30). */}
{!check.informational&&!check.pass&&check.heredado&&(
<div style={{marginTop:6,fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>
<div style={{marginTop:6,fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>
No resta de la nota: lo decidió otro
</div>
)}
{!check.informational&&!check.pass&&!check.heredado&&check.penalty>0&&(
<div style={{marginTop:6,fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>
<div style={{marginTop:6,fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>
Cuánto resta de la nota: {check.penalty>=20?"mucho":check.penalty>=10?"algo":"poco"}
</div>
)}
{check.didactic&&(
<div style={{marginTop:8}}>
<button onClick={e=>{e.stopPropagation();setShowDidactic(showDidactic===check.id?null:check.id);}}
style={{background:"none",border:`1px solid ${C.purple}40`,borderRadius:4,padding:"3px 8px",color:C.purple,fontFamily:C.mono,fontSize:"0.62rem",cursor:"pointer"}}>
style={{background:"none",border:`1px solid ${C.purple}40`,borderRadius:4,padding:"3px 8px",color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>
{showDidactic===check.id?"▲ ocultar":"▼ ¿qué significa esto?"}
</button>
{showDidactic===check.id&&(
<div style={{marginTop:8,padding:"10px 12px",background:C.purpleMuted,borderRadius:6,border:`1px solid ${C.purple}20`,fontSize:"0.68rem",color:C.t1,lineHeight:1.7}}>
<div style={{marginTop:8,padding:"10px 12px",background:C.purpleMuted,borderRadius:6,border:`1px solid ${C.purple}20`,fontSize:"0.82rem",color:C.t1,lineHeight:1.7}}>
{check.didactic}
</div>
)}
@@ -580,38 +580,38 @@
return (
<div style={{marginTop:8}}>
<div style={{display:"flex",alignItems:"center",gap:8,marginBottom:14,paddingTop:14,borderTop:`1px solid ${C.border}`}}>
<span style={{fontSize:"0.65rem",fontFamily:C.mono,color:C.purple,textTransform:"uppercase",letterSpacing:"0.2em",fontWeight:700}}>Privacidad</span>
<span style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.purple,textTransform:"uppercase",letterSpacing:"0.2em",fontWeight:700}}>Privacidad</span>
<div style={{flex:1,height:1,background:`linear-gradient(to right,${C.purple}40,transparent)`}}/>
{simulada&&<span style={{fontSize:"0.6rem",fontFamily:C.mono,color:C.amber,fontWeight:700,letterSpacing:"0.08em"}}>SIMULACIÓN · no es una transacción real</span>}
{simulada&&<span style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.amber,fontWeight:700,letterSpacing:"0.08em"}}>SIMULACIÓN · no es una transacción real</span>}
{!simulada&&<button onClick={exportJSON} title="Descargar el informe en JSON (se genera en tu navegador; no se envía a ningún sitio)"
style={{padding:"4px 10px",background:C.bg,border:`1px solid ${C.purple}40`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.6rem",letterSpacing:"0.08em",cursor:"pointer",whiteSpace:"nowrap"}}
style={{padding:"4px 10px",background:C.bg,border:`1px solid ${C.purple}40`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",letterSpacing:"0.08em",cursor:"pointer",whiteSpace:"nowrap"}}
onMouseEnter={e=>e.currentTarget.style.borderColor=C.purple}
onMouseLeave={e=>e.currentTarget.style.borderColor=C.purple+"40"}>
↓ JSON
</button>}
{!simulada&&<button onClick={exportMarkdown} title="Descargar el informe en Markdown (se genera en tu navegador; no se envía a ningún sitio)"
style={{padding:"4px 10px",background:C.bg,border:`1px solid ${C.purple}40`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.6rem",letterSpacing:"0.08em",cursor:"pointer",whiteSpace:"nowrap"}}
style={{padding:"4px 10px",background:C.bg,border:`1px solid ${C.purple}40`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",letterSpacing:"0.08em",cursor:"pointer",whiteSpace:"nowrap"}}
onMouseEnter={e=>e.currentTarget.style.borderColor=C.purple}
onMouseLeave={e=>e.currentTarget.style.borderColor=C.purple+"40"}>
↓ MD
</button>}
{!simulada&&tx&&<button onClick={()=>tarjeta?setTarjeta(null):hacerTarjeta(false)} title="Una imagen para enseñarla en un taller: sin IP, sin nombre del nodo, sin direcciones ni importes"
style={{padding:"4px 10px",background:C.bg,border:`1px solid ${C.purple}40`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.6rem",letterSpacing:"0.08em",cursor:"pointer",whiteSpace:"nowrap"}}>
style={{padding:"4px 10px",background:C.bg,border:`1px solid ${C.purple}40`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",letterSpacing:"0.08em",cursor:"pointer",whiteSpace:"nowrap"}}>
▣ TARJETA
</button>}
</div>
{tarjeta&&(
<div style={{marginBottom:12,padding:10,background:C.bgCard,border:`1px solid ${C.purple}40`,borderRadius:6,display:"flex",flexDirection:"column",gap:8}}>
{tarjeta.error
? <div style={{fontSize:"0.68rem",color:C.amber}}>No se pudo dibujar la tarjeta en este navegador.</div>
? <div style={{fontSize:"0.69rem",color:C.amber}}>No se pudo dibujar la tarjeta en este navegador.</div>
: <img src={tarjeta.url} alt="Tarjeta del informe" style={{width:"100%",maxWidth:600,borderRadius:4,border:`1px solid ${C.border}`}}/>}
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>Se dibuja en tu navegador. Lleva la nota y lo más importante; no lleva la IP ni el nombre de tu nodo, ni direcciones, ni importes.</div>
<label style={{fontSize:"0.66rem",color:C.t1,fontFamily:C.mono,display:"flex",gap:6,alignItems:"center",cursor:"pointer"}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Se dibuja en tu navegador. Lleva la nota y lo más importante; no lleva la IP ni el nombre de tu nodo, ni direcciones, ni importes.</div>
<label style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono,display:"flex",gap:6,alignItems:"center",cursor:"pointer"}}>
<input type="checkbox" checked={tarjeta.conTxid} onChange={e=>hacerTarjeta(e.target.checked)}/> Incluir el txid (abreviado)
</label>
<div style={{display:"flex",gap:8}}>
{!tarjeta.error&&<button onClick={bajarTarjeta} style={{padding:"6px 12px",background:"none",border:`1px solid ${C.purple}`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer"}}>↓ Descargar PNG</button>}
<button onClick={()=>setTarjeta(null)} style={{padding:"6px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:5,color:C.t2,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer"}}>Cerrar</button>
{!tarjeta.error&&<button onClick={bajarTarjeta} style={{padding:"6px 12px",background:"none",border:`1px solid ${C.purple}`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>↓ Descargar PNG</button>}
<button onClick={()=>setTarjeta(null)} style={{padding:"6px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:5,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>Cerrar</button>
</div>
</div>
)}
@@ -623,7 +623,7 @@
{cabecera}
</div>
<div style={{fontSize:"1rem",color:summaryColor,fontFamily:C.mono,fontWeight:700,marginBottom:4}}>{summary}</div>
<div style={{fontSize:"0.65rem",color:C.t2,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>
{analysis.sinHistorial
? "Tu nodo da su saldo pero no sus transacciones, así que no se puede analizar. No es una dirección sin usar: suele ser de un exchange o servicio con muchísimo historial."
: analysis.unused
@@ -633,7 +633,7 @@
: fraseBanda(analysis, "dirección")}
</div>
{tx&&analysis.rol&&(
<div style={{marginTop:6,fontSize:"0.62rem",color:analysis.rol.papel==="desconocido"?C.t3:C.t2,fontFamily:C.mono}}>
<div style={{marginTop:6,fontSize:"0.69rem",color:analysis.rol.papel==="desconocido"?C.t3:C.t2,fontFamily:C.mono}}>
{simulada ? `Tu papel: enviarías (${analysis.rol.entradasPropias} entrada${analysis.rol.entradasPropias>1?"s":""} de tu wallet)`
: analysis.rol.declarado ? `Tu papel: ${analysis.rol.papel==="envias"?"la enviaste tú":"la recibiste tú"} (lo has indicado tú; la app no lo comprueba)`
: analysis.rol.papel==="envias" ? `Tu papel: envías (${analysis.rol.entradasPropias} entrada${analysis.rol.entradasPropias>1?"s":""} de tu wallet)`
@@ -644,12 +644,12 @@
{!simulada&&onPapel&&(analysis.rol.papel==="desconocido"||analysis.rol.declarado)&&(
<div style={{display:"flex",gap:6,flexWrap:"wrap",marginTop:6}}>
{[["mira","Solo miro"],["envias","La envié yo"],["recibes","La recibí yo"]].map(([v,t])=>{ const on=(papelManual||"mira")===v; return (
<button key={v} onClick={()=>onPapel(v)} style={{padding:"3px 10px",borderRadius:12,border:`1px solid ${on?C.purple:C.border}`,background:on?C.purpleMuted:"none",color:on?C.purple:C.t2,fontFamily:C.mono,fontSize:"0.6rem",cursor:"pointer"}}>{t}</button>); })}
<button key={v} onClick={()=>onPapel(v)} style={{padding:"3px 10px",borderRadius:12,border:`1px solid ${on?C.purple:C.border}`,background:on?C.purpleMuted:"none",color:on?C.purple:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>{t}</button>); })}
</div>)}
</div>
)}
{wallets&&wallets.length>0&&(
<div style={{marginTop:6,fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>
<div style={{marginTop:6,fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>
{textoWallet(wallets,true)}
</div>
)}
@@ -660,13 +660,13 @@
que no baja una nota que no podrías subir. */}
{analysis.exposicion && (
<div style={{marginTop:10,paddingTop:8,borderTop:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,marginBottom:3}}>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:3}}>
LO QUE DECIDIERON OTROS
<span style={{marginLeft:6,color: analysis.exposicion.nivel==="ninguna"?C.green:analysis.exposicion.nivel==="alta"?C.red:C.amber}}>
exposición {analysis.exposicion.nivel}
</span>
</div>
<div style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>
{analysis.exposicion.items.length === 0
? "Ninguna señal de esta transacción viene de decisiones de quien pagó o de un tercero."
: <>{aQuien}, pero {quienDecidio}: <span style={{color:C.amber}}>{analysis.exposicion.items.map(i=>i.label).join(" · ")}</span>. No resta de la nota, que mide cómo cuidó quien firmó su propia privacidad.</>}
@@ -680,17 +680,17 @@
{/* Lo más importante, en lenguaje llano (v1.31) */}
{!analysis.unused&&!analysis.sinHistorial&&(()=>{ const lm = loMasImportante(analysis, tx ? "transacción" : "dirección"); return (
<div style={{marginBottom:10,padding:"12px 14px",background:C.bgCard,border:`1px solid ${C.borderBright}`,borderRadius:8}}>
<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,letterSpacing:"0.15em",fontWeight:700,marginBottom:8}}>LO MÁS IMPORTANTE</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,letterSpacing:"0.15em",fontWeight:700,marginBottom:8}}>LO MÁS IMPORTANTE</div>
{lm.nada
? <div style={{fontSize:"0.74rem",color:C.t1,lineHeight:1.6}}>{lm.nada}</div>
? <div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>{lm.nada}</div>
: lm.items.map((it,i)=>(
<div key={i} style={{display:"flex",gap:8,alignItems:"flex-start",marginBottom:i<lm.items.length-1?8:0}}>
<span style={{color:C.amber,fontWeight:700,fontSize:"0.8rem",lineHeight:1.4}}>✗</span>
{/* v1.49.2 (IN-10): la certeza delante, no un «(posible)» al final. */}
<span style={{fontSize:"0.74rem",color:C.t1,lineHeight:1.6,flex:1}}><span style={{marginRight:6}}><CertaintyBadge level={it.certeza}/></span>{it.texto}</span>
<span style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6,flex:1}}><span style={{marginRight:6}}><CertaintyBadge level={it.certeza}/></span>{it.texto}</span>
</div>))}
{lm.resto>0&&<div style={{marginTop:8,fontSize:"0.64rem",color:C.t2}}>Y {lm.resto} {lm.resto===1?"señal más":"señales más"} en la lista de abajo.</div>}
{lm.otros.length>0&&<div style={{marginTop:8,fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>Además, {aQuien.charAt(0).toLowerCase()+aQuien.slice(1)} algo que decidió otro: {lm.otros.join(" · ")}.</div>}
{lm.resto>0&&<div style={{marginTop:8,fontSize:"0.69rem",color:C.t2}}>Y {lm.resto} {lm.resto===1?"señal más":"señales más"} en la lista de abajo.</div>}
{lm.otros.length>0&&<div style={{marginTop:8,fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Además, {aQuien.charAt(0).toLowerCase()+aQuien.slice(1)} algo que decidió otro: {lm.otros.join(" · ")}.</div>}
</div>); })()}
{/* Flujo de la transacción (v1.47.0): arriba de las señales. */}
@@ -701,7 +701,7 @@
<button onClick={()=>setShowReport(!showReport)} style={{
width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",
padding:"10px 14px",background:C.bgCard,border:`1px solid ${showReport?C.purple+"60":C.border}`,
borderRadius:6,cursor:"pointer",color:C.purple,fontFamily:C.mono,fontSize:"0.68rem",fontWeight:700,
borderRadius:6,cursor:"pointer",color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",fontWeight:700,
letterSpacing:"0.1em",textTransform:"uppercase",
}}>
<span>⌖ Informe de privacidad</span>
@@ -711,11 +711,11 @@
<div style={{background:C.bgCard,border:`1px solid ${C.purple}30`,borderTop:"none",borderRadius:"0 0 6px 6px",padding:"14px 16px"}}>
{report.map((section,i) => (
<div key={i} style={{marginBottom: i<report.length-1?16:0}}>
<div style={{fontSize:"0.6rem",color:C.purple,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.15em",marginBottom:6,fontWeight:700}}>
<div style={{fontSize:"0.69rem",color:C.purple,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.15em",marginBottom:6,fontWeight:700}}>
{section.title}
</div>
{section.text&&(
<div style={{fontSize:"0.7rem",color:C.t1,lineHeight:1.8}}>{section.text}</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.8}}>{section.text}</div>
)}
{section.recs&&(
<div style={{display:"flex",flexDirection:"column",gap:8}}>
@@ -724,7 +724,7 @@
<div style={{display:"flex",alignItems:"center",gap:8,marginBottom:5}}>
<span style={{fontSize:"0.72rem",color:C.t2,fontFamily:C.mono,fontWeight:700}}>·</span>
<span style={{fontSize:"0.7rem",color:C.t1,fontWeight:600,flex:1}}>{rec.action}</span>
<span style={{fontSize:"0.55rem",fontFamily:C.mono,padding:"2px 6px",borderRadius:3,flexShrink:0,
<span style={{fontSize:"0.69rem",fontFamily:C.mono,padding:"2px 6px",borderRadius:3,flexShrink:0,
background: rec.tag==="wallet"?C.purpleMuted:rec.tag==="no_corregible"?C.redMuted:C.amberMuted,
color: rec.tag==="wallet"?C.purple:rec.tag==="no_corregible"?C.red:C.amber,
border: `1px solid ${rec.tag==="wallet"?C.purple:rec.tag==="no_corregible"?C.red:C.amber}30`,
@@ -732,7 +732,7 @@
{actionLabel(rec.tag)}
</span>
</div>
<div style={{fontSize:"0.65rem",color:C.t2,lineHeight:1.6,paddingLeft:18}}>{rec.why}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6,paddingLeft:18}}>{rec.why}</div>
</div>
))}
</div>
@@ -758,15 +758,15 @@
<div style={{display:"flex",flexDirection:"column",gap:6}}>
{/* Leyenda arriba y plegada: antes eran seis etiquetas al final. */}
<div>
<button onClick={()=>setVerLeyenda(v=>!v)} style={{background:"none",border:"none",padding:"4px 0",color:C.purple,fontFamily:C.mono,fontSize:"0.66rem",cursor:"pointer",minHeight:isMobile?40:undefined}}>
<button onClick={()=>setVerLeyenda(v=>!v)} style={{background:"none",border:"none",padding:"4px 0",color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",minHeight:isMobile?40:undefined}}>
{verLeyenda?"▲":"▼"} ¿Qué significan las etiquetas?
</button>
{verLeyenda&&(
<div style={{display:"flex",flexDirection:"column",gap:6,padding:"8px 10px",border:`1px solid ${C.border}`,borderRadius:6,marginTop:4}}>
{[{label:"CERTEZA",desc:"Se ve en la cadena, o se sigue de ella sin otra explicación"},{label:"PROBABLE",desc:"Lo que cualquier analista da por hecho, aunque tiene excepciones conocidas"},{label:"POSIBLE",desc:"Pista débil: encaja, pero hay otras explicaciones"},{label:null,desc:"Faltan datos para decir nada"}].map(l=>(
<div key={l.label||"sin"} style={{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}}><CertaintyBadge level={l.label}/><span style={{fontSize:"0.64rem",color:C.t2}}>{l.desc}</span></div>
<div key={l.label||"sin"} style={{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}}><CertaintyBadge level={l.label}/><span style={{fontSize:"0.69rem",color:C.t2}}>{l.desc}</span></div>
))}
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.5,marginTop:2}}>La certeza dice cuánto se sabe, no si algo es bueno o malo. Dentro de cada señal se separa lo que <strong style={{color:C.t1}}>se ve en la cadena</strong> de lo que <strong style={{color:C.t1}}>se deduce</strong>; la etiqueta es la certeza de lo que se deduce. Las señales a revisar se agrupan por quién lo decidió: <strong style={{color:C.t1}}>quien firma</strong> (qué monedas se gastan y a dónde), <strong style={{color:C.t1}}>el monedero</strong> (el programa con el que se firma) o <strong style={{color:C.t1}}>otro</strong> (quien pagó o un tercero): ya quedó en la cadena.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5,marginTop:2}}>La certeza dice cuánto se sabe, no si algo es bueno o malo. Dentro de cada señal se separa lo que <strong style={{color:C.t1}}>se ve en la cadena</strong> de lo que <strong style={{color:C.t1}}>se deduce</strong>; la etiqueta es la certeza de lo que se deduce. Las señales a revisar se agrupan por quién lo decidió: <strong style={{color:C.t1}}>quien firma</strong> (qué monedas se gastan y a dónde), <strong style={{color:C.t1}}>el monedero</strong> (el programa con el que se firma) o <strong style={{color:C.t1}}>otro</strong> (quien pagó o un tercero): ya quedó en la cadena.</div>
</div>
)}
</div>
@@ -775,8 +775,8 @@
{problems.length>0
? <span style={{fontSize:"0.7rem",color:C.red,fontFamily:C.mono,fontWeight:700}}>✗ {problems.length} {problems.length===1?"señal a revisar":"señales a revisar"}</span>
: <span style={{fontSize:"0.7rem",color:C.green,fontFamily:C.mono,fontWeight:700}}>✓ Sin señales que revisar</span>}
<span style={{fontSize:"0.66rem",color:C.t2,fontFamily:C.mono}}>✓ {oks.length} sin problema</span>
{infos.length>0&&<span style={{fontSize:"0.66rem",color:C.t2,fontFamily:C.mono}}>· {infos.length} informativos</span>}
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>✓ {oks.length} sin problema</span>
{infos.length>0&&<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>· {infos.length} informativos</span>}
</div>
{/* Problemas: siempre visibles, lo primero, agrupados por quién lo
@@ -786,7 +786,7 @@
if (!grupo.length) return null;
return (
<div key={a} style={{display:"flex",flexDirection:"column",gap:6}}>
<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginTop:4}}>{t} <span style={{textTransform:"none",letterSpacing:0,color:C.t3}}>· {actionText(a)}</span></div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginTop:4}}>{t} <span style={{textTransform:"none",letterSpacing:0,color:C.t3}}>· {actionText(a)}</span></div>
{grupo.map(c => renderCheck(c, true))}
</div>
);
@@ -840,13 +840,13 @@
function TarjetaBoltzmann({tx, abierta, setAbierta, resultado, contando, esCoinjoin}) {
const r = resultado, res = resumenBoltzmann(r);
const det = new Set(r && r.completo ? r.enlacesDeterministas.map(([i,j]) => i+":"+j) : []);
const celda = {padding:"3px 6px",fontFamily:C.mono,fontSize:"0.6rem",textAlign:"right",borderBottom:`1px solid ${C.border}`,whiteSpace:"nowrap"};
const celda = {padding:"3px 6px",fontFamily:C.mono,fontSize:"0.69rem",textAlign:"right",borderBottom:`1px solid ${C.border}`,whiteSpace:"nowrap"};
return (
<div style={{marginBottom:10}}>
<button onClick={()=>setAbierta(!abierta)} style={{
width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",
padding:"10px 14px",background:C.bgCard,border:`1px solid ${abierta?C.blue+"60":C.border}`,
borderRadius:6,cursor:"pointer",color:C.blue,fontFamily:C.mono,fontSize:"0.68rem",fontWeight:700,
borderRadius:6,cursor:"pointer",color:C.blue,fontFamily:C.mono,fontSize:"0.69rem",fontWeight:700,
letterSpacing:"0.1em",textTransform:"uppercase",textAlign:"left",
}}>
<span>Interpretaciones posibles (entropía de Boltzmann)</span>
@@ -856,7 +856,7 @@
<div style={{background:C.bgCard,border:`1px solid ${C.blue}30`,borderTop:"none",borderRadius:"0 0 6px 6px",padding:"12px 14px"}}>
{contando||!r ? <div style={{fontSize:"0.7rem",color:C.t2,fontFamily:C.mono}}>Contando…</div> : (<>
<div style={{fontSize:"0.78rem",color:C.t1,fontWeight:700,marginBottom:6}}>{res.titulo}</div>
<div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6,marginBottom:8}}>{res.detalle}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6,marginBottom:8}}>{res.detalle}</div>
{r.completo&&r.interpretaciones>1&&(
<div style={{overflowX:"auto",marginBottom:8}}>
<table style={{borderCollapse:"collapse"}}>
@@ -874,7 +874,7 @@
</table>
</div>
)}
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.6}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>
Cada interpretación es una forma de partir la transacción en pagos más pequeños (unas entradas pagan unas salidas) en la que todos los importes cuadran. Cuantas más haya, menos dicen los importes sobre quién pagó a quién; los bits son el logaritmo en base 2 de ese número.{r.completo&&r.interpretaciones>1&&<> La tabla da, para cada entrada y cada salida, en qué parte de esas lecturas van juntas; un 100 % <span style={{color:C.amber}}>resaltado</span> es un enlace que se cumple en todas.</>} Solo mira esta transacción: no usa el historial de las monedas ni etiquetas, y quien conozca algo más puede descartar lecturas.
{r.salidasIgnoradas>0&&` No se cuentan ${r.salidasIgnoradas===1?"una salida":fmtEnt(r.salidasIgnoradas)+" salidas"} sin importe o sin dirección (OP_RETURN), que no son de nadie.`}
{esCoinjoin&&r.completo&&" El analizador ve forma de CoinJoin: esta cifra mide cuánto confunde, contando solo con los importes."}
+10 -10
View File
@@ -31,7 +31,7 @@
<>
<button type="button" onClick={() => setAbierto(true)} title="Leer un QR con la cámara" aria-label="Leer un QR con la cámara"
style={{ padding: "0 12px", minWidth: 42, background: C.bg, border: `1px solid ${col}40`, borderRadius: 6, color: col, fontSize: "1rem", cursor: "pointer", flexShrink: 0 }}>
⌗<span style={{ fontFamily: C.mono, fontSize: "0.6rem", marginLeft: 4 }}>QR</span>
⌗<span style={{ fontFamily: C.mono, fontSize: "0.69rem", marginLeft: 4 }}>QR</span>
</button>
{abierto && <LectorQR campo={campo} onCerrar={() => setAbierto(false)} onUsar={v => { setAbierto(false); onLeido(v); }} />}
</>
@@ -178,42 +178,42 @@
{fase === "cargando" && <div style={{ position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", color: C.t2, fontFamily: C.mono, fontSize: "0.7rem" }}>abriendo la cámara…</div>}
</div>
)}
{fase === "camara" && !progreso && <div style={{ fontSize: "0.66rem", color: C.t2, lineHeight: 1.5 }}>Apunta al QR. Si es animado (una PSBT, la xpub de SeedSigner), mantenlo delante hasta que se complete. La imagen no sale de este aparato.</div>}
{fase === "camara" && !progreso && <div style={{ fontSize: "0.82rem", color: C.t2, lineHeight: 1.5 }}>Apunta al QR. Si es animado (una PSBT, la xpub de SeedSigner), mantenlo delante hasta que se complete. La imagen no sale de este aparato.</div>}
{fase === "camara" && progreso && (
<div role="status" aria-live="polite">
<div style={{ display: "flex", justifyContent: "space-between", fontFamily: C.mono, fontSize: "0.64rem", color: C.t1, marginBottom: 5 }}>
<div style={{ display: "flex", justifyContent: "space-between", fontFamily: C.mono, fontSize: "0.69rem", color: C.t1, marginBottom: 5 }}>
<span>QR animado ({progreso.formato === "ur" ? "UR" : progreso.formato === "bbqr" ? "BBQr" : "Specter"})</span>
<span>{progreso.hechos} de {progreso.total} trozos</span>
</div>
<div style={{ height: 6, background: C.bg, borderRadius: 3, overflow: "hidden", border: `1px solid ${C.border}` }}>
<div style={{ width: `${Math.round(100 * progreso.hechos / progreso.total)}%`, height: "100%", background: C.green, transition: "width 0.2s" }} />
</div>
<div style={{ fontSize: "0.62rem", color: C.t2, marginTop: 5, lineHeight: 1.5 }}>Mantén el QR delante. No hace falta leerlos en orden{progreso.formato === "ur" ? ", y si se escapa alguno, los siguientes lo reponen" : ""}.</div>
<div style={{ fontSize: "0.82rem", color: C.t2, marginTop: 5, lineHeight: 1.5 }}>Mantén el QR delante. No hace falta leerlos en orden{progreso.formato === "ur" ? ", y si se escapa alguno, los siguientes lo reponen" : ""}.</div>
</div>
)}
{fase === "sin-lector" && (
<div style={{ fontSize: "0.7rem", color: C.amber, lineHeight: 1.6 }}>
<div style={{ fontSize: "0.82rem", color: C.amber, lineHeight: 1.6 }}>
Falta el lector de QR en el nodo: la carpeta <span style={{ fontFamily: C.mono }}>vendor/qr/</span>. Se instala con el paso 2 de SETUP.md.
</div>
)}
{fase === "secreto" && (
<div style={{ padding: "12px 14px", background: C.redMuted, border: `1px solid ${C.red}60`, borderRadius: 8, fontSize: "0.72rem", color: C.t1, lineHeight: 1.6 }}>
<div style={{ padding: "12px 14px", background: C.redMuted, border: `1px solid ${C.red}60`, borderRadius: 8, fontSize: "0.82rem", color: C.t1, lineHeight: 1.6 }}>
<strong style={{ color: C.red }}>Esto parece una semilla o una clave privada.</strong> Txoko no la necesita nunca, así que no la muestra ni la guarda: ya la ha olvidado. Guarda esa tarjeta y asegúrate de que no la ha visto nadie.
</div>
)}
{(fase === "leido" || fase === "otro") && leido && (
<div style={{ padding: "10px 12px", background: C.bg, border: `1px solid ${fase === "leido" ? C.green : C.amber}60`, borderRadius: 8 }}>
<div style={{ fontSize: "0.6rem", color: C.t2, fontFamily: C.mono, marginBottom: 4 }}>HE LEÍDO {(QR_NOMBRE[leido.tipo] || "").toUpperCase()}</div>
<div style={{ fontSize: "0.69rem", color: C.t2, fontFamily: C.mono, marginBottom: 4 }}>HE LEÍDO {(QR_NOMBRE[leido.tipo] || "").toUpperCase()}</div>
{leido.valor && <div style={{ fontFamily: C.mono, fontSize: "0.72rem", color: C.t1, wordBreak: "break-all" }}>{resumenQR(leido)}</div>}
{leido.tipo === "xpub" && leido.script && <div style={{ fontSize: "0.64rem", color: C.t2, marginTop: 4, lineHeight: 1.5 }}>Cuenta de direcciones {TIPO_SCRIPT[leido.script]}{leido.porRuta ? " (por la ruta de su origen, 86: la de Taproot)" : ""}{leido.otras ? ` (el QR traía ${leido.otras + 1} tipos; se usa este)` : ""}.{leido.sinPadre ? " El QR no traía la huella de la clave madre: la clave puede verse distinta de la de tu monedero, pero da las mismas direcciones." : ""}</div>}
{leido.importe && <div style={{ fontSize: "0.64rem", color: C.t2, marginTop: 4 }}>El QR pedía un pago de {leido.importe} BTC{leido.etiqueta ? ` («${leido.etiqueta}»)` : ""}. Txoko solo usa la dirección.</div>}
{leido.tipo === "xpub" && leido.script && <div style={{ fontSize: "0.82rem", color: C.t2, marginTop: 4, lineHeight: 1.5 }}>Cuenta de direcciones {TIPO_SCRIPT[leido.script]}{leido.porRuta ? " (por la ruta de su origen, 86: la de Taproot)" : ""}{leido.otras ? ` (el QR traía ${leido.otras + 1} tipos; se usa este)` : ""}.{leido.sinPadre ? " El QR no traía la huella de la clave madre: la clave puede verse distinta de la de tu monedero, pero da las mismas direcciones." : ""}</div>}
{leido.importe && <div style={{ fontSize: "0.69rem", color: C.t2, marginTop: 4 }}>El QR pedía un pago de {leido.importe} BTC{leido.etiqueta ? ` («${leido.etiqueta}»)` : ""}. Txoko solo usa la dirección.</div>}
</div>
)}
{aviso && <div style={{ fontSize: "0.68rem", color: fase === "otro" ? C.amber : C.t2, lineHeight: 1.6 }}>{aviso}</div>}
{aviso && <div style={{ fontSize: "0.82rem", color: fase === "otro" ? C.amber : C.t2, lineHeight: 1.6 }}>{aviso}</div>}
<div style={{ display: "flex", gap: 8, flexWrap: "wrap" }}>
{fase === "leido" && boton("Usar esto", () => onUsar(leido.valor), C.green, true)}
+30 -30
View File
@@ -37,7 +37,7 @@
const gris = (v, c) => v == null ? C.t2 : c;
const faltaAlgo = !!base && [fees,mempool,height,diff].some(x => x == null);
const SinMetricas = ({que}) => (
<div data-sin-datos={que} style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6}}>
<div data-sin-datos={que} style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>
<span style={{fontFamily:C.mono,color:C.t2,marginRight:6}}>—</span>
El servicio de métricas (txoko-metrics) no contesta: no hay datos de {que} que enseñar. La app no los rellena con ejemplos.
</div>);
@@ -62,18 +62,18 @@
<Tag label="Tarifa mínima" value={raya(fees, f=>`${f.minimumFee} sat/vB`)} color={gris(fees, C.blue)}/>
<Tag label="Próximo ajuste" value={raya(diff, d=>`${d.remainingBlocks} bloques`)} color={gris(diff, C.t1)}/>
</div>
{faltaAlgo&&<div data-sin-datos="cadena" style={{marginTop:10,fontSize:"0.66rem",color:C.t2,lineHeight:1.5}}>Una raya (—) es un dato que tu nodo no ha dado. No se rellena con ejemplos.</div>}
{faltaAlgo&&<div data-sin-datos="cadena" style={{marginTop:10,fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Una raya (—) es un dato que tu nodo no ha dado. No se rellena con ejemplos.</div>}
</Card>
{/* Las comisiones se ven una sola vez, abajo (vista de la cadena). */}
{/* Bitcoin Core */}
<Card>
<div style={{fontSize:"0.62rem",color:C.amber,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:12,display:"flex",alignItems:"center",gap:8}}>
<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:12,display:"flex",alignItems:"center",gap:8}}>
<IconoBtc/> Bitcoin Core {salud.sinDatos("/system/bitcoin")&&<Badge color={C.amber}>SIN DATOS · txoko-metrics no contesta</Badge>}
<div style={{flex:1,height:1,background:`linear-gradient(to right,${C.amber}40,transparent)`}}/>
</div>
{RED.sinSistema ? <div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6}}>No disponible en signet: estos datos (versión, conexiones, disco) son de tu nodo de mainnet; vuelve a Mainnet para verlos.</div> : (!btcData&&salud.sinDatos("/system/bitcoin")) ? <SinMetricas que="Bitcoin Core"/> : !btcData ? <Spinner/> : (
{RED.sinSistema ? <div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>No disponible en signet: estos datos (versión, conexiones, disco) son de tu nodo de mainnet; vuelve a Mainnet para verlos.</div> : (!btcData&&salud.sinDatos("/system/bitcoin")) ? <SinMetricas que="Bitcoin Core"/> : !btcData ? <Spinner/> : (
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(130px,1fr))",gap:14}}>
<Tag label="Versión" value={btcData.version?.replace(/[/:]/g,"").replace("Satoshi","").trim()} color={C.green}/>
<Tag label="Red" value={btcData.chain==="main"?"mainnet":btcData.chain} color={C.green}/>
@@ -89,16 +89,16 @@
{/* Sistema */}
<Card>
<div style={{fontSize:"0.62rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:12,display:"flex",alignItems:"center",gap:8}}>
<div style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:12,display:"flex",alignItems:"center",gap:8}}>
<span>⬡</span> Sistema {salud.sinDatos("/system/info")&&<Badge color={C.amber}>SIN DATOS · txoko-metrics no contesta</Badge>}
<div style={{flex:1,height:1,background:`linear-gradient(to right,${C.blue}40,transparent)`}}/>
</div>
{RED.sinSistema ? <div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6}}>No disponible en signet: vuelve a Mainnet para ver CPU, memoria y disco.</div> : (!sysData&&salud.sinDatos("/system/info")) ? <SinMetricas que="la máquina (CPU, memoria, disco)"/> : !sysData ? <Spinner/> : (
{RED.sinSistema ? <div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>No disponible en signet: vuelve a Mainnet para ver CPU, memoria y disco.</div> : (!sysData&&salud.sinDatos("/system/info")) ? <SinMetricas que="la máquina (CPU, memoria, disco)"/> : !sysData ? <Spinner/> : (
<div style={{display:"flex",flexDirection:"column",gap:12}}>
{/* CPU */}
<div>
<div style={{display:"flex",justifyContent:"space-between",marginBottom:6}}>
<span style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>CPU — {sysData.cpu.model||""}</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>CPU — {sysData.cpu.model||""}</span>
<span style={{fontSize:"0.72rem",color:C.green,fontFamily:C.mono,fontWeight:600}}>{sysData.cpu.usage} % de media{sysData.cpu.temp?` · ${sysData.cpu.temp} °C`:""}</span>
</div>
{/* Per-core bars */}
@@ -109,7 +109,7 @@
<div style={{height:28,background:C.border,borderRadius:4,overflow:"hidden",position:"relative"}}>
<div style={{position:"absolute",bottom:0,left:0,right:0,height:`${c.usage}%`,background:`linear-gradient(to top,${c.usage>80?C.red:c.usage>60?C.amber:C.green}80,${c.usage>80?C.red:c.usage>60?C.amber:C.green})`,transition:"height 0.5s"}}/>
</div>
<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,textAlign:"center",marginTop:2}}>{c.usage}%</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textAlign:"center",marginTop:2}}>{c.usage}%</div>
</div>
))}
</div>
@@ -124,37 +124,37 @@
<div style={{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12}}>
<div>
<div style={{display:"flex",justifyContent:"space-between",marginBottom:3}}>
<span style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>RAM</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>RAM</span>
<span style={{fontSize:"0.72rem",color:sysData.ram.percent>80?C.red:sysData.ram.percent>60?C.amber:C.green,fontFamily:C.mono,fontWeight:600}}>{sysData.ram.percent}%</span>
</div>
<div style={{height:6,background:C.border,borderRadius:3,overflow:"hidden",marginBottom:4}}>
<div style={{width:`${sysData.ram.percent}%`,height:"100%",background:sysData.ram.percent>80?C.red:sysData.ram.percent>60?C.amber:C.green,borderRadius:3}}/>
</div>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{fmtDec(sysData.ram.used_gb, 1)} / {fmtDec(sysData.ram.total_gb, 1)} GB</div>
{sysData.ram.cached_gb&&<div style={{fontSize:"0.58rem",color:C.t3,fontFamily:C.mono}}>caché: {sysData.ram.cached_gb} GB</div>}
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{fmtDec(sysData.ram.used_gb, 1)} / {fmtDec(sysData.ram.total_gb, 1)} GB</div>
{sysData.ram.cached_gb&&<div style={{fontSize:"0.69rem",color:C.t3,fontFamily:C.mono}}>caché: {sysData.ram.cached_gb} GB</div>}
</div>
<div>
<div style={{display:"flex",justifyContent:"space-between",marginBottom:3}}>
<span style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>SWAP</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>SWAP</span>
<span style={{fontSize:"0.72rem",color:sysData.ram.swap_percent>80?C.red:sysData.ram.swap_percent>50?C.amber:C.t2,fontFamily:C.mono,fontWeight:600}}>{sysData.ram.swap_percent||0}%</span>
</div>
<div style={{height:6,background:C.border,borderRadius:3,overflow:"hidden",marginBottom:4}}>
<div style={{width:`${sysData.ram.swap_percent||0}%`,height:"100%",background:sysData.ram.swap_percent>80?C.red:C.amber,borderRadius:3}}/>
</div>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{fmtDec(sysData.ram.swap_used_gb||0, 1)} / {fmtDec(sysData.ram.swap_total_gb||0, 1)} GB</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{fmtDec(sysData.ram.swap_used_gb||0, 1)} / {fmtDec(sysData.ram.swap_total_gb||0, 1)} GB</div>
</div>
</div>
{/* Disco */}
<div>
<div style={{display:"flex",justifyContent:"space-between",marginBottom:3}}>
<span style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>Disco</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>Disco</span>
<span style={{fontSize:"0.72rem",color:parseInt(sysData.disk?.percent)>80?C.red:parseInt(sysData.disk?.percent)>60?C.amber:C.green,fontFamily:C.mono,fontWeight:600}}>{sysData.disk?.percent}</span>
</div>
<div style={{height:6,background:C.border,borderRadius:3,overflow:"hidden",marginBottom:4}}>
<div style={{width:`${parseInt(sysData.disk?.percent)||0}%`,height:"100%",background:parseInt(sysData.disk?.percent)>80?C.red:parseInt(sysData.disk?.percent)>60?C.amber:C.green,borderRadius:3}}/>
</div>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{sysData.disk?.used} / {sysData.disk?.total}</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{sysData.disk?.used} / {sysData.disk?.total}</div>
</div>
{/* Load + Uptime */}
@@ -168,7 +168,7 @@
{/* Top processes */}
{sysData.processes&&sysData.processes.length>0&&(
<div style={{paddingTop:10,borderTop:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Procesos destacados</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Procesos destacados</div>
{sysData.processes.slice(0,5).map((p,i)=>(
<div key={i} style={{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"5px 0",borderBottom:i<4?`1px solid ${C.border}`:"none"}}>
<span style={{fontSize:"0.7rem",fontFamily:C.mono,color:C.blue,width:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>{p.command}</span>
@@ -186,7 +186,7 @@
</div>
</div>
))}
<div style={{fontSize:"0.55rem",color:C.t3,fontFamily:C.mono,marginTop:8,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t3,fontFamily:C.mono,marginTop:8,lineHeight:1.5}}>
CPU sobre el total de la máquina ({sysData.cpu?.count||"?"} núcleos), medida en una ventana de 500 ms — no es la media desde el arranque que muestra <code>ps</code>, que engaña porque un proceso que trabajó mucho hace días sigue apareciendo alto.
</div>
</div>
@@ -197,7 +197,7 @@
{/* Dificultad */}
<Card>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:10}}>Ajuste de Dificultad</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:10}}>Ajuste de Dificultad</div>
<div style={{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12}}>
<Tag label="Cambio estimado" value={raya(diff, d=>`${d.difficultyChange>0?"+":""}${fmtDec(Number(d.difficultyChange), 2)} %`)} color={gris(diff, diff&&diff.difficultyChange>0?C.red:C.green)}/>
<Tag label="Tiempo promedio" value={raya(diff, d=>`${d.timeAvg?fmtDec(d.timeAvg/60000, 1):"-"} min`)} color={gris(diff, C.blue)}/>
@@ -404,15 +404,15 @@
<Card>
<div style={{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom: open?12:0,cursor:"pointer"}} onClick={()=>setOpen(!open)}>
<div style={{display:"flex",alignItems:"center",gap:8}}>
<span style={{fontSize:"0.62rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",fontWeight:700}}>⚑ Comprobación de seguridad del nodo</span>
<span style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",fontWeight:700}}>⚑ Comprobación de seguridad del nodo</span>
{overallStatus&&(
<span style={{fontSize:"0.62rem",fontFamily:C.mono,color:statusColor(overallStatus),fontWeight:700}}>
<span style={{fontSize:"0.69rem",fontFamily:C.mono,color:statusColor(overallStatus),fontWeight:700}}>
{overallStatus==="ok"?" — sin avisos":overallStatus==="warn"?" — revisar":" — error"}{checks.some(c=>c.status==="nd")?` · ${checks.filter(c=>c.status==="nd").length} sin comprobar`:""}
</span>
)}
</div>
<div style={{display:"flex",alignItems:"center",gap:8}}>
{loading&&<span style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>verificando···</span>}
{loading&&<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>verificando···</span>}
<span style={{color:C.t2,fontSize:"0.7rem"}}>{open?"▲":"▼"}</span>
</div>
</div>
@@ -420,7 +420,7 @@
{open&&(
<div style={{display:"flex",flexDirection:"column",gap:6}}>
{!checks&&!loading&&(
<div style={{fontSize:"0.68rem",color:C.t2,fontFamily:C.mono,padding:"8px 0"}}>Cargando verificaciones···</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,padding:"8px 0"}}>Cargando verificaciones···</div>
)}
{checks&&checks.map(check=>(
<div key={check.id} style={{display:"flex",alignItems:"flex-start",gap:10,padding:"8px 10px",background:C.bg,borderRadius:6,border:`1px solid ${statusColor(check.status)}20`}}>
@@ -429,7 +429,7 @@
</span>
<div style={{flex:1}}>
<div style={{fontSize:"0.7rem",color:C.t1,fontFamily:C.mono,marginBottom:3}}>{check.label}</div>
<div style={{fontSize:"0.65rem",color:C.t2,lineHeight:1.6}}>{check.detail}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>{check.detail}</div>
</div>
<Badge color={statusColor(check.status)}>
{check.status==="ok"?"OK":check.status==="warn"?"REVISAR":check.status==="nd"?"SIN COMPROBAR":"ERROR"}
@@ -437,7 +437,7 @@
</div>
))}
{checks&&(
<div style={{fontSize:"0.6rem",color:C.t3,fontFamily:C.mono,marginTop:4,paddingTop:8,borderTop:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.69rem",color:C.t3,fontFamily:C.mono,marginTop:4,paddingTop:8,borderTop:`1px solid ${C.border}`}}>
Este checklist verifica la configuración visible desde el dashboard. No sustituye una auditoría de seguridad completa del sistema.
</div>
)}
@@ -489,7 +489,7 @@
return (
<Card>
<div style={{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,flexWrap:"wrap",gap:8}}>
<div style={{fontSize:"0.62rem",color:C.green,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",display:"flex",alignItems:"center",gap:8}}>
<div style={{fontSize:"0.69rem",color:C.green,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",display:"flex",alignItems:"center",gap:8}}>
<span>▶</span> Registros (cada 30 s)
{loading && <span style={{color:C.t2,letterSpacing:"0.05em"}}>actualizando…</span>}
</div>
@@ -500,7 +500,7 @@
padding:"4px 10px",borderRadius:4,border:`1px solid ${service===s?C.green+"60":C.border}`,
background:service===s?C.greenMuted:C.bgCard,
color:service===s?C.green:C.t2,
fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer",
fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",
}}>{s}</button>
))}
{/* Level filter */}
@@ -510,12 +510,12 @@
border:`1px solid ${filter===f?(f==="error"?C.red:f==="warn"?C.amber:C.blue)+"60":C.border}`,
background:filter===f?(f==="error"?C.redMuted:f==="warn"?C.amberMuted:C.blueMuted):"none",
color:filter===f?(f==="error"?C.red:f==="warn"?C.amber:C.blue):C.t2,
fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer",
fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",
}}>{f==="all"?"todos":f==="warn"?"avisos":"errores"}</button>
))}
<button onClick={()=>fetchLogs(service)} style={{
padding:"4px 10px",borderRadius:4,border:`1px solid ${C.border}`,
background:"none",color:C.t2,fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer",
background:"none",color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",
}}>{loading?"···":"↻"}</button>
</div>
</div>
@@ -524,7 +524,7 @@
<div style={{
background:C.bg,borderRadius:6,border:`1px solid ${C.border}`,
height:280,overflowY:"auto",padding:"10px 12px",
fontFamily:C.mono,fontSize:"0.65rem",lineHeight:1.7,
fontFamily:C.mono,fontSize:"0.82rem",lineHeight:1.7,
opacity: loading ? 0.6 : 1, transition:"opacity 0.2s",
}}>
{!loading && filtered.length===0 && <div style={{color:C.t2}}>Sin líneas{filter==="warn"?" de aviso":filter==="error"?" de error":""}.</div>}
@@ -537,7 +537,7 @@
))}
<div ref={logsEndRef}/>
</div>
<div style={{fontSize:"0.6rem",color:C.t3,fontFamily:C.mono,marginTop:6,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:4}}>
<div style={{fontSize:"0.69rem",color:C.t3,fontFamily:C.mono,marginTop:6,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:4}}>
<span>{filtered.length} entradas · auto-refresh 30s</span>
{lastUpdated && <span>última actualización: {lastUpdated}</span>}
</div>
+21 -21
View File
@@ -89,25 +89,25 @@
{!base&&<DemoBanner/>}
{base&&(()=>{ const ej=SERIES_RED.filter(([p])=>salud.esEjemplo(p)); if(!ej.length) return null;
const motivos=[...new Set(ej.map(([p])=>salud.sustituidos.get(p)||salud.fallos.get(p.split("/").slice(0,3).join("/"))).filter(Boolean))];
return <div data-sin-datos="red" style={{padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}50`,borderRadius:6,fontSize:"0.66rem",color:C.t1,lineHeight:1.55}}><Badge color={C.amber}>SIN DATOS</Badge> Tu nodo no ha dado {ej.map(([,n])=>n).join(", ")}{motivos.length?` (${motivos.join("; ")})`:""}: esas partes quedan <strong>vacías</strong>. La app no las rellena con ejemplos.</div>; })()}
return <div data-sin-datos="red" style={{padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}50`,borderRadius:6,fontSize:"0.82rem",color:C.t1,lineHeight:1.55}}><Badge color={C.amber}>SIN DATOS</Badge> Tu nodo no ha dado {ej.map(([,n])=>n).join(", ")}{motivos.length?` (${motivos.join("; ")})`:""}: esas partes quedan <strong>vacías</strong>. La app no las rellena con ejemplos.</div>; })()}
{/* Comisiones — el contexto para decidir */}
{fees&&(
<Card>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:12}}>Tarifas ahora (sat/vB, según la mempool)</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:12}}>Tarifas ahora (sat/vB, según la mempool)</div>
<div style={{display:"grid",gridTemplateColumns:`repeat(auto-fill,minmax(${isMobile?"105px":"130px"},1fr))`,gap:10}}>
{[{label:"Próximo bloque",val:`${fees.fastestFee} sat/vB`,color:C.red},{label:"30 min",val:`${fees.halfHourFee} sat/vB`,color:C.amber},{label:"1 hora",val:`${fees.hourFee} sat/vB`,color:C.green},{label:"Económico",val:`${fees.economyFee} sat/vB`,color:C.t2},{label:"Mínimo",val:`${fees.minimumFee} sat/vB`,color:C.t3}].map(f=>(
<div key={f.label} style={{padding:"10px 12px",background:C.bg,borderRadius:6,border:`1px solid ${C.border}`}}><div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:4}}>{f.label}</div><div style={{fontSize:"0.88rem",color:f.color,fontFamily:C.mono,fontWeight:700}}>{f.val}</div></div>
<div key={f.label} style={{padding:"10px 12px",background:C.bg,borderRadius:6,border:`1px solid ${C.border}`}}><div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:4}}>{f.label}</div><div style={{fontSize:"0.88rem",color:f.color,fontFamily:C.mono,fontWeight:700}}>{f.val}</div></div>
))}
</div>
{/* La pregunta real */}
<div style={{marginTop:14,paddingTop:12,borderTop:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,marginBottom:8}}>Si pagas… ¿cuándo entra?</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:8}}>Si pagas… ¿cuándo entra?</div>
<div style={{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"}}>
<input value={tarifa} onChange={e=>setTarifa(e.target.value)} type="number" min="0" step="0.1" placeholder="sat/vB"
style={{width:110,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"8px 10px",color:C.t1,fontFamily:C.mono,fontSize:"0.72rem",outline:"none"}}/>
{estimacion&&(
<span style={{fontSize:"0.68rem",fontFamily:C.mono,color:estimacion.fuera?C.amber:C.green}}>
<span style={{fontSize:"0.69rem",fontFamily:C.mono,color:estimacion.fuera?C.amber:C.green}}>
{estimacion.bajoMinimo
? `Por debajo de la tarifa mínima que acepta tu nodo ahora (${estimacion.minimo} sat/vB): ni siquiera entraría en su lista de espera.`
: estimacion.fuera
@@ -116,7 +116,7 @@
</span>
)}
</div>
<div style={{fontSize:"0.58rem",color:C.t3,fontFamily:C.mono,marginTop:6,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t3,fontFamily:C.mono,marginTop:6,lineHeight:1.5}}>
Estimación sobre la mempool de ahora mismo: si llegan transacciones con más comisión, tu sitio se retrasa. Y diez minutos es la media entre bloques, no una promesa.
</div>
</div>
@@ -128,14 +128,14 @@
{mempool&&(
<div style={{display:"grid",gridTemplateColumns:`repeat(auto-fill,minmax(${isMobile?"110px":"140px"},1fr))`,gap:8}}>
{[{label:"Transacciones",val:fmt.num(mempool.count),color:C.amber},{label:"Tamaño total (vB)",val:fmt.mb(mempool.vsize),color:C.blue},{label:"Comisiones",val:fmt.sbtc(mempool.total_fee),color:C.green}].map(s=>(
<Card key={s.label} style={{padding:"12px 14px"}}><div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:5}}>{s.label}</div><div style={{fontSize:"0.95rem",color:s.color,fontFamily:C.mono,fontWeight:700}}>{s.val}</div></Card>
<Card key={s.label} style={{padding:"12px 14px"}}><div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:5}}>{s.label}</div><div style={{fontSize:"0.95rem",color:s.color,fontFamily:C.mono,fontWeight:700}}>{s.val}</div></Card>
))}
</div>
)}
{proyectados&&proyectados.length>0&&(
<Card>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:12}}>Próximos bloques (proyección)</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:12}}>Próximos bloques (proyección)</div>
{proyectados.slice(0,4).map((block,i)=>{
const feeRange = block.feeRange || [];
const maxFee = Math.round(Math.max(...feeRange, 1));
@@ -145,8 +145,8 @@
<div key={i} style={{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:6,padding:"8px 10px",marginBottom:4,borderRadius:6,background:esElTuyo?C.greenMuted:"transparent",border:`1px solid ${esElTuyo?C.green+"40":"transparent"}`}}>
<div>
<span style={{fontSize:"0.7rem",color:C.purple,fontFamily:C.mono,fontWeight:700}}>+{i+1} bloque{i>0?"s":""}</span>
<span style={{fontSize:"0.62rem",color:C.t2,marginLeft:8,fontFamily:C.mono}}>{fmt.num(block.nTx)} txs</span>
{esElTuyo&&<span style={{fontSize:"0.6rem",color:C.green,marginLeft:8,fontFamily:C.mono,fontWeight:700}}>← entraría aquí</span>}
<span style={{fontSize:"0.69rem",color:C.t2,marginLeft:8,fontFamily:C.mono}}>{fmt.num(block.nTx)} txs</span>
{esElTuyo&&<span style={{fontSize:"0.69rem",color:C.green,marginLeft:8,fontFamily:C.mono,fontWeight:700}}>← entraría aquí</span>}
</div>
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}><Badge color={C.amber}>{minFee}–{maxFee} sat/vB</Badge><Badge color={C.t3}>{fmt.mb(block.blockVSize)}</Badge></div>
</div>
@@ -158,7 +158,7 @@
{/* El corte: aquí acaba lo que se espera y empieza lo que ya está */}
<div style={{display:"flex",alignItems:"center",gap:10,margin:"2px 0"}}>
<div style={{flex:1,height:1,background:`linear-gradient(to right,transparent,${C.green}60)`}}/>
<span style={{fontSize:"0.58rem",color:C.green,fontFamily:C.mono,letterSpacing:"0.2em",textTransform:"uppercase"}}>ahora</span>
<span style={{fontSize:"0.69rem",color:C.green,fontFamily:C.mono,letterSpacing:"0.2em",textTransform:"uppercase"}}>ahora</span>
<div style={{flex:1,height:1,background:`linear-gradient(to left,transparent,${C.green}60)`}}/>
</div>
@@ -166,9 +166,9 @@
{blocks.map((b,i)=>(
<div key={b.id||i} onClick={()=>selectBlock(b)} style={{display:"grid",gridTemplateColumns:"90px 1fr auto",alignItems:"center",gap:12,padding:"10px 14px",borderRadius:6,cursor:"pointer",background:selected&&selected.id===b.id?C.purpleMuted:C.bgCard,border:`1px solid ${selected&&selected.id===b.id?C.purple+"50":C.border}`}}
onMouseEnter={e=>e.currentTarget.style.background=C.bgHover} onMouseLeave={e=>e.currentTarget.style.background=selected&&selected.id===b.id?C.purpleMuted:C.bgCard}>
<div><div style={{fontSize:"0.88rem",fontFamily:C.mono,color:C.purple,fontWeight:700}}>#{fmt.num(b.height)}</div><div style={{fontSize:"0.62rem",color:C.t2,marginTop:2}}>hace {fmt.ago(b.timestamp)}</div></div>
<div><div style={{fontSize:"0.68rem",fontFamily:C.mono,color:C.t2,marginBottom:4}}>{fmt.hash(b.id)}</div><div style={{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"}}><Badge color={C.blue}>{fmt.num(b.tx_count)} transacciones</Badge><Badge color={C.t3}>{fmt.mb(b.size)}</Badge>{b.extras&&b.extras.pool&&<span style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{b.extras.pool.name}</span>}</div></div>
<div style={{textAlign:"right"}}>{b.extras&&b.extras.totalFees!=null&&<><div style={{fontSize:"0.7rem",color:C.amber,fontFamily:C.mono}}>{fmt.sbtc(b.extras.totalFees)}</div><div style={{fontSize:"0.58rem",color:C.t2}}>comisiones</div></>}</div>
<div><div style={{fontSize:"0.88rem",fontFamily:C.mono,color:C.purple,fontWeight:700}}>#{fmt.num(b.height)}</div><div style={{fontSize:"0.69rem",color:C.t2,marginTop:2}}>hace {fmt.ago(b.timestamp)}</div></div>
<div><div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,marginBottom:4}}>{fmt.hash(b.id)}</div><div style={{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"}}><Badge color={C.blue}>{fmt.num(b.tx_count)} transacciones</Badge><Badge color={C.t3}>{fmt.mb(b.size)}</Badge>{b.extras&&b.extras.pool&&<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{b.extras.pool.name}</span>}</div></div>
<div style={{textAlign:"right"}}>{b.extras&&b.extras.totalFees!=null&&<><div style={{fontSize:"0.7rem",color:C.amber,fontFamily:C.mono}}>{fmt.sbtc(b.extras.totalFees)}</div><div style={{fontSize:"0.69rem",color:C.t2}}>comisiones</div></>}</div>
</div>
))}
{selected&&(
@@ -180,7 +180,7 @@
</div>
<button onClick={()=>{setSelected(null);setBlockTxs(null);}} style={{background:"none",border:"none",color:C.t2,cursor:"pointer",fontSize:"1rem",fontFamily:C.mono}}>✕</button>
</div>
<div style={{fontSize:"0.68rem",fontFamily:C.mono,color:C.t2,wordBreak:"break-all",marginBottom:12}}>{selected.id}</div>
<div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,wordBreak:"break-all",marginBottom:12}}>{selected.id}</div>
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(130px,1fr))",gap:12,paddingTop:12,borderTop:`1px solid ${C.border}`,marginBottom:16}}>
<Tag label="Transacciones" value={fmt.num(selected.tx_count)} color={C.blue}/>
<Tag label="Tamaño" value={fmt.mb(selected.size)} color={C.t1}/>
@@ -189,12 +189,12 @@
<Tag label="Minero" value={selected.extras&&selected.extras.pool?selected.extras.pool.name:"-"} color={C.green}/>
<Tag label="Minado" value={fmt.date(selected.timestamp)} color={C.t1}/>
</div>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:8}}>Primeras transacciones</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:8}}>Primeras transacciones</div>
{!blockTxs&&<Spinner/>}
{blockTxs==="error"&&<div style={{fontSize:"0.66rem",color:C.amber}}>Tu nodo no ha dado las transacciones de este bloque.</div>}
{blockTxs==="error"&&<div style={{fontSize:"0.69rem",color:C.amber}}>Tu nodo no ha dado las transacciones de este bloque.</div>}
{Array.isArray(blockTxs)&&blockTxs.slice(0,5).map((tx,i)=>(
<div key={i} style={{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 0",borderBottom:`1px solid ${C.border}`}}>
<span style={{fontSize:"0.68rem",fontFamily:C.mono,color:C.blue}}><IdCopiable id={tx.txid} texto={fmt.hash(tx.txid)}/></span>
<span style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.blue}}><IdCopiable id={tx.txid} texto={fmt.hash(tx.txid)}/></span>
<div style={{display:"flex",gap:6,alignItems:"center"}}><Badge color={C.amber}>{tx.fee} sat</Badge><Badge color={C.t3}>{tx.size} B</Badge><VerEnMempool base={base} tipo="tx" id={tx.txid} texto="↗"/></div>
</div>
))}
@@ -204,7 +204,7 @@
{/* Histórico de comisiones — para saber si hoy es caro o barato */}
<Card>
<div style={{display:"flex",flexDirection:isMobile?"column":"row",alignItems:isMobile?"flex-start":"center",justifyContent:"space-between",gap:isMobile?8:0,marginBottom:12}}>
<div style={{fontSize:"0.62rem",color:C.amber,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:isMobile?"0.1em":"0.2em",display:"flex",alignItems:"center",gap:8}}>
<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:isMobile?"0.1em":"0.2em",display:"flex",alignItems:"center",gap:8}}>
<span>◈</span> Tarifas de la última semana
</div>
{feeStats&&(
@@ -216,9 +216,9 @@
)}
</div>
{!feeHistory ? <Spinner/> : feeHistory==="error"
? <div style={{fontSize:"0.68rem",color:C.t2,lineHeight:1.55,padding:"10px 0"}}>Tu nodo no ha dado el histórico de tarifas de la semana, así que no se dibuja el gráfico. Puede pasar si Mempool no tiene las estadísticas de minería o aún las está calculando. Vuelve a abrir esta pestaña más tarde.</div>
? <div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.55,padding:"10px 0"}}>Tu nodo no ha dado el histórico de tarifas de la semana, así que no se dibuja el gráfico. Puede pasar si Mempool no tiene las estadísticas de minería o aún las está calculando. Vuelve a abrir esta pestaña más tarde.</div>
: <FeeChart data={feeHistory} isMobile={isMobile}/>}
{feeHistory!=="error"&&<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,marginTop:8}}>
{feeHistory!=="error"&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginTop:8}}>
Tarifa mediana por hora, en sat/vB.
</div>}
</Card>
+13 -13
View File
@@ -175,11 +175,11 @@
return (
<Card style={{marginBottom:4}}>
<div style={{fontSize:"0.62rem",color:C.green,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:12,display:"flex",alignItems:"center",gap:8}}>
<div style={{fontSize:"0.69rem",color:C.green,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:12,display:"flex",alignItems:"center",gap:8}}>
<span>✓</span> Verificar transacción propia
<div style={{flex:1,height:1,background:`linear-gradient(to right,${C.green}40,transparent)`}}/>
</div>
<div style={{fontSize:"0.66rem",color:C.t2,marginBottom:10,lineHeight:1.5}}>Para comprobar que una transacción tuya ha llegado a la cadena: confirmaciones, bloque y comisión, preguntando solo a tu nodo.</div>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:10,lineHeight:1.5}}>Para comprobar que una transacción tuya ha llegado a la cadena: confirmaciones, bloque y comisión, preguntando solo a tu nodo.</div>
<div style={{display:"flex",gap:8,marginBottom:err||result?"10px":"0"}}>
<input value={txid} onChange={e=>setTxid(filtrarSecreto(e.target.value))} onKeyDown={e=>e.key==="Enter"&&verify()}
placeholder="Pega aquí tu txid para verificar"
@@ -196,7 +196,7 @@
{result&&(
<div style={{padding:"12px 14px",background:C.bg,borderRadius:6,border:`1px solid ${statusColor}40`}}>
<div style={{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10}}>
<span style={{fontSize:"0.68rem",fontFamily:C.mono,color:C.t2,wordBreak:"break-all"}}><IdCopiable id={result.tx.txid} texto={fmt.hash(result.tx.txid)}/></span>
<span style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,wordBreak:"break-all"}}><IdCopiable id={result.tx.txid} texto={fmt.hash(result.tx.txid)}/></span>
<Badge color={statusColor}>{statusLabel}</Badge>
</div>
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(120px,1fr))",gap:10}}>
@@ -204,7 +204,7 @@
<Tag label="Bloque" value={result.tx.status?.block_height!=null?`#${fmt.num(result.tx.status.block_height)}`:"mempool"} color={C.purple}/>
<Tag label="Comisión" value={fmtFee(comisionDe(result.tx))} color={C.amber}/>
<Tag label="Tarifa" value={fmtTasa(comisionDe(result.tx))} color={C.amber}/>
{comisionDe(result.tx).fee===0&&<div style={{gridColumn:"1 / -1",fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>{notaComisionCero(result.tx)}</div>}
{comisionDe(result.tx).fee===0&&<div style={{gridColumn:"1 / -1",fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>{notaComisionCero(result.tx)}</div>}
<Tag label="Confirmado" value={result.tx.status?.block_time?fmt.date(result.tx.status.block_time):"-"} color={C.t1}/>
<Tag label="Tamaño virtual" value={result.tx.weight?`${Math.ceil(result.tx.weight/4)} vB`:"-"} color={C.t1}/>
</div>
@@ -395,19 +395,19 @@
return(
<Card>
<div style={{fontSize:"0.62rem",color:C.purple,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:8,display:"flex",alignItems:"center",gap:8}}>
<div style={{fontSize:"0.69rem",color:C.purple,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:8,display:"flex",alignItems:"center",gap:8}}>
<span>◎</span> Mapa de UTXOs
<div style={{flex:1,height:1,background:`linear-gradient(to right,${C.purple}40,transparent)`}}/>
{utxos&&utxos.length>0&&(
<button onClick={exportUtxosCSV} title="Descargar las monedas en CSV (se genera en tu navegador; no se envía a ningún sitio)"
style={{padding:"4px 10px",background:C.bg,border:`1px solid ${C.purple}40`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.6rem",letterSpacing:"0.08em",cursor:"pointer",whiteSpace:"nowrap"}}
style={{padding:"4px 10px",background:C.bg,border:`1px solid ${C.purple}40`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",letterSpacing:"0.08em",cursor:"pointer",whiteSpace:"nowrap"}}
onMouseEnter={e=>e.currentTarget.style.borderColor=C.purple}
onMouseLeave={e=>e.currentTarget.style.borderColor=C.purple+"40"}>
↓ CSV
</button>
)}
</div>
<div style={{fontSize:"0.65rem",color:C.t2,marginBottom:12,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:12,lineHeight:1.5}}>
Las monedas sin gastar de una dirección (UTXOs), cada una con la banda de privacidad (alta, media o baja) de la transacción que la creó. Si la moneda la recibiste, esa banda refleja lo que hizo quien te pagó. Hasta {MAX_UTXOS} monedas; se analizan las 10 mayores, para no cargar tu nodo.
</div>
<div style={{display:"flex",gap:8,marginBottom:10}}>
@@ -435,7 +435,7 @@
{/* Patrón temporal */}
{temporalPattern&&(
<div style={{padding:"8px 12px",background:C.purpleMuted,border:`1px solid ${C.purple}30`,borderRadius:6,fontSize:"0.65rem",color:C.t1,lineHeight:1.6}}>
<div style={{padding:"8px 12px",background:C.purpleMuted,border:`1px solid ${C.purple}30`,borderRadius:6,fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>
<span style={{color:C.purple,fontFamily:C.mono,fontWeight:700}}>⏱ </span>{temporalPattern}
</div>
)}
@@ -455,11 +455,11 @@
<div style={{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6}}>
<div style={{display:"flex",alignItems:"center",gap:8}}>
<div style={{width:8,height:8,borderRadius:"50%",background:priv.color,boxShadow:`0 0 6px ${priv.color}`,flexShrink:0}}/>
<span style={{fontSize:"0.68rem",fontFamily:C.mono,color:C.t2,display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"}}><IdCopiable id={u.txid} texto={fmt.hash(u.txid)}/> · salida {u.vout}</span>
<span style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"}}><IdCopiable id={u.txid} texto={fmt.hash(u.txid)}/> · salida {u.vout}</span>
</div>
<div style={{display:"flex",alignItems:"center",gap:8}}>
<span style={{fontSize:"0.7rem",fontFamily:C.mono,color:priv.color,fontWeight:700}}>{typeof priv.score==="number"?(priv.band||(priv.score>=BANDA_ALTA?"ALTA":priv.score>=BANDA_MEDIA?"MEDIA":"BAJA")):"sin analizar"}</span>
<span style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{sharePct}%</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{sharePct}%</span>
</div>
</div>
@@ -471,7 +471,7 @@
{/* Value + block */}
<div style={{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom: priv.issues.length>0?6:0}}>
<span style={{fontSize:"0.88rem",color:priv.color,fontFamily:C.mono,fontWeight:700}}>{fmt.btc(u.value)}</span>
<span style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>
{u.status?.confirmed?`bloque #${fmt.num(u.status.block_height)}`:"sin confirmar"}
</span>
</div>
@@ -480,7 +480,7 @@
{priv.issues.length>0&&(
<div style={{display:"flex",flexWrap:"wrap",gap:4,marginTop:4}}>
{priv.issues.map((issue,j)=>(
<span key={j} style={{fontSize:"0.58rem",fontFamily:C.mono,padding:"2px 6px",borderRadius:3,
<span key={j} style={{fontSize:"0.69rem",fontFamily:C.mono,padding:"2px 6px",borderRadius:3,
background:"transparent",color:issue.color,border:`1px solid ${issue.color}40`}}>
{issue.label}
</span>
@@ -497,7 +497,7 @@
{[{color:C.green,label:"Banda alta"},{color:C.amber,label:"Banda media"},{color:C.red,label:"Banda baja"}].map(l=>(
<div key={l.label} style={{display:"flex",alignItems:"center",gap:5}}>
<div style={{width:7,height:7,borderRadius:"50%",background:l.color,flexShrink:0}}/>
<span style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{l.label}</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{l.label}</span>
</div>
))}
</div>
+34 -34
View File
@@ -25,7 +25,7 @@
<span onClick={e=>{e.stopPropagation();setVer(v=>!v);}} title={GLOSA_RASTRO[t]}
style={{borderBottom:`1px dotted ${C.t2}`,cursor:"help"}}>
{children||t}
{ver&&<span style={{display:"block",marginTop:4,fontSize:"0.66rem",color:C.t2,textTransform:"none",letterSpacing:0,fontFamily:C.sans,lineHeight:1.5}}>{GLOSA_RASTRO[t]}</span>}
{ver&&<span style={{display:"block",marginTop:4,fontSize:"0.82rem",color:C.t2,textTransform:"none",letterSpacing:0,fontFamily:C.sans,lineHeight:1.5}}>{GLOSA_RASTRO[t]}</span>}
</span>
);
}
@@ -54,7 +54,7 @@
<span style={{fontFamily:C.mono,fontSize:"0.7rem",fontWeight:700,color:col}}>{fin.titulo}</span>
{fin.certeza&&<CertaintyBadge level={fin.certeza}/>}
</div>
<div style={{fontSize:"0.72rem",color:C.t1,lineHeight:1.6}}>{fin.texto}</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>{fin.texto}</div>
</div>
);
}
@@ -70,15 +70,15 @@
<div style={{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}}>
<div style={{display:"flex",flexDirection:"column",gap:2,minWidth:0}}>
<span style={{fontFamily:C.mono,fontWeight:700,fontSize:"0.8rem",color:C.t1}}>{btcTxt(v.prevout?.value)}</span>
<div style={{display:"flex",alignItems:"center",gap:6,minWidth:0}}><span style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>Entrada {i} · {v.prevout?.scriptpubkey_address?abrevDir(v.prevout.scriptpubkey_address):etiquetaSinDir(v.prevout)}</span>{v.prevout?.scriptpubkey_address&&<BotonCopiar texto={v.prevout.scriptpubkey_address} etiqueta="la dirección"/>}</div>
<div style={{display:"flex",alignItems:"center",gap:6,minWidth:0}}><span style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>Entrada {i} · {v.prevout?.scriptpubkey_address?abrevDir(v.prevout.scriptpubkey_address):etiquetaSinDir(v.prevout)}</span>{v.prevout?.scriptpubkey_address&&<BotonCopiar texto={v.prevout.scriptpubkey_address} etiqueta="la dirección"/>}</div>
</div>
{sePuede&&<span style={{fontFamily:C.mono,color:C.purple,fontSize:"0.78rem",whiteSpace:"nowrap"}}>seguir ›</span>}
</div>
{seguido>0&&<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.45}}>De los {btcTxt(seguido)} seguidos hasta aquí, {btcTxt(rep.sats)} vienen por esta entrada ({pctTxt(rep.pct)} %).</div>}
{info?.estado==="cargando"&&<div style={{fontSize:"0.64rem",color:C.t2,fontFamily:C.mono}}>consultando la transacción anterior…</div>}
{info?.estado==="error"&&<div style={{fontSize:"0.64rem",color:C.amber}}>No se pudo consultar la transacción anterior ({String(info.err||"").replace(/\.$/,"")}). Toca la entrada para volver a intentarlo.</div>}
{seguido>0&&<div style={{fontSize:"0.69rem",color:C.t2,lineHeight:1.45}}>De los {btcTxt(seguido)} seguidos hasta aquí, {btcTxt(rep.sats)} vienen por esta entrada ({pctTxt(rep.pct)} %).</div>}
{info?.estado==="cargando"&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>consultando la transacción anterior…</div>}
{info?.estado==="error"&&<div style={{fontSize:"0.69rem",color:C.amber}}>No se pudo consultar la transacción anterior ({String(info.err||"").replace(/\.$/,"")}). Toca la entrada para volver a intentarlo.</div>}
{pistas.map((p,j)=>(
<div key={j} style={{display:"flex",gap:6,alignItems:"flex-start",fontSize:"0.68rem",color:colorPista(p.tipo),lineHeight:1.45}}>
<div key={j} style={{display:"flex",gap:6,alignItems:"flex-start",fontSize:"0.69rem",color:colorPista(p.tipo),lineHeight:1.45}}>
<span style={{flexShrink:0}}>{iconoPista(p.tipo)}</span>
<span style={{flex:1,minWidth:0}}>{p.texto}</span>
{p.certeza&&<span style={{flexShrink:0}}><CertaintyBadge level={p.certeza}/></span>}
@@ -100,27 +100,27 @@
<div onClick={!esActual?()=>onIr(k):undefined}
style={{width:isMobile?"100%":300,flexShrink:0,borderRight:isMobile?"none":`1px solid ${C.border}`,padding:isMobile?0:14,display:"flex",flexDirection:"column",gap:10,opacity:esActual?1:0.55,overflowY:isMobile?"visible":"auto",height:isMobile?"auto":"100%",cursor:esActual?"default":"pointer",minWidth:0}}>
<div style={isMobile?{padding:14,border:`1px solid ${C.borderBright}`,borderRadius:9,background:C.bgCard,display:"flex",flexDirection:"column",gap:6}:{display:"flex",flexDirection:"column",gap:6}}>
<div style={{fontFamily:C.mono,fontSize:"0.64rem",color:esActual?C.purple:C.t2,textTransform:"uppercase",letterSpacing:"0.12em"}}>
<div style={{fontFamily:C.mono,fontSize:"0.69rem",color:esActual?C.purple:C.t2,textTransform:"uppercase",letterSpacing:"0.12em"}}>
{k===0?"Punto de partida":<><Termino t="salto">Salto</Termino> {k}</>}{esActual?" · aquí estás":""}
</div>
<div style={{fontFamily:C.mono,fontSize:"0.8rem",color:C.t1,display:"flex",alignItems:"center",gap:6}}>{abrevTxid(h.txid)}<BotonCopiar texto={h.txid} etiqueta="el txid"/></div>
<div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>
{fechaCorta(t.status?.block_time)}{t.status?.block_height!=null&&` · bloque ${fmt.num(t.status.block_height)}`}{seguido>0&&` · importe seguido: ${btcTxt(seguido)}`}
</div>
{tiempo&&<div style={{fontSize:"0.68rem",color:C.t2}}>⏱ {tiempo}</div>}
{tiempo&&<div style={{fontSize:"0.69rem",color:C.t2}}>⏱ {tiempo}</div>}
{etiquetas.length>0&&(
<div style={{display:"flex",gap:4,flexWrap:"wrap"}}>
{etiquetas.map((e,j)=>(
<span key={j} style={{fontFamily:C.mono,fontSize:"0.6rem",fontWeight:700,padding:"2px 7px",borderRadius:3,color:e.color,background:`${e.color}18`,border:`1px solid ${e.color}45`}}>{e.txt} · {e.cert.toLowerCase()}</span>
<span key={j} style={{fontFamily:C.mono,fontSize:"0.69rem",fontWeight:700,padding:"2px 7px",borderRadius:3,color:e.color,background:`${e.color}18`,border:`1px solid ${e.color}45`}}>{e.txt} · {e.cert.toLowerCase()}</span>
))}
</div>
)}
</div>
{esActual&&(
<div style={{padding:"10px 12px",borderRadius:7,background:C.blueMuted,border:`1px solid ${C.blue}40`,fontSize:"0.74rem",color:C.t1,lineHeight:1.6}}>{describirTx(t)}{k===0&&seguido>0&&<> En el origen se sigue todo lo que entró en esta transacción ({btcTxt(seguido)}), también la parte que salió como cambio.</>}</div>
<div style={{padding:"10px 12px",borderRadius:7,background:C.blueMuted,border:`1px solid ${C.blue}40`,fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>{describirTx(t)}{k===0&&seguido>0&&<> En el origen se sigue todo lo que entró en esta transacción ({btcTxt(seguido)}), también la parte que salió como cambio.</>}</div>
)}
{esActual&&fin&&<FinCamino fin={fin}/>}
{!esActual&&fin&&<div style={{fontSize:"0.66rem",color:C.t2,fontFamily:C.mono}}>{fin.titulo}</div>}
{!esActual&&fin&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{fin.titulo}</div>}
{esActual&&!isMobile&&(
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}>
<button onClick={onMarcar} style={{...boton,color:C.amber,borderColor:`${C.amber}70`}}>{marcada?"★ Marcada":"☆ Marcar"}</button>
@@ -130,7 +130,7 @@
)}
{!(fin&&!fin.seguir)&&ins.length>0&&(
<>
<div style={{fontFamily:C.mono,fontSize:"0.62rem",color:C.t2,textTransform:"uppercase",letterSpacing:"0.1em",marginTop:2}}>
<div style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2,textTransform:"uppercase",letterSpacing:"0.1em",marginTop:2}}>
¿De dónde vino? Elige una <Termino t="entrada"/><NotaDesdeCero/>
</div>
{ins.slice(0,n).map((v,i)=>(
@@ -142,7 +142,7 @@
ver {Math.min(RASTRO_PISTAS_POR_TANDA, ins.length-n)} más (de {ins.length} entradas)
</button>
)}
{esActual&&<div style={{fontSize:"0.6rem",color:C.t3,lineHeight:1.5}}>«Vienen por esta entrada» es un reparto proporcional por importes: una cuenta, no una conclusión sobre de quién es el dinero.</div>}
{esActual&&<div style={{fontSize:"0.82rem",color:C.t3,lineHeight:1.5}}>«Vienen por esta entrada» es un reparto proporcional por importes: una cuenta, no una conclusión sobre de quién es el dinero.</div>}
</>
)}
{esActual&&isMobile&&(
@@ -158,22 +158,22 @@
function MesaTrabajo({camino, mesa, setMesa, pendientes, resumen, onIrSalto, onSeguirPendiente, onExportar}) {
const enCamino = txid => camino.findIndex(h=>h.txid===txid);
const marcadas = Object.entries(mesa).sort((a,b)=>(a[1].fecha||0)-(b[1].fecha||0));
const h = (txt,color) => <div style={{fontFamily:C.mono,fontSize:"0.64rem",color:color||C.t2,textTransform:"uppercase",letterSpacing:"0.12em",marginTop:6}}>{txt}</div>;
const boton = {fontFamily:C.mono,fontSize:"0.68rem",padding:"6px 10px",borderRadius:6,border:`1px solid ${C.borderBright}`,background:"none",color:C.t2,cursor:"pointer"};
const h = (txt,color) => <div style={{fontFamily:C.mono,fontSize:"0.69rem",color:color||C.t2,textTransform:"uppercase",letterSpacing:"0.12em",marginTop:6}}>{txt}</div>;
const boton = {fontFamily:C.mono,fontSize:"0.69rem",padding:"6px 10px",borderRadius:6,border:`1px solid ${C.borderBright}`,background:"none",color:C.t2,cursor:"pointer"};
return (
<div style={{display:"flex",flexDirection:"column",gap:10}}>
<div style={{fontFamily:C.mono,fontSize:"0.7rem",color:C.amber,textTransform:"uppercase",letterSpacing:"0.12em",fontWeight:700}}>★ Mesa de trabajo</div>
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>Las marcas y las notas se guardan solo en este navegador; no se envían a ningún sitio.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Las marcas y las notas se guardan solo en este navegador; no se envían a ningún sitio.</div>
{h("Marcadas")}
{marcadas.length===0
? <div style={{fontSize:"0.68rem",color:C.t3,lineHeight:1.5}}>Ninguna todavía. «Marcar» guarda aquí la transacción que estás viendo, con una nota.</div>
? <div style={{fontSize:"0.82rem",color:C.t3,lineHeight:1.5}}>Ninguna todavía. «Marcar» guarda aquí la transacción que estás viendo, con una nota.</div>
: marcadas.map(([txid,m])=>{
const k = enCamino(txid);
return (
<div key={txid} style={{padding:10,border:`1px solid ${C.borderBright}`,borderRadius:7,background:C.bg,display:"flex",flexDirection:"column",gap:6}}>
<div style={{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}}>
<span onClick={()=>k>=0&&onIrSalto(k)} style={{fontFamily:C.mono,fontSize:"0.72rem",color:C.t1,cursor:k>=0?"pointer":"default"}}>{abrevTxid(txid)}</span>
<span style={{fontFamily:C.mono,fontSize:"0.58rem",padding:"1px 6px",borderRadius:3,color:k>=0?C.amber:C.t3,border:`1px solid ${k>=0?C.amber:C.t3}55`}}>{k<0?"fuera de este camino":k===0?"origen":`salto ${k}`}</span>
<span style={{fontFamily:C.mono,fontSize:"0.69rem",padding:"1px 6px",borderRadius:3,color:k>=0?C.amber:C.t3,border:`1px solid ${k>=0?C.amber:C.t3}55`}}>{k<0?"fuera de este camino":k===0?"origen":`salto ${k}`}</span>
<button onClick={()=>setMesa(ms=>{const n={...ms};delete n[txid];return n;})} title="Quitar de la mesa"
style={{marginLeft:"auto",background:"none",border:"none",color:C.t3,cursor:"pointer",fontSize:"0.75rem"}}>✕</button>
</div>
@@ -185,21 +185,21 @@
})}
{h("Ramas sin seguir")}
{pendientes.length===0
? <div style={{fontSize:"0.68rem",color:C.t3,lineHeight:1.5}}>Ninguna: en los saltos recorridos no has dejado entradas sin seguir.</div>
? <div style={{fontSize:"0.82rem",color:C.t3,lineHeight:1.5}}>Ninguna: en los saltos recorridos no has dejado entradas sin seguir.</div>
: <>
{pendientes.slice(0,15).map(b=>(
<div key={`${b.salto}-${b.entrada}`} style={{display:"flex",alignItems:"center",gap:8,fontSize:"0.68rem",color:C.t2}}>
<div key={`${b.salto}-${b.entrada}`} style={{display:"flex",alignItems:"center",gap:8,fontSize:"0.69rem",color:C.t2}}>
<span style={{flex:1,minWidth:0}}>{b.salto===0?"Punto de partida":`Salto ${b.salto}`} · entrada {b.entrada} · <span style={{fontFamily:C.mono,color:C.t1}}>{btcTxt(b.sats)}</span></span>
<button onClick={()=>onSeguirPendiente(b.salto,b.entrada)} style={{...boton,padding:"3px 8px",color:C.purple}}>ir ›</button>
</div>
))}
{pendientes.length>15&&<div style={{fontSize:"0.64rem",color:C.t3}}>…y {pendientes.length-15} más</div>}
{pendientes.length>15&&<div style={{fontSize:"0.69rem",color:C.t3}}>…y {pendientes.length-15} más</div>}
</>}
{h("Resumen del seguimiento")}
<div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6}}>{textoResumen(resumen)}</div>
<div style={{fontSize:"0.6rem",color:C.t3}}>Solo cuenta lo recorrido; puede haber más en las ramas sin seguir.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>{textoResumen(resumen)}</div>
<div style={{fontSize:"0.69rem",color:C.t3}}>Solo cuenta lo recorrido; puede haber más en las ramas sin seguir.</div>
{h("Descargar el camino")}
<div style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.5}}>Lleva dentro los txids del camino y tus notas. Hasta ahora nada ha salido de tu red; a partir de aquí depende de ti dónde lo guardes o lo envíes.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Lleva dentro los txids del camino y tus notas. Hasta ahora nada ha salido de tu red; a partir de aquí depende de ti dónde lo guardes o lo envíes.</div>
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}>
<button onClick={()=>onExportar("md")} style={boton} title="Texto con formato Markdown: se abre con cualquier editor de texto">↓ Texto legible (.md)</button>
<button onClick={()=>onExportar("json")} style={boton} title="Datos estructurados para otra herramienta o programa">↓ Datos para otra herramienta (.json)</button>
@@ -219,12 +219,12 @@
<div style={{margin:"10px 14px 0",padding:"12px 14px",borderRadius:8,border:`1px solid ${C.purple}55`,background:C.purpleMuted}}>
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(200px,1fr))",gap:10}}>
{pasos.map(([t,d],i)=>(
<div key={t} style={{fontSize:"0.72rem",color:C.t1,lineHeight:1.5}}>
<div key={t} style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.5}}>
<span style={{fontFamily:C.mono,color:C.purple,fontWeight:700}}>{i+1}. {t}</span> — {d}
</div>
))}
</div>
<button onClick={onCerrar} style={{marginTop:10,fontFamily:C.mono,fontSize:"0.68rem",padding:"6px 12px",borderRadius:6,border:`1px solid ${C.purple}70`,background:"none",color:C.purple,cursor:"pointer"}}>Entendido</button>
<button onClick={onCerrar} style={{marginTop:10,fontFamily:C.mono,fontSize:"0.69rem",padding:"6px 12px",borderRadius:6,border:`1px solid ${C.purple}70`,background:"none",color:C.purple,cursor:"pointer"}}>Entendido</button>
</div>
);
}
@@ -361,14 +361,14 @@
<React.Fragment key={`${k}-${h.txid}`}>
{k>0&&<span style={{color:C.t3}}>›</span>}
<button data-actual={k===actual?"si":"no"} onClick={()=>setActual(k)}
style={{fontFamily:C.mono,fontSize:"0.68rem",padding:"5px 10px",borderRadius:14,whiteSpace:"nowrap",cursor:"pointer",flexShrink:0,
style={{fontFamily:C.mono,fontSize:"0.69rem",padding:"5px 10px",borderRadius:14,whiteSpace:"nowrap",cursor:"pointer",flexShrink:0,
border:`1px solid ${k===actual?C.purple:C.borderBright}`,background:k===actual?C.purpleMuted:"none",color:k===actual?C.purple:C.t2,fontWeight:k===actual?700:400}}>
{k===0?"Punto de partida":`Salto ${k}`} · {abrevCorto(h.txid)}
</button>
</React.Fragment>
))}
</div>
{ejemplo&&<div style={{padding:"6px 14px",fontSize:"0.64rem",color:C.amber,borderBottom:`1px solid ${C.border}`}}>Sin nodo: este camino recorre transacciones inventadas para que veas cómo funciona.</div>}
{ejemplo&&<div style={{padding:"6px 14px",fontSize:"0.69rem",color:C.amber,borderBottom:`1px solid ${C.border}`}}>Sin nodo: este camino recorre transacciones inventadas para que veas cómo funciona.</div>}
{guia&&<GuiaRastro onCerrar={cerrarGuia}/>}
{aviso&&<div style={{margin:"10px 14px 0",padding:"8px 12px",borderRadius:6,background:C.amberMuted,border:`1px solid ${C.amber}55`,color:C.amber,fontSize:"0.7rem"}}>{aviso}</div>}
@@ -378,7 +378,7 @@
{camino.map(columna)}
{actual===camino.length-1&&!(finActual&&!finActual.seguir)&&(
<div style={{width:180,flexShrink:0,padding:14,opacity:0.4}}>
<div style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2,textTransform:"uppercase",letterSpacing:"0.12em"}}>Salto {camino.length}</div>
<div style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2,textTransform:"uppercase",letterSpacing:"0.12em"}}>Salto {camino.length}</div>
<div style={{fontSize:"0.7rem",color:C.t2,marginTop:6}}>Elige una entrada para seguir</div>
</div>
)}
@@ -418,14 +418,14 @@
return (
<Card>
<div style={{display:"flex",alignItems:"center",gap:8,marginBottom:8}}>
<span style={{fontSize:"0.62rem",color:C.purple,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>Procedencia: ¿de dónde vino?</span>
<span style={{fontSize:"0.69rem",color:C.purple,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em"}}>Procedencia: ¿de dónde vino?</span>
<div style={{flex:1,height:1,background:`linear-gradient(to right,${C.purple}40,transparent)`}}/>
</div>
{coinbase ? (
<div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6}}>Esta transacción crea monedas nuevas (recompensa de minado): no viene de ninguna anterior, así que no hay nada que seguir hacia atrás.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>Esta transacción crea monedas nuevas (recompensa de minado): no viene de ninguna anterior, así que no hay nada que seguir hacia atrás.</div>
) : (
<>
<div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6,marginBottom:10}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6,marginBottom:10}}>
Sigue hacia atrás de dónde vino el dinero de esta transacción, un salto cada vez, con pistas en cada entrada antes de elegirla y una mesa para marcar y anotar. Cada consulta al nodo la pides tú. También está en la pestaña Seguimiento de fondos, junto a «Destino» (a dónde fue).
</div>
<button onClick={()=>setAbierto(true)}
+38 -38
View File
@@ -20,7 +20,7 @@
<span style={{fontFamily:C.mono,fontSize:"0.7rem",fontWeight:700,color:col}}>{p.titulo}</span>
{p.certeza&&<CertaintyBadge level={p.certeza}/>}
</div>
<div style={{fontSize:"0.72rem",color:C.t1,lineHeight:1.6}}>{p.texto}</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>{p.texto}</div>
</div>
);
}
@@ -38,27 +38,27 @@
// la comprobación sin enseñar su coste (revisión del 23-oct, hallazgo 8).
const seguible = !bloqueada && !parada && o.value >= PER_POLVO && g?.estado==="gastada";
const comprobable = !g && !esSalidaDeDatos(o) && !!(o.scriptpubkey_address || o.scriptpubkey) && entidadDe(o.scriptpubkey_address)?.cat!=="exchange";
const boton = {fontFamily:C.mono,fontSize:"0.64rem",padding:"4px 9px",borderRadius:5,border:`1px solid ${C.borderBright}`,background:"none",color:C.t2,cursor:"pointer",whiteSpace:"nowrap"};
const boton = {fontFamily:C.mono,fontSize:"0.69rem",padding:"4px 9px",borderRadius:5,border:`1px solid ${C.borderBright}`,background:"none",color:C.t2,cursor:"pointer",whiteSpace:"nowrap"};
return (
<div onClick={e=>{e.stopPropagation(); if(seguible&&!ocupado) onSeguir(k,i);}}
style={{padding:"10px 11px",border:`1px solid ${sel?C.red:C.border}`,borderRadius:7,background:sel?C.redMuted:C.bgCard,cursor:seguible?"pointer":"default",display:"flex",flexDirection:"column",gap:5,minWidth:0}}>
<div style={{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}}>
<div style={{display:"flex",flexDirection:"column",gap:2,minWidth:0}}>
<span style={{fontFamily:C.mono,fontWeight:700,fontSize:"0.8rem",color:C.t1}}>{btcTxt(o.value)}</span>
<div style={{display:"flex",alignItems:"center",gap:6,minWidth:0}}><span style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>Salida {i} · {o.scriptpubkey_address?abrevDir(o.scriptpubkey_address):etiquetaSinDir(o)}</span>{o.scriptpubkey_address&&<BotonCopiar texto={o.scriptpubkey_address} etiqueta="la dirección"/>}</div>
<div style={{display:"flex",alignItems:"center",gap:6,minWidth:0}}><span style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>Salida {i} · {o.scriptpubkey_address?abrevDir(o.scriptpubkey_address):etiquetaSinDir(o)}</span>{o.scriptpubkey_address&&<BotonCopiar texto={o.scriptpubkey_address} etiqueta="la dirección"/>}</div>
</div>
{seguible&&<span style={{fontFamily:C.mono,color:C.red,fontSize:"0.7rem",whiteSpace:"nowrap"}}>{isMobile?"seguir ›":"ir a la transacción que la gastó ›"}</span>}
</div>
{seguido>0&&<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.45}}>De los {btcTxt(seguido)} seguidos hasta aquí, por esta salida van {btcTxt(rep.sats)} ({pctTxt(rep.pct)} %).</div>}
{seguido>0&&<div style={{fontSize:"0.69rem",color:C.t2,lineHeight:1.45}}>De los {btcTxt(seguido)} seguidos hasta aquí, por esta salida van {btcTxt(rep.sats)} ({pctTxt(rep.pct)} %).</div>}
{pistas.map((p,j)=>(
<div key={j} style={{display:"flex",gap:6,alignItems:"flex-start",fontSize:"0.68rem",color:colorPistaPer(p.tipo),lineHeight:1.45}}>
<div key={j} style={{display:"flex",gap:6,alignItems:"flex-start",fontSize:"0.69rem",color:colorPistaPer(p.tipo),lineHeight:1.45}}>
<span style={{flexShrink:0}}>{iconoPistaPer(p.tipo)}</span>
<span style={{flex:1,minWidth:0}}>{p.texto}</span>
{p.certeza&&<span style={{flexShrink:0}}><CertaintyBadge level={p.certeza}/></span>}
</div>
))}
{parada&&parada.motivo!=="datos"&&<div style={{fontFamily:C.mono,fontSize:"0.62rem",color:parada.motivo==="sin_gastar"?C.green:C.amber,fontWeight:700}}>{parada.titulo}</div>}
{totalHist!=null&&<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.45}}>{costeHistorial(totalHist, per.tamPagina).replace(/^e/,"E")}.</div>}
{parada&&parada.motivo!=="datos"&&<div style={{fontFamily:C.mono,fontSize:"0.69rem",color:parada.motivo==="sin_gastar"?C.green:C.amber,fontWeight:700}}>{parada.titulo}</div>}
{totalHist!=null&&<div style={{fontSize:"0.69rem",color:C.t2,lineHeight:1.45}}>{costeHistorial(totalHist, per.tamPagina).replace(/^e/,"E")}.</div>}
{(comprobable||g?.estado==="sin_gastar"||g?.estado==="error"||g?.estado==="inconcluso"||g?.estado==="incompleto")&&(
<div style={{display:"flex",gap:6,flexWrap:"wrap"}} onClick={e=>e.stopPropagation()}>
{comprobable&&!bloqueada&&<button disabled={ocupado} onClick={()=>onComprobar(tx.txid,[i])} style={boton}>Comprobar si se gastó ({costeFila.min} a {costeFila.max} consultas)</button>}
@@ -84,32 +84,32 @@
<div onClick={!esActual?()=>onIr(k):undefined}
style={{width:isMobile?"100%":310,flexShrink:0,borderRight:isMobile?"none":`1px solid ${C.border}`,padding:isMobile?0:14,display:"flex",flexDirection:"column",gap:10,opacity:esActual?1:0.55,overflowY:isMobile?"visible":"auto",height:isMobile?"auto":"100%",cursor:esActual?"default":"pointer",minWidth:0}}>
<div style={isMobile?{padding:14,border:`1px solid ${C.borderBright}`,borderRadius:9,background:C.bgCard,display:"flex",flexDirection:"column",gap:6}:{display:"flex",flexDirection:"column",gap:6}}>
<div style={{fontFamily:C.mono,fontSize:"0.64rem",color:esActual?C.red:C.t2,textTransform:"uppercase",letterSpacing:"0.12em"}}>
<div style={{fontFamily:C.mono,fontSize:"0.69rem",color:esActual?C.red:C.t2,textTransform:"uppercase",letterSpacing:"0.12em"}}>
{esOrigen?"Origen · robo o pérdida":<><Termino t="salto-destino">Salto</Termino> {k}</>}{esActual?" · aquí estás":""}
</div>
<div style={{fontFamily:C.mono,fontSize:"0.8rem",color:C.t1,display:"flex",alignItems:"center",gap:6}}>{abrevTxid(tx.txid)}<BotonCopiar texto={tx.txid} etiqueta="el txid"/></div>
<div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.5}}>{fechaHora(tx.status?.block_time)}{tx.status?.block_height!=null&&` · bloque ${fmt.num(tx.status.block_height)}`}{seguido>0&&` · importe seguido: ${btcTxt(seguido)}`}</div>
{!esOrigen&&t&&<div style={{fontSize:"0.68rem",color:C.t2}}>⏱ {t}</div>}
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>{fechaHora(tx.status?.block_time)}{tx.status?.block_height!=null&&` · bloque ${fmt.num(tx.status.block_height)}`}{seguido>0&&` · importe seguido: ${btcTxt(seguido)}`}</div>
{!esOrigen&&t&&<div style={{fontSize:"0.69rem",color:C.t2}}>⏱ {t}</div>}
</div>
{esActual&&<div style={{padding:"10px 12px",borderRadius:7,background:C.blueMuted,border:`1px solid ${C.blue}40`,fontSize:"0.74rem",color:C.t1,lineHeight:1.6}}>{esOrigen?`La transacción de origen (el robo o la pérdida). Se sigue la salida ${per.origen.vout}: ${btcTxt(tx.vout[per.origen.vout]?.value)}.`:describirTx(tx)}</div>}
{esActual&&<div style={{padding:"10px 12px",borderRadius:7,background:C.blueMuted,border:`1px solid ${C.blue}40`,fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>{esOrigen?`La transacción de origen (el robo o la pérdida). Se sigue la salida ${per.origen.vout}: ${btcTxt(tx.vout[per.origen.vout]?.value)}.`:describirTx(tx)}</div>}
{esActual&&dil.diluido&&(
<div style={{padding:"10px 12px",borderRadius:7,border:`1px solid ${C.amber}55`,background:C.amberMuted}}>
<div style={{display:"flex",gap:6,alignItems:"center",marginBottom:4}}><span style={{fontFamily:C.mono,fontSize:"0.7rem",fontWeight:700,color:C.amber}}>Aquí entra también dinero de otras direcciones</span></div>
<div style={{fontSize:"0.72rem",color:C.t1,lineHeight:1.6}}>{dil.texto}</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>{dil.texto}</div>
</div>
)}
{esActual&&parada&&<ParadaBox p={parada}/>}
{!esActual&&parada&&<div style={{fontSize:"0.66rem",color:C.t2,fontFamily:C.mono}}>{parada.titulo}</div>}
{!esActual&&parada&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{parada.titulo}</div>}
{esActual&&!isMobile&&(
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}>
<button onClick={onMarcar} style={{...boton,color:C.amber,borderColor:`${C.amber}70`}}>{marcada?"★ Marcada":"☆ Marcar"}</button>
<VerEnMempool base={base} tipo="tx" id={tx.txid} texto="Ver en Mempool ↗"/>
</div>
)}
<div style={{fontFamily:C.mono,fontSize:"0.62rem",color:C.t2,textTransform:"uppercase",letterSpacing:"0.1em",marginTop:2}}>¿A dónde fue? Comprueba una <Termino t="salida"/> y, si se gastó, síguela<NotaDesdeCero/></div>
<div style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2,textTransform:"uppercase",letterSpacing:"0.1em",marginTop:2}}>¿A dónde fue? Comprueba una <Termino t="salida"/> y, si se gastó, síguela<NotaDesdeCero/></div>
{esActual&&porComprobar.length>0&&(
<div style={{padding:"9px 11px",borderRadius:7,border:`1px dashed ${C.red}60`,display:"flex",flexDirection:"column",gap:6}} onClick={e=>e.stopPropagation()}>
<div style={{fontSize:"0.7rem",color:C.t1,lineHeight:1.5}}>{coste.texto} Cada una revisa el historial de su dirección (hasta {PER_MAX_PAGINAS} páginas cada vez), porque tu Mempool no puede decir directamente qué transacción gasta una salida.</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.5}}>{coste.texto} Cada una revisa el historial de su dirección (hasta {PER_MAX_PAGINAS} páginas cada vez), porque tu Mempool no puede decir directamente qué transacción gasta una salida.</div>
<button disabled={ocupado} onClick={()=>onComprobar(tx.txid, porComprobar)} style={{...boton,alignSelf:"flex-start",color:C.red,borderColor:`${C.red}70`}}>{ocupado?"consultando…":`Comprobar si se ${porComprobar.length===1?"gastó esta salida":`gastaron estas ${porComprobar.length} salidas`}`}</button>
</div>
)}
@@ -118,8 +118,8 @@
onSeguir={onSeguir} onComprobar={onComprobar} vigilada={vigiladas.has(claveSalida(tx.txid,i))} onVigilar={onVigilar} isMobile={isMobile}/>
))}
{indices.length>nVis&&<button onClick={e=>{e.stopPropagation();setNVis(n=>n+10);}} style={{...boton,alignSelf:"flex-start"}}>ver {Math.min(10,indices.length-nVis)} más (de {indices.length} salidas)</button>}
{esOrigen&&tx.vout.length>1&&<div style={{fontSize:"0.62rem",color:C.t3}}>{tx.vout.length===2?"La otra salida de esta transacción no forma parte de lo seguido.":`Las otras ${tx.vout.length-1} salidas de esta transacción no forman parte de lo seguido.`}</div>}
{esActual&&<div style={{fontSize:"0.6rem",color:C.t3,lineHeight:1.5}}>«Por esta salida van» es un reparto proporcional por importes: una cuenta, no una conclusión sobre de quién es el dinero.</div>}
{esOrigen&&tx.vout.length>1&&<div style={{fontSize:"0.69rem",color:C.t3}}>{tx.vout.length===2?"La otra salida de esta transacción no forma parte de lo seguido.":`Las otras ${tx.vout.length-1} salidas de esta transacción no forman parte de lo seguido.`}</div>}
{esActual&&<div style={{fontSize:"0.82rem",color:C.t3,lineHeight:1.5}}>«Por esta salida van» es un reparto proporcional por importes: una cuenta, no una conclusión sobre de quién es el dinero.</div>}
{esActual&&isMobile&&<VerEnMempool base={base} tipo="tx" id={tx.txid} texto="Ver en Mempool ↗"/>}
</div>
);
@@ -130,13 +130,13 @@
const totEx = ex.reduce((s,[,v])=>s+v,0);
const chip = (t,v,col,extra) => (
<div style={{padding:"6px 10px",borderRadius:7,border:`1px solid ${col}45`,background:`${col}10`,minWidth:0}}>
<div style={{fontSize:"0.58rem",fontFamily:C.mono,color:C.t2,textTransform:"uppercase",letterSpacing:"0.08em"}}>{t}</div>
<div style={{fontSize:"0.76rem",fontFamily:C.mono,fontWeight:700,color:col}}>{btcTxt(v)}{extra&&<span style={{fontWeight:400,color:C.t2,fontSize:"0.64rem"}}> · {extra}</span>}</div>
<div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,textTransform:"uppercase",letterSpacing:"0.08em"}}>{t}</div>
<div style={{fontSize:"0.76rem",fontFamily:C.mono,fontWeight:700,color:col}}>{btcTxt(v)}{extra&&<span style={{fontWeight:400,color:C.t2,fontSize:"0.69rem"}}> · {extra}</span>}</div>
</div>
);
return (
<div style={{padding:"10px 14px",borderBottom:`1px solid ${C.border}`,flexShrink:0}}>
<div style={{fontSize:"0.64rem",color:C.t2,marginBottom:6}}>Dónde está el dinero, según lo explorado: de {btcTxt(r.total)} seguidos <span style={{color:C.t3}}>(reparto proporcional por importes: una cuenta, no una atribución)</span></div>
<div style={{fontSize:"0.69rem",color:C.t2,marginBottom:6}}>Dónde está el dinero, según lo explorado: de {btcTxt(r.total)} seguidos <span style={{color:C.t3}}>(reparto proporcional por importes: una cuenta, no una atribución)</span></div>
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}>
{chip("Sin gastar",r.sinGastar,C.green)}
{chip("Etiquetadas como exchange",totEx,C.amber,ex.length?`${ex.map(([n])=>n).join(", ")} (según la lista de la app)`:null)}
@@ -158,9 +158,9 @@
return (
<div style={{margin:"10px 14px 0",padding:"12px 14px",borderRadius:8,border:`1px solid ${C.red}55`,background:C.redMuted}}>
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(200px,1fr))",gap:10}}>
{pasos.map(([t,d],i)=>(<div key={t} style={{fontSize:"0.72rem",color:C.t1,lineHeight:1.5}}><span style={{fontFamily:C.mono,color:C.red,fontWeight:700}}>{i+1}. {t}</span> — {d}</div>))}
{pasos.map(([t,d],i)=>(<div key={t} style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.5}}><span style={{fontFamily:C.mono,color:C.red,fontWeight:700}}>{i+1}. {t}</span> — {d}</div>))}
</div>
<button onClick={onCerrar} style={{marginTop:10,fontFamily:C.mono,fontSize:"0.68rem",padding:"6px 12px",borderRadius:6,border:`1px solid ${C.red}70`,background:"none",color:C.red,cursor:"pointer"}}>Entendido</button>
<button onClick={onCerrar} style={{marginTop:10,fontFamily:C.mono,fontSize:"0.69rem",padding:"6px 12px",borderRadius:6,border:`1px solid ${C.red}70`,background:"none",color:C.red,cursor:"pointer"}}>Entendido</button>
</div>
);
}
@@ -171,20 +171,20 @@
const vig = Object.values(vigilancia).filter(v=>v.origen===per.origen.txid);
const crono = cronologiaPeritaje(per);
const coste = costeComprobacion(vig.length);
const h = (txt,color) => <div style={{fontFamily:C.mono,fontSize:"0.64rem",color:color||C.t2,textTransform:"uppercase",letterSpacing:"0.12em",marginTop:6}}>{txt}</div>;
const boton = {fontFamily:C.mono,fontSize:"0.68rem",padding:"6px 10px",borderRadius:6,border:`1px solid ${C.borderBright}`,background:"none",color:C.t2,cursor:"pointer"};
const h = (txt,color) => <div style={{fontFamily:C.mono,fontSize:"0.69rem",color:color||C.t2,textTransform:"uppercase",letterSpacing:"0.12em",marginTop:6}}>{txt}</div>;
const boton = {fontFamily:C.mono,fontSize:"0.69rem",padding:"6px 10px",borderRadius:6,border:`1px solid ${C.borderBright}`,background:"none",color:C.t2,cursor:"pointer"};
return (
<div style={{display:"flex",flexDirection:"column",gap:10}}>
<div style={{fontFamily:C.mono,fontSize:"0.7rem",color:C.amber,textTransform:"uppercase",letterSpacing:"0.12em",fontWeight:700}}>★ Mesa de trabajo</div>
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>Marcas, notas y salidas guardadas se quedan solo en este navegador (o solo en esta pestaña, con «no guardar nada»); no se envían a ningún sitio.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Marcas, notas y salidas guardadas se quedan solo en este navegador (o solo en esta pestaña, con «no guardar nada»); no se envían a ningún sitio.</div>
{h("Marcadas")}
{marcadas.length===0
? <div style={{fontSize:"0.68rem",color:C.t3,lineHeight:1.5}}>Ninguna todavía. «Marcar» guarda aquí la transacción que estás viendo, con una nota.</div>
? <div style={{fontSize:"0.82rem",color:C.t3,lineHeight:1.5}}>Ninguna todavía. «Marcar» guarda aquí la transacción que estás viendo, con una nota.</div>
: marcadas.map(([txid,m])=>{ const k=enCamino(txid); return (
<div key={txid} style={{padding:10,border:`1px solid ${C.borderBright}`,borderRadius:7,background:C.bg,display:"flex",flexDirection:"column",gap:6}}>
<div style={{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}}>
<span onClick={()=>k>=0&&onIrSalto(k)} style={{fontFamily:C.mono,fontSize:"0.72rem",color:C.t1,cursor:k>=0?"pointer":"default"}}>{abrevTxid(txid)}</span>
<span style={{fontFamily:C.mono,fontSize:"0.58rem",padding:"1px 6px",borderRadius:3,color:k>=0?C.amber:C.t3,border:`1px solid ${k>=0?C.amber:C.t3}55`}}>{k<0?"fuera de este camino":k===0?"origen":`salto ${k}`}</span>
<span style={{fontFamily:C.mono,fontSize:"0.69rem",padding:"1px 6px",borderRadius:3,color:k>=0?C.amber:C.t3,border:`1px solid ${k>=0?C.amber:C.t3}55`}}>{k<0?"fuera de este camino":k===0?"origen":`salto ${k}`}</span>
<button onClick={()=>setMesa(ms=>{const n={...ms};delete n[txid];return n;})} title="Quitar de la mesa" style={{marginLeft:"auto",background:"none",border:"none",color:C.t3,cursor:"pointer",fontSize:"0.75rem"}}>✕</button>
</div>
<textarea value={m.nota||""} rows={2} placeholder="Nota" onChange={e=>{const v=filtrarSecreto(e.target.value); setMesa(ms=>({...ms,[txid]:{...ms[txid],nota:v}}));}}
@@ -192,21 +192,21 @@
</div>); })}
{h("Salidas guardadas para revisar")}
{vig.length===0
? <div style={{fontSize:"0.68rem",color:C.t3,lineHeight:1.5}}>Ninguna. Una salida comprobada sin gastar se puede guardar aquí («○ guardar para revisar»). No avisa sola: «Comprobar de nuevo» mira si se ha movido.</div>
? <div style={{fontSize:"0.82rem",color:C.t3,lineHeight:1.5}}>Ninguna. Una salida comprobada sin gastar se puede guardar aquí («○ guardar para revisar»). No avisa sola: «Comprobar de nuevo» mira si se ha movido.</div>
: <>
{vig.map(v=>{ const last=v.checks?.[v.checks.length-1]; const res=resultadosVig[v.clave]; return (
<div key={v.clave} style={{padding:"8px 10px",border:`1px solid ${res?.movida?C.red:C.border}`,borderRadius:7,background:C.bg,fontSize:"0.66rem",color:C.t2,lineHeight:1.5}}>
<div key={v.clave} style={{padding:"8px 10px",border:`1px solid ${res?.movida?C.red:C.border}`,borderRadius:7,background:C.bg,fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>
<div><span style={{fontFamily:C.mono,color:C.t1}}>{btcTxt(v.sats)}</span> · {abrevDir(v.address)}{v.address&&!/\s/.test(v.address)&&<> <BotonCopiar texto={v.address} etiqueta="la dirección"/></>}</div>
<div>Última comprobación: {last?fechaHora(last.fecha):"—"} · {last?.estado==="gastada"?"gastada":last?.estado==="no_localizada"?"gastada, sin localizar":last?.estado==="error"?"no se pudo comprobar":"sin gastar"}</div>
{res&&<div style={{color:res.movida?C.red:C.t1,marginTop:3}}>{res.texto}</div>}
</div>); })}
<div style={{fontSize:"0.62rem",color:C.t2}}>{coste.texto}</div>
<div style={{fontSize:"0.69rem",color:C.t2}}>{coste.texto}</div>
<button disabled={ocupado} onClick={onComprobarVig} style={{...boton,alignSelf:"flex-start",color:C.green,borderColor:`${C.green}70`}}>{ocupado?"consultando…":"Comprobar de nuevo"}</button>
</>}
{h("Cronología")}
<div style={{fontSize:"0.66rem",color:C.t2,lineHeight:1.5}}>{crono.length} movimiento(s) explorado(s), en orden.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>{crono.length} movimiento(s) explorado(s), en orden.</div>
{crono.slice(-5).map((f,j)=>(
<div key={j} style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.45,borderLeft:`2px solid ${C.border}`,paddingLeft:8}}>
<div key={j} style={{fontSize:"0.69rem",color:C.t2,lineHeight:1.45,borderLeft:`2px solid ${C.border}`,paddingLeft:8}}>
<span style={{color:C.t1}}>{fechaHora(f.fecha)}</span> · <span style={{fontFamily:C.mono,color:C.t1}}>{btcTxt(f.sats)}</span><br/>
{abrevDir(f.de[0])} → {f.a.length>2?`${f.a.length} direcciones`:f.a.map(abrevDir).join(", ")} · tx {abrevCorto(f.txid)}
</div>
@@ -215,11 +215,11 @@
<button onClick={()=>onExportarCrono("md")} style={boton} title="Texto con formato Markdown: se abre con cualquier editor de texto">↓ Cronología, texto (.md)</button>
<button onClick={()=>onExportarCrono("csv")} style={boton} title="Tabla para una hoja de cálculo">↓ Cronología, hoja de cálculo (.csv)</button>
</div>
<div style={{fontSize:"0.6rem",color:C.t3,lineHeight:1.5}}>Lo que descargues lleva dentro direcciones y txids. Hasta ahora nada ha salido de tu red; a partir de aquí depende de ti.</div>
<div style={{fontSize:"0.82rem",color:C.t3,lineHeight:1.5}}>Lo que descargues lleva dentro direcciones y txids. Hasta ahora nada ha salido de tu red; a partir de aquí depende de ti.</div>
{h("Informe de seguimiento")}
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>Con lo explorado hasta ahora: alcance, conclusiones, hechos e inferencias separados, cronología y lo apuntado en esta mesa (tus notas van dentro).</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Con lo explorado hasta ahora: alcance, conclusiones, hechos e inferencias separados, cronología y lo apuntado en esta mesa (tus notas van dentro).</div>
<button onClick={onInforme} disabled={per.abiertas.size<2} style={{...boton,alignSelf:"flex-start",color:C.purple,borderColor:`${C.purple}70`,opacity:per.abiertas.size<2?0.5:1}}>Generar el informe de seguimiento</button>
{per.abiertas.size<2&&<div style={{fontSize:"0.6rem",color:C.t3}}>Se activa en cuanto sigas al menos un salto.</div>}
{per.abiertas.size<2&&<div style={{fontSize:"0.69rem",color:C.t3}}>Se activa en cuanto sigas al menos un salto.</div>}
</div>
);
}
@@ -376,7 +376,7 @@
<div style={{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",borderBottom:`1px solid ${C.border}`,background:C.headerBg||C.bg,flexWrap:"wrap"}}>
<span style={{fontFamily:C.serif||C.mono,fontSize:C.serif?"1rem":"0.78rem",color:C.red,fontWeight:700,letterSpacing:C.serif?"0.01em":"0.08em",textTransform:C.serif?"none":"uppercase"}}>Destino · ¿a dónde fue?</span>
{demo&&<Badge color={C.amber}>EJEMPLO</Badge>}
<span title="Peticiones hechas a tu nodo en este seguimiento" style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2,border:`1px solid ${C.border}`,borderRadius:12,padding:"3px 9px"}}>{per.consultas} {per.consultas===1?"consulta":"consultas"} a tu nodo</span>
<span title="Peticiones hechas a tu nodo en este seguimiento" style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2,border:`1px solid ${C.border}`,borderRadius:12,padding:"3px 9px"}}>{per.consultas} {per.consultas===1?"consulta":"consultas"} a tu nodo</span>
<button onClick={onCerrar} style={{...boton,marginLeft:"auto"}}>✕ Cerrar</button>
</div>
<div ref={migasRef} style={{display:"flex",gap:6,alignItems:"center",overflowX:"auto",padding:"10px 14px",borderBottom:`1px solid ${C.border}`,flexShrink:0}}>
@@ -384,14 +384,14 @@
<React.Fragment key={`${k}-${h.txid}`}>
{k>0&&<span style={{color:C.t3}}>›</span>}
<button data-actual={k===actual?"si":"no"} onClick={()=>setActual(k)}
style={{fontFamily:C.mono,fontSize:"0.68rem",padding:"5px 10px",borderRadius:14,whiteSpace:"nowrap",cursor:"pointer",flexShrink:0,border:`1px solid ${k===actual?C.red:C.borderBright}`,background:k===actual?C.redMuted:"none",color:k===actual?C.red:C.t2,fontWeight:k===actual?700:400}}>
style={{fontFamily:C.mono,fontSize:"0.69rem",padding:"5px 10px",borderRadius:14,whiteSpace:"nowrap",cursor:"pointer",flexShrink:0,border:`1px solid ${k===actual?C.red:C.borderBright}`,background:k===actual?C.redMuted:"none",color:k===actual?C.red:C.t2,fontWeight:k===actual?700:400}}>
{k===0?"Origen":`Salto ${k}`} · {abrevCorto(h.txid)}
</button>
</React.Fragment>
))}
</div>
<ResumenDinero r={resumen}/>
{demo&&<div style={{padding:"6px 14px",fontSize:"0.64rem",color:C.amber,borderBottom:`1px solid ${C.border}`}}>Sin nodo: un robo inventado para que veas cómo funciona. En el ejemplo cada comprobación cuenta como una consulta y el tope es de {per.maxSaltos} saltos.</div>}
{demo&&<div style={{padding:"6px 14px",fontSize:"0.69rem",color:C.amber,borderBottom:`1px solid ${C.border}`}}>Sin nodo: un robo inventado para que veas cómo funciona. En el ejemplo cada comprobación cuenta como una consulta y el tope es de {per.maxSaltos} saltos.</div>}
{guia&&<GuiaPeritaje onCerrar={()=>{setGuia(false);ALMACEN.set("peritaje-guia",true);}}/>}
{aviso&&<div style={{margin:"10px 14px 0",padding:"8px 12px",borderRadius:6,background:C.amberMuted,border:`1px solid ${C.amber}55`,color:C.amber,fontSize:"0.7rem"}}>{aviso}</div>}
{!isMobile ? (
+6 -6
View File
@@ -22,21 +22,21 @@
setBusy(false);
};
if (tx) return esTxCoinbase(tx)
? <Card><div style={{fontSize:"0.72rem",color:C.t1,lineHeight:1.6}}>Esta transacción crea monedas nuevas (es la recompensa de un minero): no viene de ninguna anterior, así que no hay procedencia que seguir.</div>
<button onClick={()=>setTx(null)} style={{marginTop:10,padding:"7px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer"}}>‹ Otra transacción</button></Card>
? <Card><div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>Esta transacción crea monedas nuevas (es la recompensa de un minero): no viene de ninguna anterior, así que no hay procedencia que seguir.</div>
<button onClick={()=>setTx(null)} style={{marginTop:10,padding:"7px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>‹ Otra transacción</button></Card>
: <RastroTrabajo origen={tx} base={base} onCerrar={()=>setTx(null)} onAuditar={onAuditar}/>;
return (
<Card>
<div style={{fontSize:"0.72rem",color:C.t1,lineHeight:1.6,marginBottom:10}}>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6,marginBottom:10}}>
Pega el txid de una transacción (por ejemplo, un pago que recibiste) y sigue <strong>hacia atrás</strong> de dónde vino el dinero, un salto cada vez. Antes de elegir cada entrada ves sus pistas; cada consulta a tu nodo la pides tú.
</div>
{demo&&<div style={{padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}55`,borderRadius:6,color:C.t1,fontSize:"0.7rem",lineHeight:1.55,marginBottom:8}}>Sin nodo se abre un ejemplo para ver cómo funciona.</div>}
{demo&&<div style={{padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}55`,borderRadius:6,color:C.t1,fontSize:"0.82rem",lineHeight:1.55,marginBottom:8}}>Sin nodo se abre un ejemplo para ver cómo funciona.</div>}
<div style={{display:"flex",gap:8,flexWrap:"wrap",opacity:demo?0.45:1}}>
<input value={txid} onChange={e=>setTxid(filtrarSecreto(e.target.value))} disabled={demo} placeholder={demo?"(no se usa en el ejemplo)":"txid de la transacción"}
style={{flex:"3 1 220px",minWidth:0,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"10px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.72rem",outline:"none"}}/>
{!demo&&<BotonQR campo="txid" color={C.purple} onLeido={v=>setTxid(v)}/>}
</div>
{error&&<div style={{marginTop:8,fontSize:"0.68rem",color:C.red,lineHeight:1.5}}>{error}</div>}
{error&&<div style={{marginTop:8,fontSize:"0.82rem",color:C.red,lineHeight:1.5}}>{error}</div>}
<button onClick={abrir} disabled={busy} style={{marginTop:10,padding:"9px 16px",background:C.purpleMuted,border:`1px solid ${C.purple}55`,borderRadius:6,color:C.purple,fontFamily:C.mono,fontSize:"0.72rem",cursor:"pointer",fontWeight:700}}>
{busy?"consultando…":demo?"Abrir el ejemplo ›":"Empezar (1 consulta) ›"}
</button>
@@ -50,7 +50,7 @@
return (
<div style={{display:"flex",flexDirection:"column",gap:12}}>
<SectionTitle accent={C.red} icon="⇄">Seguimiento de fondos</SectionTitle>
<div style={{fontSize:"0.7rem",color:C.t2,lineHeight:1.6,marginTop:-6}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6,marginTop:-6}}>
Dos preguntas distintas sobre el mismo dinero. <strong style={{color:C.t1}}>Procedencia</strong>: de dónde vino (hacia atrás, a transacciones más antiguas). <strong style={{color:C.t1}}>Destino</strong>: a dónde fue (hacia delante, a transacciones más recientes), por ejemplo tras un robo o una pérdida. Ninguna explora sola: cada paso lo das tú.
</div>
<Segmentos color={C.red} valor={modo} onCambio={cambiar}
+23 -23
View File
@@ -90,12 +90,12 @@
const campo = { background: C.bg, border: `1px solid ${C.borderBright}`, borderRadius: 6, padding: "8px 10px", color: C.t1, fontFamily: C.mono, fontSize: "0.7rem", outline: "none", minWidth: 0 };
return (
<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 }}>
<div style={{ fontSize: "0.69rem", color: C.amber, fontFamily: C.mono, fontWeight: 700, marginBottom: 6 }}>¿QUÉ REVELARÍA ESTE GASTO?</div>
<div style={{ fontSize: "0.82rem", 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. 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 }}>
<div style={{ fontSize: "0.82rem", color: C.t2, lineHeight: 1.6, padding: "8px 10px", border: `1px dashed ${C.border}`, borderRadius: 6 }}>
{walletReport && walletReport.error
? "El informe de la wallet dio error, así que no hay monedas que elegir. Cuando «Analizar wallet» termine bien, aparecerán aquí."
: walletAddrs
@@ -106,31 +106,31 @@
</div>
) : (<>
{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 }}>
<div style={{ fontSize: "0.82rem", 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ó. 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>
<div style={{ fontSize: "0.69rem", color: C.t2, marginBottom: 8 }}>No se ve ninguna moneda sin gastar en las direcciones analizadas.</div>
) : (
<div style={{ marginBottom: 10 }}>
<div style={{ fontSize: "0.58rem", color: C.t2, fontFamily: C.mono, marginBottom: 6 }}>TUS MONEDAS SIN GASTAR · {utxos.length}{marcadas.size ? ` · ${marcadas.size} marcada${marcadas.size > 1 ? "s" : ""} (${fmtBtc(totalElegido)})` : ""}</div>
<div style={{ fontSize: "0.69rem", color: C.t2, fontFamily: C.mono, marginBottom: 6 }}>TUS MONEDAS SIN GASTAR · {utxos.length}{marcadas.size ? ` · ${marcadas.size} marcada${marcadas.size > 1 ? "s" : ""} (${fmtBtc(totalElegido)})` : ""}</div>
<div style={{ display: "flex", flexDirection: "column", gap: 4, maxHeight: 260, overflowY: "auto" }}>
{utxos.map(m => {
const k = clave(m), on = marcadas.has(k), lbl = etiquetaDe(m), gr = grupoDe(m.address), rama = myAddr(m.address);
return (
<label key={k} style={{ display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap", padding: "6px 9px", background: on ? C.amberMuted : C.bgCard, border: `1px solid ${on ? C.amber : C.border}`, borderRadius: 5, cursor: "pointer" }}>
<input type="checkbox" checked={on} onChange={() => alternar(m)} />
<span style={{ fontSize: "0.68rem", color: C.t1, fontFamily: C.mono, minWidth: 110 }}>{fmtBtc(m.value)}</span>
<span style={{ fontSize: "0.6rem", color: C.t2, fontFamily: C.mono, display: "inline-flex", alignItems: "center", gap: 4 }}>{abrevDirSim(m.address)} <BotonCopiar texto={m.address} etiqueta="la dirección" /></span>
{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>}
{!m.confirmada && <span style={{ fontSize: "0.56rem", color: C.t3, fontFamily: C.mono }}>sin confirmar</span>}
<span style={{ fontSize: "0.69rem", color: C.t1, fontFamily: C.mono, minWidth: 110 }}>{fmtBtc(m.value)}</span>
<span style={{ fontSize: "0.69rem", color: C.t2, fontFamily: C.mono, display: "inline-flex", alignItems: "center", gap: 4 }}>{abrevDirSim(m.address)} <BotonCopiar texto={m.address} etiqueta="la dirección" /></span>
{rama && <span style={{ fontSize: "0.69rem", color: C.t3, fontFamily: C.mono }}>{rama}</span>}
{lbl && <span style={{ fontSize: "0.69rem", color: C.purple, fontFamily: C.mono }}>🏷 {lbl}</span>}
<span style={{ fontSize: "0.69rem", 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.69rem", color: C.amber, fontFamily: C.mono }}>¿polvo?</span>}
{!m.confirmada && <span style={{ fontSize: "0.69rem", color: C.t3, fontFamily: C.mono }}>sin confirmar</span>}
</label>);
})}
</div>
{clusters.length > 0 && <div style={{ fontSize: "0.58rem", color: C.t3, marginTop: 4 }}>«grupo N» es el grupo de direcciones vinculadas N del informe de arriba; «suelta», una dirección que no está vinculada con otras.</div>}
{clusters.length > 0 && <div style={{ fontSize: "0.69rem", color: C.t3, marginTop: 4 }}>«grupo N» es el grupo de direcciones vinculadas N del informe de arriba; «suelta», una dirección que no está vinculada con otras.</div>}
</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)); invalidar(); }} placeholder="Dirección de destino" spellCheck={false} autoComplete="off" style={{ ...campo, gridColumn: "1 / -1" }} />
@@ -139,40 +139,40 @@
</div>
<div style={{ display: "flex", gap: 8, flexWrap: "wrap" }}>
<button onClick={simular} disabled={cargando || !marcadas.size || !destino.trim()}
style={{ padding: "7px 16px", background: C.amberMuted, border: `1px solid ${C.amber}60`, borderRadius: 6, color: C.amber, fontFamily: C.mono, fontSize: "0.68rem", fontWeight: 700, cursor: cargando || !marcadas.size || !destino.trim() ? "default" : "pointer", opacity: !marcadas.size || !destino.trim() ? 0.6 : 1 }}>
style={{ padding: "7px 16px", background: C.amberMuted, border: `1px solid ${C.amber}60`, borderRadius: 6, color: C.amber, fontFamily: C.mono, fontSize: "0.69rem", fontWeight: 700, cursor: cargando || !marcadas.size || !destino.trim() ? "default" : "pointer", opacity: !marcadas.size || !destino.trim() ? 0.6 : 1 }}>
{cargando ? "···" : "Simular"}
</button>
<button onClick={limpiar} style={{ padding: "7px 14px", background: "none", border: `1px solid ${C.border}`, borderRadius: 6, color: C.t2, fontFamily: C.mono, fontSize: "0.66rem", cursor: "pointer" }}>Limpiar</button>
{(!marcadas.size || !destino.trim()) && <span style={{ fontSize: "0.6rem", color: C.t3, alignSelf: "center" }}>Hace falta al menos una moneda marcada y un destino.</span>}
<button onClick={limpiar} style={{ padding: "7px 14px", background: "none", border: `1px solid ${C.border}`, borderRadius: 6, color: C.t2, fontFamily: C.mono, fontSize: "0.69rem", cursor: "pointer" }}>Limpiar</button>
{(!marcadas.size || !destino.trim()) && <span style={{ fontSize: "0.69rem", color: C.t3, alignSelf: "center" }}>Hace falta al menos una moneda marcada y un destino.</span>}
</div>
</>)}
{res && res.error && (
<div style={{ marginTop: 10, padding: "8px 12px", background: C.redMuted, border: `1px solid ${C.red}30`, borderRadius: 6, color: C.red, fontSize: "0.68rem", lineHeight: 1.5 }}>{res.error}</div>)}
<div style={{ marginTop: 10, padding: "8px 12px", background: C.redMuted, border: `1px solid ${C.red}30`, borderRadius: 6, color: C.red, fontSize: "0.82rem", lineHeight: 1.5 }}>{res.error}</div>)}
{res && res.sim && (
<div style={{ marginTop: 12 }}>
<div style={{ padding: "10px 14px", border: `2px dashed ${C.amber}`, borderRadius: 8, background: C.amberMuted, color: C.amber, fontFamily: C.mono, fontWeight: 700, fontSize: "0.78rem", letterSpacing: "0.08em", textAlign: "center", marginBottom: 10 }}>
SIMULACIÓN · no es una transacción real
<div style={{ fontSize: "0.6rem", fontWeight: 400, letterSpacing: 0, marginTop: 3 }}>No tiene firmas ni txid, no se ha enviado a ninguna parte y no se guarda.</div>
<div style={{ fontSize: "0.69rem", fontWeight: 400, letterSpacing: 0, marginTop: 3 }}>No tiene firmas ni txid, no se ha enviado a ninguna parte y no se guarda.</div>
</div>
{(() => { 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 style={{ fontSize: "0.82rem", 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> (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>}
<div>Comisión estimada: {fmtEnt(s.fee)} sat, unos {fmtEnt(s.vsize)} vB a {fmtDec(s.tarifa, s.tarifa % 1 ? 2 : 0)} sat/vB ({res.tarifaInfo}).</div>
<div style={{ fontSize: "0.6rem", color: C.t2, marginTop: 4 }}>Tamaño aproximado: cabecera {s.vbytes.cabecera} vB + entradas {s.vbytes.entradas.join(" + ")} vB + salidas {s.vbytes.salidas.join(" + ")} vB. La firma real puede variar un byte arriba o abajo.{s.entradaDesconocida ? " Alguna entrada es de un formato del que la app no sabe el tamaño: se ha contado como antigua (148 vB)." : ""}</div>
<div style={{ fontSize: "0.69rem", color: C.t2, marginTop: 4 }}>Tamaño aproximado: cabecera {s.vbytes.cabecera} vB + entradas {s.vbytes.entradas.join(" + ")} vB + salidas {s.vbytes.salidas.join(" + ")} vB. La firma real puede variar un byte arriba o abajo.{s.entradaDesconocida ? " Alguna entrada es de un formato del que la app no sabe el tamaño: se ha contado como antigua (148 vB)." : ""}</div>
</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 AÑADE TU WALLET (y no ve el análisis de una sola transacción)</div>
<div style={{ fontSize: "0.69rem", 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" }}>
<CertaintyBadge level={h.certeza} />
<span style={{ fontSize: "0.68rem", color: C.t1, lineHeight: 1.55, flex: 1, minWidth: 200 }}>{h.texto}</span>
<span style={{ fontSize: "0.82rem", color: C.t1, lineHeight: 1.55, flex: 1, minWidth: 200 }}>{h.texto}</span>
</div>))}
</div>
</div>)}
+96 -96
View File
@@ -27,8 +27,8 @@
};
const eur = sats => fmtMoneda(sats / 1e8 * estado.precio) + " €";
return (
<div style={{marginTop:8,fontSize:"0.66rem",fontFamily:C.mono,color:C.t2,lineHeight:1.6}}>
{estado === null && <button onClick={pedir} style={{background:"none",border:`1px solid ${C.border}`,borderRadius:4,padding:"3px 8px",color:C.t2,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer"}}>€ Ver importes en euros</button>}
<div style={{marginTop:8,fontSize:"0.82rem",fontFamily:C.mono,color:C.t2,lineHeight:1.6}}>
{estado === null && <button onClick={pedir} style={{background:"none",border:`1px solid ${C.border}`,borderRadius:4,padding:"3px 8px",color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>€ Ver importes en euros</button>}
{estado === "cargando" && <span>Pidiendo el precio a tu nodo…</span>}
{estado && estado.error && <span style={{color:C.amber}}>Sin euros: {estado.error}.</span>}
{estado && estado.precio && (
@@ -351,27 +351,27 @@
<button onClick={()=>{setShowWalletPanel(!showWalletPanel);setShowLabelModal(false);}}
style={{textAlign:"left",padding:"12px 14px",background:walletAddrs||showWalletPanel?C.greenMuted:C.bgCard,border:`1px solid ${C.green}${walletAddrs||showWalletPanel?"":"60"}`,borderRadius:8,cursor:"pointer"}}>
<div style={{color:C.green,fontWeight:700,fontSize:"0.82rem",marginBottom:3}}>{walletAddrs?"✓ Wallet cargada":"Cargar mi wallet (descriptor o xpub)"}</div>
<div style={{color:C.t2,fontSize:"0.68rem",lineHeight:1.45}}>{walletAddrs?`${walletAddrs.receive.length+walletAddrs.change.length} direcciones calculadas. Pulsa para verlas o cambiarla.`:"Para que la app sepa qué direcciones son tuyas. Solo la clave pública."}</div>
<div style={{color:C.t2,fontSize:"0.69rem",lineHeight:1.45}}>{walletAddrs?`${walletAddrs.receive.length+walletAddrs.change.length} direcciones calculadas. Pulsa para verlas o cambiarla.`:"Para que la app sepa qué direcciones son tuyas. Solo la clave pública."}</div>
</button>
<button onClick={()=>{setShowLabelModal(!showLabelModal);setShowWalletPanel(false);}}
style={{textAlign:"left",padding:"12px 14px",background:labels.size>0||showLabelModal?C.blueMuted:C.bgCard,border:`1px solid ${C.blue}${labels.size>0||showLabelModal?"":"60"}`,borderRadius:8,cursor:"pointer"}}>
<div style={{color:C.blue,fontWeight:700,fontSize:"0.82rem",marginBottom:3}}>{labels.size>0?`✓ ${labels.size} etiquetas`:"Importar etiquetas (Sparrow)"}</div>
<div style={{color:C.t2,fontSize:"0.68rem",lineHeight:1.45}}>{labels.size>0?"Pulsa para ver o cambiar el archivo.":"Archivo de etiquetas exportado de Sparrow: pone nombre a tus direcciones."}</div>
<div style={{color:C.t2,fontSize:"0.69rem",lineHeight:1.45}}>{labels.size>0?"Pulsa para ver o cambiar el archivo.":"Archivo de etiquetas exportado de Sparrow: pone nombre a tus direcciones."}</div>
</button>
</div>
{showWalletPanel&&(
<Card glow={C.green} innerRef={walletRef}>
<div style={{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:10}}>
<div style={{fontSize:"0.65rem",color:C.green,fontFamily:C.mono,fontWeight:700}}>WALLET EN SOLO LECTURA (descriptor o xpub)</div>
<div style={{fontSize:"0.69rem",color:C.green,fontFamily:C.mono,fontWeight:700}}>WALLET EN SOLO LECTURA (descriptor o xpub)</div>
<button onClick={()=>setShowWalletPanel(false)} style={{background:"none",border:"none",color:C.t2,cursor:"pointer",fontSize:"1rem"}}>×</button>
</div>
{!paginaSegura&&<div style={{fontSize:"0.7rem",color:C.red,marginBottom:10,padding:"8px 10px",background:C.redMuted,border:`1px solid ${C.red}40`,borderRadius:6,lineHeight:1.55}}>
{!paginaSegura&&<div style={{fontSize:"0.82rem",color:C.red,marginBottom:10,padding:"8px 10px",background:C.redMuted,border:`1px solid ${C.red}40`,borderRadius:6,lineHeight:1.55}}>
<strong>Así no se puede cargar la wallet:</strong> esta página está abierta por http. Ábrela por https, en <span style={{fontFamily:C.mono}}>https://IP-DE-TU-NODO:4083/</span>, y pon también la URL https en ⚙ Ajustes.
</div>}
<div style={{fontSize:"0.68rem",color:C.t2,marginBottom:8}}>
<div style={{fontSize:"0.69rem",color:C.t2,marginBottom:8}}>
Pega el descriptor de tu wallet o su clave pública (empieza por xpub, ypub o zpub). <strong style={{color:C.green}}>Recomendado: el descriptor</strong>, porque dice él mismo qué tipo de direcciones usa la wallet; una xpub suelta no lo dice, y hay que elegirlo o buscarlo. <strong style={{color:C.t1}}>Nunca las 12 o 24 palabras</strong>: con la clave pública se ven tus direcciones, pero no se puede gastar. Las direcciones se calculan en tu navegador; la clave no se envía a ninguna parte.
<button onClick={()=>setVerDondeClave(!verDondeClave)} style={{marginLeft:6,background:"none",border:"none",color:C.green,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer",padding:0,textDecoration:"underline"}}>{verDondeClave?"ocultar":"¿dónde la encuentro?"}</button>
<button onClick={()=>setVerDondeClave(!verDondeClave)} style={{marginLeft:6,background:"none",border:"none",color:C.green,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",padding:0,textDecoration:"underline"}}>{verDondeClave?"ocultar":"¿dónde la encuentro?"}</button>
{verDondeClave&&(
<div style={{marginTop:6,padding:"8px 10px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,lineHeight:1.65}}>
<div><strong style={{color:C.t1}}>Sparrow:</strong> abre la wallet → pestaña Settings → en Keystores, el campo xpub/zpub (Master Public Key). O el descriptor: menú File → Export Wallet → Output Descriptor; se guarda un archivo de texto que empieza por «# Receive and change descriptor:» y sigue con wpkh([…: pega el archivo entero (las líneas con # se ignoran).</div>
@@ -389,7 +389,7 @@
por cada una. Quien opere el nodo ve la wallet entera. En una
herramienta que existe para no afirmar de más, esa media
verdad era el peor sitio posible para tenerla. */}
<div style={{fontSize:"0.66rem",color:C.t2,marginBottom:12,padding:"8px 10px",background:C.bgCard,border:`1px solid ${C.amber}40`,borderRadius:6,lineHeight:1.55}}>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:12,padding:"8px 10px",background:C.bgCard,border:`1px solid ${C.amber}40`,borderRadius:6,lineHeight:1.55}}>
<span style={{color:C.amber,fontWeight:700}}>Antes de seguir:</span> el xpub se queda aquí, pero para saber qué ha pasado con tus direcciones hay que <strong>preguntarle al nodo por cada una</strong>. Quien opere ese nodo puede ver, en sus registros, la wallet completa que estás analizando: cuántas direcciones tienes, cuáles, su historial y su saldo.
<div style={{marginTop:5}}>
Si el nodo es <strong>tuyo</strong>, no hay problema: es tu propia información en tu propia máquina. Si es el nodo <strong>de otra persona</strong>, aunque sea alguien de confianza, le estás enseñando tus finanzas enteras.
@@ -397,8 +397,8 @@
</div>
{walletAddrs?(
<div>
<div style={{fontSize:"0.65rem",color:C.green,fontFamily:C.mono,marginBottom:6}}>✓ {walletAddrs.receive.length} direcciones de recepción y {walletAddrs.change.length} de cambio calculadas</div>
<div style={{fontSize:"0.64rem",color:C.t2,marginBottom:8,lineHeight:1.55}}>
<div style={{fontSize:"0.69rem",color:C.green,fontFamily:C.mono,marginBottom:6}}>✓ {walletAddrs.receive.length} direcciones de recepción y {walletAddrs.change.length} de cambio calculadas</div>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:8,lineHeight:1.55}}>
Tipo de dirección: <strong style={{color:C.t1}}>{TIPO_SCRIPT[walletAddrs.script]||walletAddrs.script}</strong>
{walletAddrs.descriptor
? <> · lo dice el descriptor.</>
@@ -407,7 +407,7 @@
: walletAddrs.tipo==="xpub"||walletAddrs.tipo==="tpub" ? <> · elegido por ti.</> : <> · lo indica el prefijo {walletAddrs.tipo}.</>}
</div>
{walletAddrs.descriptor&&(
<div style={{fontSize:"0.64rem",color:C.t2,marginBottom:8,lineHeight:1.55}}>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:8,lineHeight:1.55}}>
{walletAddrs.descriptor.huella
? <>Datos del descriptor: huella de la clave maestra <span style={{fontFamily:C.mono,color:C.t1}}>{walletAddrs.descriptor.huella}</span> (en inglés, fingerprint){walletAddrs.descriptor.ruta&&walletAddrs.descriptor.ruta!=="m"?<> y ruta <span style={{fontFamily:C.mono,color:C.t1}}>{walletAddrs.descriptor.ruta}</span></>:null}. Solo informativo: la app no los comprueba.</>
: <>El descriptor no trae origen ([huella/ruta]).</>}
@@ -424,7 +424,7 @@
<div style={{display:"flex",gap:6,flexWrap:"wrap",marginBottom:8}}>
{["p2wpkh","p2tr","p2sh-p2wpkh","p2pkh"].map(t=>(
<button key={t} onClick={()=>loadWallet(t)} disabled={xpubLoading}
style={{padding:"4px 10px",background:walletAddrs.script===t?C.greenMuted:"none",border:`1px solid ${walletAddrs.script===t?C.green:C.border}`,borderRadius:5,color:walletAddrs.script===t?C.green:C.t2,fontFamily:C.mono,fontSize:"0.62rem",cursor:"pointer"}}>
style={{padding:"4px 10px",background:walletAddrs.script===t?C.greenMuted:"none",border:`1px solid ${walletAddrs.script===t?C.green:C.border}`,borderRadius:5,color:walletAddrs.script===t?C.green:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>
{TIPO_SCRIPT[t]}
</button>))}
</div>)}
@@ -433,68 +433,68 @@
<div style={{marginBottom:10}}>
<div style={{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"}}>
<button onClick={buscarTipo} disabled={!base||(tipoDet&&tipoDet.estado==="buscando")}
style={{padding:"5px 12px",background:"none",border:`1px solid ${C.purple}70`,borderRadius:5,color:base?C.purple:C.t2,fontFamily:C.mono,fontSize:"0.64rem",cursor:base?"pointer":"default",fontWeight:700}}>
style={{padding:"5px 12px",background:"none",border:`1px solid ${C.purple}70`,borderRadius:5,color:base?C.purple:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:base?"pointer":"default",fontWeight:700}}>
{tipoDet&&tipoDet.estado==="buscando"?"···":"⌕ Buscar el tipo en mi nodo"}
</button>
<span style={{flex:1,minWidth:200,fontSize:"0.62rem",color:C.t2,lineHeight:1.5}}>
<span style={{flex:1,minWidth:200,fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>
{base
? <>¿No sabes cuál es? Esto pregunta {RED.signet?"al servidor de signet":"a tu nodo"} por las primeras {DETECCION_RECEPCION+DETECCION_CAMBIO} direcciones de cada tipo ({DETECCION_CONSULTAS} consultas) y te dice en cuál hay movimientos.</>
: <>Para buscar el tipo hace falta un nodo al que preguntar (⚙ Ajustes).</>}
</span>
</div>
{tipoDet&&tipoDet.estado==="buscando"&&(
<div style={{marginTop:6,fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{tipoDet.hechas===0?"Calculando las direcciones de los cuatro tipos…":<>Preguntando por las direcciones de los cuatro tipos… {tipoDet.hechas} de {tipoDet.total}</>}</div>)}
<div style={{marginTop:6,fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{tipoDet.hechas===0?"Calculando las direcciones de los cuatro tipos…":<>Preguntando por las direcciones de los cuatro tipos… {tipoDet.hechas} de {tipoDet.total}</>}</div>)}
{tipoDet&&tipoDet.estado==="error"&&(
<div style={{marginTop:6,fontSize:"0.62rem",color:C.red,fontFamily:C.mono}}>No se pudo buscar: {tipoDet.mensaje}</div>)}
<div style={{marginTop:6,fontSize:"0.69rem",color:C.red,fontFamily:C.mono}}>No se pudo buscar: {tipoDet.mensaje}</div>)}
{tipoDet&&tipoDet.estado==="hecho"&&(()=>{
const d = textoDeteccion(tipoDet.res, walletAddrs.script, TIPO_SCRIPT);
const col = d.tono==="ok"?C.green:d.tono==="aviso"?C.amber:C.t2;
const otros = tipoDet.res.conActividad.filter(t=>t!==walletAddrs.script);
return (
<div data-deteccion={tipoDet.res.clase} style={{marginTop:8,padding:"9px 11px",border:`1px solid ${col}60`,borderRadius:6,background:C.bgCard}}>
<div style={{fontSize:"0.68rem",color:col,fontWeight:700,marginBottom:4}}>{d.titulo}</div>
<div style={{fontSize:"0.64rem",color:C.t1,lineHeight:1.6}}>{d.texto}</div>
<div style={{fontSize:"0.69rem",color:col,fontWeight:700,marginBottom:4}}>{d.titulo}</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>{d.texto}</div>
{otros.length>0&&(
<div style={{display:"flex",gap:6,flexWrap:"wrap",marginTop:8}}>
{otros.map(t=>(
<button key={t} onClick={()=>loadWallet(t)} disabled={xpubLoading}
style={{padding:"5px 12px",background:C.greenMuted,border:`1px solid ${C.green}70`,borderRadius:5,color:C.green,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer",fontWeight:700}}>
style={{padding:"5px 12px",background:C.greenMuted,border:`1px solid ${C.green}70`,borderRadius:5,color:C.green,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",fontWeight:700}}>
Cargar como {TIPO_SCRIPT[t]}
</button>))}
</div>)}
<div style={{marginTop:7,fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{marginTop:7,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
Direcciones con movimientos, de las que respondió el nodo: {tipoDet.res.tipos.map(t=>`${TIPO_SCRIPT[t.script]} ${t.conActividad}/${t.miradas}${t.fallos?` (${t.fallos} sin respuesta)`:""}`).join(" · ")}
</div>
</div>);
})()}
</div>)}
{(walletAddrs.avisos||[]).map((a,i)=>(
<div key={i} style={{fontSize:"0.64rem",color:C.amber,marginBottom:8,padding:"6px 9px",border:`1px solid ${C.amber}40`,borderRadius:6,lineHeight:1.5}}>⚠ {a}</div>))}
<div style={{fontSize:"0.62rem",color:C.t2,marginBottom:8}}>Antes de seguir, compara estas direcciones con las de tu wallet. Si coinciden, Txoko las marcará como tuyas en cada transacción que analices:</div>
<div key={i} style={{fontSize:"0.82rem",color:C.amber,marginBottom:8,padding:"6px 9px",border:`1px solid ${C.amber}40`,borderRadius:6,lineHeight:1.5}}>⚠ {a}</div>))}
<div style={{fontSize:"0.69rem",color:C.t2,marginBottom:8}}>Antes de seguir, compara estas direcciones con las de tu wallet. Si coinciden, Txoko las marcará como tuyas en cada transacción que analices:</div>
<div style={{display:"flex",flexDirection:"column",gap:3,marginBottom:6}}>
{(walletAddrs.receive.length?walletAddrs.receive:walletAddrs.change).slice(0,3).map((a,i)=>{ const pre = prefijoDireccion(a); return (
<div key={i} style={{fontSize:"0.6rem",fontFamily:C.mono,color:C.t1,wordBreak:"break-all"}}>
<div key={i} style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t1,wordBreak:"break-all"}}>
<span style={{color:C.t2}}>{walletAddrs.receive.length?"recepción":"cambio"} {i}:</span> <strong style={{color:C.green,fontSize:"0.7rem"}}>{pre}</strong>{a.slice(pre.length)}
</div>
); })}
</div>
{/* v2.1.1 (X1): cómo empiezan, a la vista: es lo primero que delata un tipo equivocado. */}
<div data-prefijo="1" style={{fontSize:"0.62rem",color:C.t2,marginBottom:10,lineHeight:1.5}}>
<div data-prefijo="1" style={{fontSize:"0.82rem",color:C.t2,marginBottom:10,lineHeight:1.5}}>
Empiezan por <strong style={{color:C.green,fontFamily:C.mono}}>{prefijoDireccion((walletAddrs.receive.length?walletAddrs.receive:walletAddrs.change)[0])}</strong>: son direcciones de tipo {TIPO_SCRIPT[walletAddrs.script]||walletAddrs.script}. Si las de tu wallet empiezan de otra forma, el tipo no es este.
</div>
{/* Comprobación con un sí o un no (v1.31). Evita analizar
direcciones que no son las tuyas sin darte cuenta. */}
<div ref={verifRef} style={{marginBottom:10,padding:"9px 11px",border:`1px solid ${verifWallet==="si"?C.green:verifWallet==="no"?C.amber:C.borderBright}`,borderRadius:6,background:verifWallet==="si"?C.greenMuted:verifWallet==="no"?C.amberMuted:"none"}}>
{verifWallet==="si" ? (
<div style={{fontSize:"0.66rem",color:C.green,lineHeight:1.5}}>✓ Comprobado por ti: son las direcciones de tu wallet. <button onClick={()=>setVerifWallet(null)} style={{background:"none",border:"none",color:C.t2,fontSize:"0.6rem",cursor:"pointer",textDecoration:"underline",padding:0}}>deshacer</button></div>
<div style={{fontSize:"0.82rem",color:C.green,lineHeight:1.5}}>✓ Comprobado por ti: son las direcciones de tu wallet. <button onClick={()=>setVerifWallet(null)} style={{background:"none",border:"none",color:C.t2,fontSize:"0.69rem",cursor:"pointer",textDecoration:"underline",padding:0}}>deshacer</button></div>
) : (<>
<div style={{fontSize:"0.66rem",color:C.t1,marginBottom:6}}>{walletAddrs.receive.length?<>¿La <strong>recepción 0</strong> es la primera dirección de recepción de tu wallet?</>:<>¿El <strong>cambio 0</strong> es la primera dirección de cambio de tu wallet?</>} (En Sparrow: pestaña Addresses, primera fila de Receive, la de índice 0.)</div>
<div style={{fontSize:"0.69rem",color:C.t1,marginBottom:6}}>{walletAddrs.receive.length?<>¿La <strong>recepción 0</strong> es la primera dirección de recepción de tu wallet?</>:<>¿El <strong>cambio 0</strong> es la primera dirección de cambio de tu wallet?</>} (En Sparrow: pestaña Addresses, primera fila de Receive, la de índice 0.)</div>
<div style={{display:"flex",gap:6}}>
<button onClick={()=>setVerifWallet("si")} style={{padding:"5px 14px",background:"none",border:`1px solid ${C.green}70`,borderRadius:5,color:C.green,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer"}}>Sí</button>
<button onClick={()=>setVerifWallet("no")} style={{padding:"5px 14px",background:"none",border:`1px solid ${C.amber}70`,borderRadius:5,color:C.amber,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer"}}>No</button>
<button onClick={()=>setVerifWallet("si")} style={{padding:"5px 14px",background:"none",border:`1px solid ${C.green}70`,borderRadius:5,color:C.green,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>Sí</button>
<button onClick={()=>setVerifWallet("no")} style={{padding:"5px 14px",background:"none",border:`1px solid ${C.amber}70`,borderRadius:5,color:C.amber,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>No</button>
</div>
{verifWallet==="no"&&(
<div style={{marginTop:8,fontSize:"0.64rem",color:C.t1,lineHeight:1.6}}>
<div style={{marginTop:8,fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>
{walletAddrs.descriptor
? <>La app ha calculado direcciones {TIPO_SCRIPT[walletAddrs.script]} porque es lo que dice el descriptor. Comprueba que has copiado el descriptor de esta wallet, entero, y que es el del tipo de direcciones que usa.</>
: (walletAddrs.tipo==="xpub"||walletAddrs.tipo==="tpub")
@@ -507,21 +507,21 @@
</div>
<div style={{display:"flex",gap:8,flexWrap:"wrap"}}>
<button onClick={scanWallet} disabled={walletScanning||!base}
style={{padding:"6px 14px",background:C.purpleMuted,border:`1px solid ${C.purple}60`,borderRadius:6,color:C.purple,fontFamily:C.mono,fontSize:"0.65rem",cursor:"pointer",fontWeight:700}}>
style={{padding:"6px 14px",background:C.purpleMuted,border:`1px solid ${C.purple}60`,borderRadius:6,color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",fontWeight:700}}>
{walletScanning?"···":"⊙ Analizar wallet"}
</button>
<button onClick={clearWallet} style={{padding:"6px 14px",background:"none",border:`1px solid ${C.red}40`,borderRadius:6,color:C.red,fontFamily:C.mono,fontSize:"0.65rem",cursor:"pointer"}}>
<button onClick={clearWallet} style={{padding:"6px 14px",background:"none",border:`1px solid ${C.red}40`,borderRadius:6,color:C.red,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>
Quitar la wallet de Txoko
</button>
<span style={{fontSize:"0.6rem",color:C.t2,alignSelf:"center"}}>Solo la quita de esta pestaña: tu wallet y tus fondos no se tocan.</span>
<span style={{fontSize:"0.69rem",color:C.t2,alignSelf:"center"}}>Solo la quita de esta pestaña: tu wallet y tus fondos no se tocan.</span>
</div>
<div style={{marginTop:8,fontSize:"0.64rem",color:base?C.t2:C.amber,lineHeight:1.55}}>
<div style={{marginTop:8,fontSize:"0.82rem",color:base?C.t2:C.amber,lineHeight:1.55}}>
{base
? "Siguiente paso: «Analizar wallet» pregunta a tu nodo por cada dirección calculada y arma el informe (reutilización, direcciones vinculadas, polvo, movimientos entre tus direcciones)."
: "Siguiente paso: «Analizar wallet» necesita tu nodo para consultar el historial de cada dirección. Sin nodo configurado (⚙ Ajustes) no hay a quién preguntar; las direcciones calculadas de arriba sí son reales."}
</div>
{walletScanning&&walletProgress&&(
<div style={{marginTop:8,fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{walletProgress}</div>
<div style={{marginTop:8,fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{walletProgress}</div>
)}
</div>
):(
@@ -549,8 +549,8 @@
</button>
</div>
)}
{!walletAddrs&&<div style={{marginTop:8,fontSize:"0.6rem",color:C.t2,fontFamily:C.mono}}>Cuántas direcciones calcular, de recepción y de cambio. Con 20 basta si tu wallet tiene pocos movimientos. Si has usado muchas direcciones, elige 50 o 100 para que no se quede ninguna fuera del informe (tarda un poco más).</div>}
{xpubError&&<div style={{marginTop:8,fontSize:"0.65rem",color:C.red,fontFamily:C.mono}}>{xpubError}</div>}
{!walletAddrs&&<div style={{marginTop:8,fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>Cuántas direcciones calcular, de recepción y de cambio. Con 20 basta si tu wallet tiene pocos movimientos. Si has usado muchas direcciones, elige 50 o 100 para que no se quede ninguna fuera del informe (tarda un poco más).</div>}
{xpubError&&<div style={{marginTop:8,fontSize:"0.69rem",color:C.red,fontFamily:C.mono}}>{xpubError}</div>}
</Card>
)}
@@ -558,14 +558,14 @@
<Card glow={C.purple}>
{/* Cabecera del informe con exportación */}
<div style={{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:14}}>
<div style={{fontSize:"0.65rem",color:C.purple,fontFamily:C.mono,fontWeight:700}}>INFORME DE WALLET</div>
<div style={{fontSize:"0.69rem",color:C.purple,fontFamily:C.mono,fontWeight:700}}>INFORME DE WALLET</div>
<div style={{display:"flex",gap:6}}>
<button onClick={()=>{
const {health,...rest}=walletReport;
const exportData={...rest,health:{band:health.band,msg:health.msg}};
const blob=new Blob([JSON.stringify(exportData,null,2)],{type:"application/json"});
const a=document.createElement("a");a.href=URL.createObjectURL(blob);a.download=`txoko-informe-wallet-${new Date().toISOString().slice(0,10)}.json`;a.click();
}} style={{padding:"3px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.t2,fontFamily:C.mono,fontSize:"0.6rem",cursor:"pointer"}}>↓ JSON</button>
}} style={{padding:"3px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>↓ JSON</button>
<button onClick={()=>{
const {health,totalTxs,activeCount,reusedAddrs,clusters,history,scanErrors}=walletReport;
const lines=[
@@ -593,13 +593,13 @@
];
const blob=new Blob([lines.join("\n")],{type:"text/markdown"});
const a=document.createElement("a");a.href=URL.createObjectURL(blob);a.download=`txoko-informe-wallet-${new Date().toISOString().slice(0,10)}.md`;a.click();
}} style={{padding:"3px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.t2,fontFamily:C.mono,fontSize:"0.6rem",cursor:"pointer"}}>↓ MD</button>
}} style={{padding:"3px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>↓ MD</button>
</div>
</div>
{/* v1.49.4 (auditoría B3, R-08): si dijiste que no coinciden, que se vea. */}
{verifWallet==="no"&&(
<div style={{padding:"10px 14px",background:C.amberMuted,border:`1px solid ${C.amber}60`,borderRadius:8,marginBottom:14,fontSize:"0.68rem",color:C.t1,lineHeight:1.6}}>
<div style={{padding:"10px 14px",background:C.amberMuted,border:`1px solid ${C.amber}60`,borderRadius:8,marginBottom:14,fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>
<strong style={{color:C.amber}}>⚠ Has indicado que estas direcciones no son las de tu wallet:</strong> este informe no habla de tu dinero. Revisa el tipo de dirección o la clave en el panel de la wallet.
</div>
)}
@@ -610,20 +610,20 @@
leída parece una dirección sin actividad. */}
{walletReport.scanErrors&&walletReport.scanErrors.length>0&&(
<div style={{padding:"10px 14px",background:C.redMuted,border:`1px solid ${C.red}40`,borderRadius:8,marginBottom:14}}>
<div style={{fontSize:"0.66rem",color:C.red,fontFamily:C.mono,fontWeight:700,marginBottom:6}}>
<div style={{fontSize:"0.69rem",color:C.red,fontFamily:C.mono,fontWeight:700,marginBottom:6}}>
⚠ Informe incompleto: {walletReport.scanErrors.length} consulta{walletReport.scanErrors.length===1?"":"s"} al nodo fallaron
</div>
<div style={{fontSize:"0.64rem",color:C.t1,lineHeight:1.6,marginBottom:8}}>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6,marginBottom:8}}>
Las direcciones que no se pudieron leer se comportan aquí como si no tuvieran actividad. Eso hace que la valoración de abajo sea <strong>optimista</strong>: puede faltar reutilización, vinculaciones o transacciones enteras que sí existen. No la des por buena hasta volver a pulsar «⊙ Analizar wallet» (en el panel de la wallet), mejor cuando el nodo esté menos ocupado.
</div>
<div style={{display:"flex",flexDirection:"column",gap:2}}>
{walletReport.scanErrors.slice(0,6).map((e,i)=>(
<div key={i} style={{fontSize:"0.56rem",color:C.t2,fontFamily:C.mono,wordBreak:"break-all"}}>
<div key={i} style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,wordBreak:"break-all"}}>
{e.addr} ({e.branch}) — {e.message} · {e.phase}
</div>
))}
{walletReport.scanErrors.length>6&&(
<div style={{fontSize:"0.56rem",color:C.t2,fontFamily:C.mono}}>…y {walletReport.scanErrors.length-6} más</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>…y {walletReport.scanErrors.length-6} más</div>
)}
</div>
</div>
@@ -634,23 +634,23 @@
dirección a otra no vincula nada nuevo y no merece alarma. */}
{walletReport.autoenviosDaninos && walletReport.autoenviosDaninos.length > 0 && (
<div style={{padding:"10px 14px",background:C.bgCard,border:`1px solid ${C.amber}40`,borderRadius:8,marginBottom:14}}>
<div style={{fontSize:"0.64rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:5}}>
<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:5}}>
{walletReport.autoenviosDaninos.length} movimiento{walletReport.autoenviosDaninos.length===1?"":"s"} entre tus direcciones que las dejaron vinculadas
</div>
<div style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.6,marginBottom:6}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6,marginBottom:6}}>
Estas transacciones juntaron dinero de varias direcciones tuyas en otra tuya, sin pagar a nadie. Para cualquiera que mire, esas direcciones son ahora de un mismo dueño. Es lo que pasa en toda consolidación (juntar monedas para pagar menos comisión más adelante): no es un error, pero la vinculación es permanente.
</div>
<div style={{display:"flex",flexDirection:"column",gap:3}}>
{walletReport.autoenviosDaninos.slice(0,6).map(a=>(
<div key={a.txid} style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono}}>
<div key={a.txid} style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>
<span style={{color:C.amber}}>{a.vinculadas} direcciones vinculadas</span>
{" · "}{a.time ? new Date(a.time*1000).toLocaleDateString("es-ES") : "sin confirmar"}
{" · "}<IdCopiable id={a.txid} n={12}/>{" "}<VerEnMempool base={base} tipo="tx" id={a.txid} texto="↗"/>
</div>
))}
{walletReport.autoenviosDaninos.length>6&&<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono}}>…y {walletReport.autoenviosDaninos.length-6} más</div>}
{walletReport.autoenviosDaninos.length>6&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>…y {walletReport.autoenviosDaninos.length-6} más</div>}
</div>
<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,marginTop:6,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,marginTop:6,lineHeight:1.5}}>
Están en los grupos de abajo.
</div>
</div>
@@ -665,17 +665,17 @@
<div style={{fontSize:"0.72rem",color:walletReport.health.color,fontWeight:700,marginBottom:4}}>
{walletReport.sinNota?(walletReport.health.titulo||"Sin actividad detectada"):walletReport.health.band==="ALTA"?"Sin reutilización ni vinculación":walletReport.health.band==="MEDIA"?"Algo de reutilización o vinculación":"Mucha reutilización o vinculación"}
</div>
<div style={{fontSize:"0.65rem",color:C.t2,lineHeight:1.5}}>{walletReport.health.msg}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>{walletReport.health.msg}</div>
{/* v2.1.1 (X1): sin actividad y con el tipo sin asegurar, el paso siguiente a mano. */}
{walletReport.sinNota&&walletReport.health.band==="SIN ACTIVIDAD"&&xpubSinTipo&&base&&(
<button onClick={()=>{ setShowWalletPanel(true); buscarTipo(); setTimeout(()=>{ if(walletRef.current) walletRef.current.scrollIntoView({behavior:"smooth",block:"start"}); },60); }}
style={{marginTop:7,padding:"5px 12px",background:"none",border:`1px solid ${C.purple}70`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer",fontWeight:700}}>
style={{marginTop:7,padding:"5px 12px",background:"none",border:`1px solid ${C.purple}70`,borderRadius:5,color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",fontWeight:700}}>
⌕ Buscar el tipo en mi nodo
</button>)}
{walletReport.alcance&&<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,marginTop:5}}>Alcance: {walletReport.alcance.recepcion} direcciones de recepción + {walletReport.alcance.cambio} de cambio · {TIPO_SCRIPT[walletReport.alcance.script]||walletReport.alcance.script}{walletReport.alcance.scriptSupuesto?" (supuesto)":""}{verifWallet==="si"?" · comprobado por ti":verifWallet==="no"?" · NO coincide con tu wallet":" · sin comprobar"}
{walletReport.alcance&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginTop:5}}>Alcance: {walletReport.alcance.recepcion} direcciones de recepción + {walletReport.alcance.cambio} de cambio · {TIPO_SCRIPT[walletReport.alcance.script]||walletReport.alcance.script}{walletReport.alcance.scriptSupuesto?" (supuesto)":""}{verifWallet==="si"?" · comprobado por ti":verifWallet==="no"?" · NO coincide con tu wallet":" · sin comprobar"}
{!verifWallet&&<div style={{fontFamily:"inherit",color:C.amber,marginTop:3,lineHeight:1.5}}>Sin comprobar: la app no puede saber si estas son tus direcciones; solo tú puedes, comparando la {walletAddrs&&walletAddrs.receive.length?"recepción 0":"cambio 0"} con la de tu wallet (en Sparrow, la primera de la lista). <button onClick={()=>{if(verifRef.current){verifRef.current.scrollIntoView({behavior:"smooth",block:"center"});}}} style={{background:"none",border:"none",color:C.green,fontFamily:C.mono,fontSize:"inherit",cursor:"pointer",padding:0,textDecoration:"underline"}}>confirmar ↑</button></div>}
</div>}
{(()=>{ const n=(walletReport.history||[]).filter(t=>t.confirmed===false).length; return n>0&&<div style={{fontSize:"0.62rem",color:C.amber,marginTop:4}}>{n} transacci{n===1?"ón":"ones"} todavía sin confirmar (esperando en la mempool): cuentan en el análisis, pero pueden cambiar o no llegar a confirmarse.</div>; })()}
{(()=>{ const n=(walletReport.history||[]).filter(t=>t.confirmed===false).length; return n>0&&<div style={{fontSize:"0.69rem",color:C.amber,marginTop:4}}>{n} transacci{n===1?"ón":"ones"} todavía sin confirmar (esperando en la mempool): cuentan en el análisis, pero pueden cambiar o no llegar a confirmarse.</div>; })()}
<div style={{display:"flex",gap:16,marginTop:8}}>
{[
{label:"Transacciones",v:walletReport.totalTxs},
@@ -685,7 +685,7 @@
{label:"Grupos vinculados",v:walletReport.sinNota?"—":walletReport.clusters.length,warn:walletReport.clusters.length>0},
].map(({label,v,warn})=>(
<div key={label}>
<div style={{fontSize:"0.55rem",color:C.t2,fontFamily:C.mono}}>{label}</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{label}</div>
<div style={{fontSize:"0.8rem",fontFamily:C.mono,fontWeight:700,color:warn?C.amber:C.t1}}>{v}</div>
</div>
))}
@@ -696,14 +696,14 @@
{/* v1.49.4 (auditoría B3, R-06): cuáles, no solo cuántas. */}
{walletReport.reusedAddrs.length>0&&(
<div style={{marginBottom:14}}>
<div style={{fontSize:"0.6rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:8,letterSpacing:"0.15em"}}>DIRECCIONES QUE HAN RECIBIDO MÁS DE UNA VEZ</div>
<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:8,letterSpacing:"0.15em"}}>DIRECCIONES QUE HAN RECIBIDO MÁS DE UNA VEZ</div>
<div style={{display:"flex",flexDirection:"column",gap:3}}>
{walletReport.reusedAddrs.slice(0,10).map(([a,n])=>(
<div key={a} style={{fontSize:"0.6rem",color:C.t1,fontFamily:C.mono}}>
<div key={a} style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono}}>
{labels?.get(a)&&<span style={{color:C.purple,marginRight:6}}>🏷 {labels.get(a)}</span>}
<IdCopiable id={a} tipo="direccion" texto={a.slice(0,14)+"…"+a.slice(-8)}/> <span style={{color:C.amber}}>· {n} veces</span>
</div>))}
{walletReport.reusedAddrs.length>10&&<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono}}>…y {walletReport.reusedAddrs.length-10} más</div>}
{walletReport.reusedAddrs.length>10&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>…y {walletReport.reusedAddrs.length-10} más</div>}
</div>
</div>
)}
@@ -712,38 +712,38 @@
de 1.000 sat es un ataque. */}
{walletReport.polvoSinGastar&&walletReport.polvoSinGastar.length>0&&(
<div style={{padding:"10px 14px",background:C.bgCard,border:`1px solid ${C.amber}40`,borderRadius:8,marginBottom:14}}>
<div style={{fontSize:"0.66rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:6}}>
<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:6}}>
Tienes {walletReport.polvoSinGastar.length} moneda{walletReport.polvoSinGastar.length===1?"":"s"} muy pequeña{walletReport.polvoSinGastar.length===1?"":"s"} sin gastar (posible polvo)
</div>
<div style={{fontSize:"0.64rem",color:C.t1,lineHeight:1.7,marginBottom:8}}>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.7,marginBottom:8}}>
Pueden ser un envío de polvo para rastrearte o un cambio pequeño tuyo. Mientras sigan quietas, no vinculan nada. <strong>Si algún día se gastan junto a otras monedas</strong>, todas quedarán atribuidas al mismo dueño, y quien mandó el polvo, si lo hizo a propósito, lo verá. Algunos monederos permiten marcarlas como no gastables (en Sparrow, clic derecho → <em>Freeze UTXO</em>).
</div>
<div style={{display:"flex",flexDirection:"column",gap:3}}>
{walletReport.polvoSinGastar.slice(0,6).map((p,i)=>(
<div key={i} style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,wordBreak:"break-all"}}>
<div key={i} style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,wordBreak:"break-all"}}>
{fmt.num(p.value)} sat · <IdCopiable id={p.address} tipo="direccion"/> · <IdCopiable id={p.txid} n={16}/>:{p.vout}
{p.tecnico&&<span style={{color:C.t3}}> · por debajo del mínimo de la red</span>}
</div>
))}
{walletReport.polvoSinGastar.length>6&&<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono}}>…y {walletReport.polvoSinGastar.length-6} más</div>}
{walletReport.polvoSinGastar.length>6&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>…y {walletReport.polvoSinGastar.length-6} más</div>}
</div>
</div>
)}
{walletReport.polvoRecibido&&walletReport.polvoSinGastar&&walletReport.polvoRecibido.length>walletReport.polvoSinGastar.length&&(
<div style={{padding:"9px 14px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:8,marginBottom:14,fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{padding:"9px 14px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:8,marginBottom:14,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
Además, {walletReport.polvoRecibido.length - walletReport.polvoSinGastar.length} moneda(s) muy pequeña(s) que recibiste <strong>ya se gastaron</strong>. Si se gastaron junto a otras monedas tuyas, esa vinculación ya está hecha y no se puede deshacer — figura en los grupos de direcciones vinculadas de abajo si es el caso. Se indica para que sepas de dónde viene, no para preocuparte por algo que ya pasó.
</div>
)}
{/* v1.49.4 (auditoría B3, R-12): los CoinJoin propios se apartan; se dice. */}
{walletReport.coinjoinPropios>0&&(
<div style={{marginBottom:14,padding:"9px 12px",background:C.bgCard,border:`1px solid ${C.green}30`,borderRadius:6,fontSize:"0.64rem",color:C.t2,lineHeight:1.55}}>
<div style={{marginBottom:14,padding:"9px 12px",background:C.bgCard,border:`1px solid ${C.green}30`,borderRadius:6,fontSize:"0.82rem",color:C.t2,lineHeight:1.55}}>
{walletReport.coinjoinPropios} transacci{walletReport.coinjoinPropios===1?"ón tuya es":"ones tuyas son"} CoinJoin: en {walletReport.coinjoinPropios===1?"ella":"ellas"} tus direcciones no se vinculan, porque las entradas son de muchas personas.
</div>
)}
{/* v1.51.0 (auditoría A3-03): las de forma de Stonewall, aparte. */}
{walletReport.stonewallPropios>0&&(
<div style={{marginBottom:14,padding:"9px 12px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,fontSize:"0.64rem",color:C.t2,lineHeight:1.55}}>
<div style={{marginBottom:14,padding:"9px 12px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,fontSize:"0.82rem",color:C.t2,lineHeight:1.55}}>
{walletReport.stonewallPropios} transacci{walletReport.stonewallPropios===1?"ón tuya tiene":"ones tuyas tienen"} forma de Stonewall: un observador no puede saber si sus entradas son de una persona o de dos, así que sus direcciones no se cuentan en los grupos de abajo. Si la hiciste tú solo, sí son tuyas, pero desde fuera solo es posible.
</div>
)}
@@ -751,8 +751,8 @@
{/* Bloque 2: Clusters de vinculación */}
{walletReport.clusters.length>0&&(
<div style={{marginBottom:14}}>
<div style={{fontSize:"0.6rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:4,letterSpacing:"0.15em"}}>GRUPOS DE DIRECCIONES VINCULADAS</div>
<div style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.55,marginBottom:8}}>Para cualquiera que mire la cadena, las direcciones de un grupo son de un mismo dueño. Es normal si has consolidado monedas; lo que importa es qué se ha juntado con qué.</div>
<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:4,letterSpacing:"0.15em"}}>GRUPOS DE DIRECCIONES VINCULADAS</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.55,marginBottom:8}}>Para cualquiera que mire la cadena, las direcciones de un grupo son de un mismo dueño. Es normal si has consolidado monedas; lo que importa es qué se ha juntado con qué.</div>
<div style={{display:"flex",flexDirection:"column",gap:8}}>
{walletReport.clusters.map((cluster,i)=>{
const reasons=walletReport.linkReasons.filter(r=>r.addrs.some(a=>cluster.includes(a)));
@@ -760,26 +760,26 @@
return (
<div key={i} style={{padding:"10px 12px",background:C.bgCard,border:`1px solid ${C.amber}30`,borderRadius:6}}>
<div style={{display:"flex",alignItems:"center",gap:10,marginBottom:6}}>
<div style={{fontSize:"0.62rem",color:C.amber,fontFamily:C.mono,fontWeight:600}}>Grupo {i+1}</div>
<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,fontWeight:600}}>Grupo {i+1}</div>
<div style={{flex:1,height:4,background:C.bg,borderRadius:2,overflow:"hidden"}}>
<div style={{width:`${barW}%`,height:"100%",background:C.amber,borderRadius:2}}/>
</div>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>{cluster.length} direcciones</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{cluster.length} direcciones</div>
</div>
{reasons.length>0&&(()=>{ const txs=[...new Set(reasons.map(r=>r.txid))]; return (
<div style={{fontSize:"0.6rem",color:C.t2,marginBottom:6,lineHeight:1.6}}>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:6,lineHeight:1.6}}>
Vinculadas al gastarse juntas en {txs.length} transacci{txs.length===1?"ón":"ones"}:{" "}
{txs.slice(0,4).map((t,k)=><span key={t} style={{whiteSpace:"nowrap"}}>{k>0?", ":""}<IdCopiable id={t} n={10}/> <VerEnMempool base={base} tipo="tx" id={t} texto="↗"/></span>)}
{txs.length>4&&<span> y {txs.length-4} más</span>}
</div>); })()}
<div style={{display:"flex",flexDirection:"column",gap:2}}>
{cluster.slice(0,4).map((a,j)=>(
<div key={j} style={{fontSize:"0.58rem",color:C.t1,fontFamily:C.mono}}>
<div key={j} style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono}}>
{labels?.get(a)&&<span style={{color:C.purple,marginRight:6}}>🏷 {labels.get(a)}</span>}
<IdCopiable id={a} tipo="direccion" texto={a.slice(0,14)+"…"+a.slice(-8)}/>
</div>
))}
{cluster.length>4&&<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono}}>+{cluster.length-4} más</div>}
{cluster.length>4&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>+{cluster.length-4} más</div>}
</div>
</div>
);
@@ -788,7 +788,7 @@
</div>
)}
{walletReport.clusters.length===0&&!walletReport.sinNota&&(
<div style={{marginBottom:14,padding:"10px 12px",background:C.bgCard,border:`1px solid ${C.green}30`,borderRadius:6,fontSize:"0.65rem",color:C.green,fontFamily:C.mono}}>
<div style={{marginBottom:14,padding:"10px 12px",background:C.bgCard,border:`1px solid ${C.green}30`,borderRadius:6,fontSize:"0.69rem",color:C.green,fontFamily:C.mono}}>
✓ Ninguna transacción une tus direcciones entre sí (en las {walletReport.totalTxs} analizadas).
</div>
)}
@@ -796,8 +796,8 @@
{/* Bloque 3: Historial */}
{walletReport.history.length>0&&(
<div>
<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,fontWeight:700,marginBottom:4,letterSpacing:"0.15em"}}>HISTORIAL — {walletReport.history.length} TRANSACCIONES</div>
<div style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.5,marginBottom:8}}>La banda es la de quien firmó: en las que recibiste, mide lo que hizo quien te pagó. Toca una para ver su análisis.</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,fontWeight:700,marginBottom:4,letterSpacing:"0.15em"}}>HISTORIAL — {walletReport.history.length} TRANSACCIONES</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5,marginBottom:8}}>La banda es la de quien firmó: en las que recibiste, mide lo que hizo quien te pagó. Toca una para ver su análisis.</div>
<div style={{display:"flex",flexDirection:"column",gap:4,maxHeight:320,overflowY:"auto"}}>
{walletReport.history.map((t,i)=>{
const bandColor=t.band==="ALTA"?C.green:t.band==="MEDIA"?C.amber:t.band==="BAJA"?C.red:C.t2;
@@ -807,14 +807,14 @@
onMouseEnter={e=>e.currentTarget.style.borderColor=bandColor}
onMouseLeave={e=>e.currentTarget.style.borderColor=C.border}>
<div style={{width:6,height:6,borderRadius:"50%",background:bandColor,flexShrink:0}}/>
<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,minWidth:70}}>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,minWidth:70}}>
{t.time?new Date(t.time*1000).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"2-digit"}):"sin confirmar"}
</div>
<div style={{fontSize:"0.6rem",color:C.t1,fontFamily:C.mono,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>
<div style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>
{labels?.get(t.txid)&&<span style={{color:C.purple,marginRight:6}}>🏷</span>}
{t.txid.slice(0,20)}…
</div>
<div style={{fontSize:"0.58rem",color:bandColor,fontFamily:C.mono,fontWeight:600,flexShrink:0}}>{t.band||"—"}</div>
<div style={{fontSize:"0.69rem",color:bandColor,fontFamily:C.mono,fontWeight:600,flexShrink:0}}>{t.band||"—"}</div>
{/* El clic en la fila abre el análisis interno; este
enlace lleva al explorador, y por eso corta la
propagación: son dos destinos distintos. */}
@@ -832,7 +832,7 @@
)}
{walletReport?.error&&(
<Card glow={C.red}>
<div style={{fontSize:"0.65rem",color:C.red,fontFamily:C.mono}}>No se pudo analizar la wallet: {walletReport.error}. Comprueba en ⚙ Ajustes que el nodo responde y vuelve a pulsar «⊙ Analizar wallet».</div>
<div style={{fontSize:"0.69rem",color:C.red,fontFamily:C.mono}}>No se pudo analizar la wallet: {walletReport.error}. Comprueba en ⚙ Ajustes que el nodo responde y vuelve a pulsar «⊙ Analizar wallet».</div>
</Card>
)}
@@ -842,20 +842,20 @@
{showLabelModal&&(
<Card glow={C.purple}>
<div style={{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:10}}>
<div style={{fontSize:"0.65rem",color:C.purple,fontFamily:C.mono,fontWeight:700}}>IMPORTAR ETIQUETAS DE SPARROW (BIP-329)</div>
<div style={{fontSize:"0.69rem",color:C.purple,fontFamily:C.mono,fontWeight:700}}>IMPORTAR ETIQUETAS DE SPARROW (BIP-329)</div>
<button onClick={()=>setShowLabelModal(false)} style={{background:"none",border:"none",color:C.t2,cursor:"pointer",fontSize:"1rem",lineHeight:1}}>×</button>
</div>
<div style={{fontSize:"0.68rem",color:C.t2,marginBottom:12}}>
<div style={{fontSize:"0.69rem",color:C.t2,marginBottom:12}}>
Exporta tus etiquetas desde Sparrow: <span style={{color:C.t1,fontFamily:C.mono}}>File → Export → Export Labels</span>. El archivo <span style={{color:C.t1,fontFamily:C.mono}}>.jsonl</span> se lee en tu navegador y no sale de él. No se guarda: al cerrar la pestaña hay que volver a cargarlo.
</div>
{labelInfo&&(
<div style={{marginBottom:10}}>
{labelInfo.count>0 ? <div style={{fontSize:"0.65rem",color:C.green,fontFamily:C.mono,marginBottom:8}}>✓ {labelInfo.file} — {labelInfo.count} etiquetas cargadas</div> : <div style={{fontSize:"0.65rem",color:C.amber,fontFamily:C.mono,marginBottom:8,lineHeight:1.5}}>{labelInfo.file}: no se ha leído ninguna etiqueta. El archivo no parece una exportación de etiquetas de Sparrow (.jsonl, formato BIP-329).</div>}
{labelInfo.count>0 ? <div style={{fontSize:"0.69rem",color:C.green,fontFamily:C.mono,marginBottom:8}}>✓ {labelInfo.file} — {labelInfo.count} etiquetas cargadas</div> : <div style={{fontSize:"0.82rem",color:C.amber,fontFamily:C.mono,marginBottom:8,lineHeight:1.5}}>{labelInfo.file}: no se ha leído ninguna etiqueta. El archivo no parece una exportación de etiquetas de Sparrow (.jsonl, formato BIP-329).</div>}
<div style={{maxHeight:160,overflowY:"auto",display:"flex",flexDirection:"column",gap:3}}>
{[...labels.entries()].map(([ref,lbl])=>(
<div key={ref} style={{display:"flex",gap:8,padding:"3px 6px",background:C.bgCard,borderRadius:4,alignItems:"baseline"}}>
<span style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,flexShrink:0,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>{ref.length>20?<IdCopiable id={ref} texto={ref.slice(0,10)+"…"+ref.slice(-8)}/>:ref}</span>
<span style={{fontSize:"0.65rem",color:C.t1,fontFamily:C.mono}}>{lbl}</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,flexShrink:0,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>{ref.length>20?<IdCopiable id={ref} texto={ref.slice(0,10)+"…"+ref.slice(-8)}/>:ref}</span>
<span style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono}}>{lbl}</span>
</div>
))}
</div>
@@ -868,7 +868,7 @@
</label>
{labels.size>0&&(
<button onClick={()=>{setLabels(new Map());setLabelInfo(null);setShowLabelModal(false);}}
style={{marginTop:8,padding:"5px 12px",background:"none",border:`1px solid ${C.red}40`,borderRadius:6,color:C.red,fontFamily:C.mono,fontSize:"0.65rem",cursor:"pointer"}}>
style={{marginTop:8,padding:"5px 12px",background:"none",border:`1px solid ${C.red}40`,borderRadius:6,color:C.red,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>
Quitar las etiquetas
</button>
)}
@@ -876,7 +876,7 @@
)}
<Card>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,marginBottom:10}}>ANALIZAR TRANSACCIÓN · pega su txid</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:10}}>ANALIZAR TRANSACCIÓN · pega su txid</div>
<div style={{display:"flex",gap:8}}>
<input value={query} onChange={e=>setQuery(filtrarSecreto(e.target.value))} onKeyDown={e=>e.key==="Enter"&&analyze()}
placeholder="txid de la transacción (64 letras y números)"
@@ -892,7 +892,7 @@
{!base&&!tx&&!loading&&(
<div style={{marginTop:10,display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"}}>
<button onClick={()=>{setQuery(MOCK_TX.txid);analyze(MOCK_TX.txid);}} style={{padding:"9px 14px",background:"none",border:`1px solid ${C.amber}70`,borderRadius:6,color:C.amber,fontFamily:C.mono,fontSize:"0.7rem",cursor:"pointer"}}>Probar con una transacción de ejemplo</button>
<span style={{fontSize:"0.64rem",color:C.t2}}>Sin nodo no se puede consultar una transacción real.</span>
<span style={{fontSize:"0.69rem",color:C.t2}}>Sin nodo no se puede consultar una transacción real.</span>
</div>
)}
</Card>
@@ -908,7 +908,7 @@
</div>
)}
{(()=>{ const v = analysis.checks.find(c=>c.id==="vecinas"); return v ? (
<div style={{fontSize:"0.7rem",color:C.t2,fontFamily:C.mono,padding:"2px 4px",lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,padding:"2px 4px",lineHeight:1.5}}>
⌂ {v.label}. {v.detail.replace(/^Se han? traído de tu nodo [^.]*\. /,"")}
</div>) : null; })()}
{vecinas&&vecinas.estado==="hecho"&&vecinas.fallos>0&&(
@@ -920,10 +920,10 @@
<div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:12}}>
<div>
<div style={{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"}}>
<span style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono}}>TRANSACCIÓN ANALIZADA</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>TRANSACCIÓN ANALIZADA</span>
<VerEnMempool base={base} tipo="tx" id={tx.txid}/>
</div>
<div style={{fontSize:"0.68rem",fontFamily:C.mono,color:C.blue,wordBreak:"break-all"}}>{tx.txid}</div>
<div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.blue,wordBreak:"break-all"}}>{tx.txid}</div>
{labels&&labels.get(tx.txid)&&(
<div style={{marginTop:8,display:"flex",alignItems:"center",gap:8,padding:"6px 10px",background:C.purpleMuted,border:`1px solid ${C.purple}60`,borderRadius:6}}>
<span style={{fontSize:"0.7rem"}}>🏷</span>
@@ -936,7 +936,7 @@
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(120px,1fr))",gap:10,paddingTop:10,borderTop:`1px solid ${C.border}`}}>
<Tag label="Comisión" value={fmtFee(comisionDe(tx))} color={C.amber}/>
<Tag label="Tarifa" value={fmtTasa(comisionDe(tx))} color={C.amber}/>
{comisionDe(tx).fee===0&&<div style={{gridColumn:"1 / -1",fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>{notaComisionCero(tx)}</div>}
{comisionDe(tx).fee===0&&<div style={{gridColumn:"1 / -1",fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>{notaComisionCero(tx)}</div>}
<Tag label="Tamaño" value={tx.weight?`${Math.ceil(tx.weight/4)} vB`:"-"}/>
<Tag label="Entradas" value={tx.vin?.length||0} color={C.t1}/>
<Tag label="Salidas" value={tx.vout?.length||0} color={C.t1}/>
@@ -945,7 +945,7 @@
<EnEuros tx={tx} base={base}/>
{walletAddrs&&tx.vout&&tx.vout.some(o=>myAddr(o.scriptpubkey_address))&&(
<div style={{marginTop:10,paddingTop:10,borderTop:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,marginBottom:6}}>SALIDAS QUE SON DE TU WALLET</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:6}}>SALIDAS QUE SON DE TU WALLET</div>
<div style={{display:"flex",flexDirection:"column",gap:4}}>
{tx.vout.map((o,i)=>{
const mine = myAddr(o.scriptpubkey_address);
@@ -953,10 +953,10 @@
const lbl = labels?.get(o.scriptpubkey_address);
return (
<div key={i} style={{display:"flex",alignItems:"center",gap:8,padding:"5px 8px",background:mine==="cambio"?C.amberMuted:C.greenMuted,border:`1px solid ${mine==="cambio"?C.amber:C.green}40`,borderRadius:5}}>
<span style={{fontSize:"0.65rem",color:mine==="cambio"?C.amber:C.green,fontFamily:C.mono,fontWeight:600}}>{mine==="cambio"?"↺ cambio":"↓ recepción"}</span>
<span style={{fontSize:"0.68rem",color:C.t1,fontFamily:C.mono}}>{fmt.sats(o.value)}</span>
{lbl&&<span style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono}}>· {lbl}</span>}
<span style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,marginLeft:"auto"}}>{o.scriptpubkey_address&&<IdCopiable id={o.scriptpubkey_address} tipo="direccion" texto={o.scriptpubkey_address.slice(0,12)+"…"}/>}</span>
<span style={{fontSize:"0.69rem",color:mine==="cambio"?C.amber:C.green,fontFamily:C.mono,fontWeight:600}}>{mine==="cambio"?"↺ cambio":"↓ recepción"}</span>
<span style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono}}>{fmt.sats(o.value)}</span>
{lbl&&<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>· {lbl}</span>}
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginLeft:"auto"}}>{o.scriptpubkey_address&&<IdCopiable id={o.scriptpubkey_address} tipo="direccion" texto={o.scriptpubkey_address.slice(0,12)+"…"}/>}</span>
</div>
);
})}
+60 -60
View File
@@ -100,8 +100,8 @@
const cg = txOrigen ? cambioDe(txOrigen) : null;
const caja = {background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"10px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.72rem",outline:"none",minWidth:0};
const rotulo = {fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,marginTop:4};
const seccion = (txt, color) => <div style={{fontSize:"0.6rem",color:color||C.t2,fontFamily:C.mono,fontWeight:700,marginBottom:8,letterSpacing:"0.15em"}}>{txt}</div>;
const rotulo = {fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,marginTop:4};
const seccion = (txt, color) => <div style={{fontSize:"0.69rem",color:color||C.t2,fontFamily:C.mono,fontWeight:700,marginBottom:8,letterSpacing:"0.15em"}}>{txt}</div>;
const nivelColor = l => l==="HECHO"?C.green:l==="DECLARACION"?C.blue:C.amber;
return (
@@ -109,18 +109,18 @@
{!base&&<DemoBanner/>}
<Card>
<div style={{fontSize:"0.7rem",color:C.t2,marginBottom:10,lineHeight:1.6}}>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:10,lineHeight:1.6}}>
Sigue <strong style={{color:C.t1}}>hacia delante</strong> unas monedas robadas o perdidas, desde la transacción en la que salieron, en un espacio de trabajo propio. <strong style={{color:C.t1}}>Nada se explora solo:</strong> antes de cada comprobación ves cuántas consultas a tu nodo puede costar, y lo ya traído no se vuelve a pedir. Todo sobre tu propio nodo: nada sale de tu red.
</div>
{!per ? (
<div style={{display:"flex",flexDirection:"column",gap:8}}>
{demo ? (<>
<div style={{padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}55`,borderRadius:6,color:C.t1,fontSize:"0.7rem",lineHeight:1.55}}>
<div style={{padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}55`,borderRadius:6,color:C.t1,fontSize:"0.82rem",lineHeight:1.55}}>
<strong style={{color:C.amber}}>Sin nodo no se puede seguir una transacción real.</strong> El botón de abajo abre un robo de ejemplo para que veas cómo funciona. Con tu nodo configurado, aquí pegarás el txid de la transacción en la que salió el dinero.
</div>
</>) : !txOrigen ? (<>
<div style={rotulo}>1 · La transacción en la que salió el dinero</div>
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>Es la que movió el dinero fuera de tu wallet (el robo o la pérdida). Su txid está en el historial de tu wallet; en Sparrow, en Transactions.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Es la que movió el dinero fuera de tu wallet (el robo o la pérdida). Su txid está en el historial de tu wallet; en Sparrow, en Transactions.</div>
<div style={{display:"flex",gap:8,flexWrap:"wrap"}}>
<input value={txidInput} onChange={e=>setTxidInput(filtrarSecreto(e.target.value))} placeholder="txid (64 letras y números)" style={{...caja,flex:"3 1 220px"}}/>
<BotonQR campo="txid" color={C.red} onLeido={v=>setTxidInput(v)}/>
@@ -130,7 +130,7 @@
</button>
</>) : (<>
<div style={rotulo}>2 · ¿Qué salida quieres seguir?<NotaDesdeCero/></div>
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>Transacción <IdCopiable id={txOrigen.txid} n={16}/>. Toca la salida que se llevó el dinero: normalmente la que no vuelve a tu wallet.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Transacción <IdCopiable id={txOrigen.txid} n={16}/>. Toca la salida que se llevó el dinero: normalmente la que no vuelve a tu wallet.</div>
<div style={{display:"flex",flexDirection:"column",gap:6}}>
{(txOrigen.vout||[]).map((o,i)=>{
const datos = esSalidaDeDatos(o), sel = voutSel===i;
@@ -140,16 +140,16 @@
<div style={{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"}}>
<span style={{fontFamily:C.mono,fontSize:"0.7rem",color:sel?C.red:C.t2,fontWeight:700}}>{sel?"● ":"○ "}Salida {i}</span>
<span style={{fontFamily:C.mono,fontSize:"0.76rem",color:C.t1,fontWeight:700}}>{btcTxt(o.value)}</span>
<span style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2}}>{o.scriptpubkey_address?abrevDir(o.scriptpubkey_address):etiquetaSinDir(o)}</span>
<span style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2}}>{o.scriptpubkey_address?abrevDir(o.scriptpubkey_address):etiquetaSinDir(o)}</span>
{o.scriptpubkey_address&&<span onClick={e=>e.stopPropagation()}><BotonCopiar texto={o.scriptpubkey_address} etiqueta="la dirección"/></span>}
</div>
{datos&&<div style={{fontSize:"0.62rem",color:C.t2}}>Salida de datos (OP_RETURN): no lleva dinero.</div>}
{!datos&&pista&&<div style={{fontSize:"0.62rem",color:C.t2,display:"flex",gap:6,alignItems:"center"}}>{pista}<CertaintyBadge level={cg.certainty}/></div>}
{datos&&<div style={{fontSize:"0.69rem",color:C.t2}}>Salida de datos (OP_RETURN): no lleva dinero.</div>}
{!datos&&pista&&<div style={{fontSize:"0.69rem",color:C.t2,display:"flex",gap:6,alignItems:"center"}}>{pista}<CertaintyBadge level={cg.certainty}/></div>}
</div>
);
})}
</div>
<button onClick={()=>{setTxOrigen(null);setVoutSel(null);}} style={{alignSelf:"flex-start",padding:"6px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.66rem",cursor:"pointer"}}>‹ Otra transacción</button>
<button onClick={()=>{setTxOrigen(null);setVoutSel(null);}} style={{alignSelf:"flex-start",padding:"6px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>‹ Otra transacción</button>
</>)}
{(demo || voutSel!=null) && (<>
{!demo&&<div style={rotulo}>3 · Antes de empezar (opcional)</div>}
@@ -158,14 +158,14 @@
<select value={maxHops} onChange={e=>setMaxHops(Number(e.target.value))} style={{...caja,alignSelf:"flex-start",cursor:"pointer"}}>
<option value={8}>hasta 8 saltos</option><option value={15}>hasta 15 saltos</option><option value={25}>hasta 25 saltos</option>
</select>
<div style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.5}}>Hasta dónde puede llegar el seguimiento como mucho, para proteger tu nodo. Cada salto se abre igualmente a mano. No se cambia después: para ir más lejos, se empieza otro seguimiento.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Hasta dónde puede llegar el seguimiento como mucho, para proteger tu nodo. Cada salto se abre igualmente a mano. No se cambia después: para ir más lejos, se empieza otro seguimiento.</div>
</>}
<div style={rotulo}>Importe robado o perdido, en BTC <span style={{textTransform:"none"}}>(opcional: el reparto de cada salto se calcula sobre él y se avisa cuando se mezcla con mucho dinero de otros. Es una cuenta, no dice de quién es el dinero)</span></div>
<input value={amountInput} onChange={e=>setAmountInput(e.target.value)} inputMode="decimal" placeholder="0,00000000" style={caja}/>
<div style={rotulo}>Declaración del afectado <span style={{textTransform:"none"}}>(opcional)</span></div>
<textarea value={declaracion} onChange={e=>setDeclaracion(filtrarSecreto(e.target.value))} rows={3}
placeholder="Qué pasó, cuándo se notó, cómo pudo ocurrir. En el informe va aparte, como DECLARACIÓN, y nunca se mezcla con los hechos."
style={{...caja,fontSize:"0.68rem",resize:"vertical"}}/>
style={{...caja,fontSize:"0.69rem",resize:"vertical"}}/>
<button onClick={iniciar} style={{alignSelf:"flex-start",padding:"9px 18px",background:C.redMuted,border:`1px solid ${C.red}50`,borderRadius:6,color:C.red,fontFamily:C.mono,fontSize:"0.72rem",cursor:"pointer",fontWeight:700}}>
{demo?"Abrir el ejemplo ›":`Empezar a seguir la salida ${voutSel} ›`}
</button>
@@ -173,21 +173,21 @@
</div>
) : (
<div style={{display:"flex",flexDirection:"column",gap:8}}>
<div style={{fontSize:"0.7rem",color:C.t1,lineHeight:1.6}}>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>
Seguimiento en curso{demo?" (EJEMPLO)":""}: <span style={{fontFamily:C.mono}}>{abrevTxid(per.origen.txid)}</span>, salida {per.origen.vout} · {per.abiertas.size-1===1?"1 salto seguido":`${per.abiertas.size-1} saltos seguidos`} · {per.consultas===1?"1 consulta":`${per.consultas} consultas`} a tu nodo.
</div>
<textarea value={declaracion} onChange={e=>setDeclaracion(filtrarSecreto(e.target.value))} rows={2}
placeholder="Declaración del afectado (opcional). En el informe va aparte, etiquetada como DECLARACIÓN."
style={{...caja,fontSize:"0.68rem",resize:"vertical"}}/>
style={{...caja,fontSize:"0.69rem",resize:"vertical"}}/>
<div style={{display:"flex",gap:8,flexWrap:"wrap"}}>
<button onClick={()=>setAbierto(true)} style={{padding:"8px 16px",background:C.redMuted,border:`1px solid ${C.red}50`,borderRadius:6,color:C.red,fontFamily:C.mono,fontSize:"0.7rem",cursor:"pointer",fontWeight:700}}>Abrir el espacio de trabajo ›</button>
<button onClick={()=>generarInforme()} disabled={per.abiertas.size<2} style={{padding:"8px 16px",background:C.purpleMuted,border:`1px solid ${C.purple}50`,borderRadius:6,color:C.purple,fontFamily:C.mono,fontSize:"0.7rem",cursor:"pointer",fontWeight:700,opacity:per.abiertas.size<2?0.45:1}}>Generar el informe de seguimiento</button>
<button onClick={limpiar} style={{padding:"8px 14px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer"}}>Nuevo seguimiento</button>
<button onClick={limpiar} style={{padding:"8px 14px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>Nuevo seguimiento</button>
</div>
{per.abiertas.size<2&&<div style={{fontSize:"0.62rem",color:C.t2}}>El informe se activa en cuanto sigas al menos un salto.</div>}
{per.abiertas.size<2&&<div style={{fontSize:"0.69rem",color:C.t2}}>El informe se activa en cuanto sigas al menos un salto.</div>}
</div>
)}
{error&&<div style={{marginTop:8,padding:"8px 12px",background:C.redMuted,border:`1px solid ${C.red}30`,borderRadius:6,color:C.red,fontSize:"0.7rem",lineHeight:1.5}}>{error}</div>}
{error&&<div style={{marginTop:8,padding:"8px 12px",background:C.redMuted,border:`1px solid ${C.red}30`,borderRadius:6,color:C.red,fontSize:"0.82rem",lineHeight:1.5}}>{error}</div>}
</Card>
{abierto&&per&&<PeritajeTrabajo per={per} base={base} getStrict={getStrict} demo={demo} onCerrar={()=>{setAbierto(false);setTick(t=>t+1);}} onInforme={generarInforme}/>}
@@ -201,25 +201,25 @@
return (
<Card glow={C.red} innerRef={el=>{ if(el) el.id="informe-peritaje"; }}>
<div style={{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:10,flexWrap:"wrap",gap:8}}>
<div style={{display:"flex",alignItems:"center",gap:8}}><span style={{fontSize:"0.65rem",color:C.red,fontFamily:C.mono,fontWeight:700}}>INFORME DE SEGUIMIENTO</span>{report.ejemplo&&<Badge color={C.amber}>EJEMPLO</Badge>}</div>
<div style={{display:"flex",alignItems:"center",gap:8}}><span style={{fontSize:"0.69rem",color:C.red,fontFamily:C.mono,fontWeight:700}}>INFORME DE SEGUIMIENTO</span>{report.ejemplo&&<Badge color={C.amber}>EJEMPLO</Badge>}</div>
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}>
<button onClick={exportMD} title="Texto con formato Markdown: se abre con cualquier editor de texto" style={{padding:"3px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.t2,fontFamily:C.mono,fontSize:"0.6rem",cursor:"pointer"}}>↓ Informe legible (.md)</button>
<button onClick={exportJSON} title="Datos estructurados para otra herramienta o programa" style={{padding:"3px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.t2,fontFamily:C.mono,fontSize:"0.6rem",cursor:"pointer"}}>↓ Datos para otra herramienta (.json)</button>
<button onClick={exportMD} title="Texto con formato Markdown: se abre con cualquier editor de texto" style={{padding:"3px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>↓ Informe legible (.md)</button>
<button onClick={exportJSON} title="Datos estructurados para otra herramienta o programa" style={{padding:"3px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>↓ Datos para otra herramienta (.json)</button>
</div>
</div>
{/* Cabecera fija: qué es este documento y qué cubre. Va antes que nada. */}
<div style={{marginBottom:10,padding:"8px 12px",background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,fontSize:"0.64rem",color:C.t1,lineHeight:1.6}}>{cabeceraInforme(report)}</div>
<div style={{marginBottom:10,padding:"8px 12px",background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>{cabeceraInforme(report)}</div>
{/* El análisis no sale de la red del usuario, pero el archivo
exportado sí puede salir — y lleva sus direcciones dentro.
Avisar aquí, junto a los botones, no en la letra pequeña. */}
<div style={{marginBottom:14,padding:"8px 12px",background:C.amberMuted,border:`1px solid ${C.amber}30`,borderRadius:6,fontSize:"0.62rem",color:C.amber,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{marginBottom:14,padding:"8px 12px",background:C.amberMuted,border:`1px solid ${C.amber}30`,borderRadius:6,fontSize:"0.82rem",color:C.amber,fontFamily:C.mono,lineHeight:1.6}}>
Lo que descargues lleva dentro direcciones, txids y la declaración. Nada de esto ha salido de tu red hasta ahora; a partir de aquí depende de ti. Un foro, un chat de soporte o un servicio en la nube lo guardarían fuera de tu control.
</div>
{per&&report.generadoCon!==per.abiertas.size&&(
<div style={{marginBottom:14,padding:"8px 12px",background:C.amberMuted,border:`1px solid ${C.amber}30`,borderRadius:6,fontSize:"0.62rem",color:C.amber,fontFamily:C.mono}}>
<div style={{marginBottom:14,padding:"8px 12px",background:C.amberMuted,border:`1px solid ${C.amber}30`,borderRadius:6,fontSize:"0.69rem",color:C.amber,fontFamily:C.mono}}>
Desde este informe se han seguido más saltos: no los incluye hasta que se genere de nuevo.
</div>
)}
@@ -233,7 +233,7 @@
{label:"Direcciones que aparecen", v: report.summary.addressesTouched},
].map(({label,v})=>(
<div key={label}>
<div style={{fontSize:"0.55rem",color:C.t2,fontFamily:C.mono}}>{label}</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{label}</div>
<div style={{fontSize:"0.8rem",fontFamily:C.mono,fontWeight:700,color:C.t1}}>{v}</div>
</div>
))}
@@ -241,13 +241,13 @@
{/* Lo que no se sabe: tres grupos distintos. v1.50.6 (B4, IF-07): con su título, como en el MD y la Ayuda. */}
{seccion("LO QUE ESTE INFORME NO SABE")}
{grupos.length===0&&<div style={{fontSize:"0.64rem",color:C.t2,marginBottom:10}}>Todas las salidas exploradas se pudieron comprobar. Lo que no se exploró está en «Ramas sin seguir».</div>}
{grupos.length===0&&<div style={{fontSize:"0.69rem",color:C.t2,marginBottom:10}}>Todas las salidas exploradas se pudieron comprobar. Lo que no se exploró está en «Ramas sin seguir».</div>}
{grupos.map((g,gi)=>(
<div key={gi} style={{marginBottom:10,padding:"10px 12px",background:`${g.c}12`,border:`1px solid ${g.c}40`,borderRadius:6}}>
<div style={{fontSize:"0.62rem",color:g.c,fontFamily:C.mono,fontWeight:700,marginBottom:6,letterSpacing:"0.1em"}}>{g.t} — {g.l.length}</div>
<div style={{fontSize:"0.63rem",color:C.t1,lineHeight:1.6,marginBottom:8}}>{g.x}</div>
<div style={{fontSize:"0.69rem",color:g.c,fontFamily:C.mono,fontWeight:700,marginBottom:6,letterSpacing:"0.1em"}}>{g.t} — {g.l.length}</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6,marginBottom:8}}>{g.x}</div>
{g.l.map((f,i)=>(
<div key={i} style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,wordBreak:"break-all"}}>{f.address} · {btcTxt(f.amount)} · salida {f.vout} de <IdCopiable id={f.txid} n={16}/></div>
<div key={i} style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,wordBreak:"break-all"}}>{f.address} · {btcTxt(f.amount)} · salida {f.vout} de <IdCopiable id={f.txid} n={16}/></div>
))}
</div>
))}
@@ -257,10 +257,10 @@
{seccion("CONCLUSIONES")}
<div style={{display:"flex",flexDirection:"column",gap:6}}>
{report.conclusions.map((c,i)=>(
<div key={i} style={{display:"flex",gap:8,fontSize:"0.66rem",color:C.t1,lineHeight:1.6}}>
<div key={i} style={{display:"flex",gap:8,fontSize:"0.82rem",color:C.t1,lineHeight:1.6}}>
<span style={{fontFamily:C.mono,color:C.t2,flexShrink:0}}>{i+1}.</span>
<span>
<span style={{fontFamily:C.mono,fontSize:"0.56rem",fontWeight:700,color:nivelColor(c.level),border:`1px solid ${nivelColor(c.level)}40`,borderRadius:3,padding:"1px 5px",marginRight:6}}>{nivelTxt(c)}</span>
<span style={{fontFamily:C.mono,fontSize:"0.69rem",fontWeight:700,color:nivelColor(c.level),border:`1px solid ${nivelColor(c.level)}40`,borderRadius:3,padding:"1px 5px",marginRight:6}}>{nivelTxt(c)}</span>
{c.text}
</span>
</div>
@@ -272,7 +272,7 @@
{d&&(
<div style={{marginBottom:14}}>
{seccion("DÓNDE ESTÁ EL DINERO, SEGÚN LO EXPLORADO")}
<div style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.7}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7}}>
De {btcTxt(d.total)} seguidos (reparto proporcional por importes: una cuenta, no una atribución): sin gastar al comprobarlo {btcTxt(d.sinGastar)} · en direcciones etiquetadas como exchange (según la lista de la app) {btcTxt(exs.reduce((t,[,v])=>t+v,0))}{exs.length?` (${exs.map(([n])=>n).join(", ")})`:""} · en CoinJoin o repartos masivos {btcTxt(d.mezclas)} · sin determinar {btcTxt(d.sinDeterminar||0)} · sin explorar todavía {btcTxt(d.sinExplorar)} · comisiones {btcTxt(d.comisiones||0)}.
</div>
</div>
@@ -281,30 +281,30 @@
{/* Declaración */}
{report.declaracion&&(
<div style={{marginBottom:14,padding:"10px 12px",background:C.blueMuted,border:`1px solid ${C.blue}40`,borderRadius:6}}>
<div style={{fontSize:"0.58rem",color:C.blue,fontFamily:C.mono,fontWeight:700,marginBottom:6,letterSpacing:"0.1em"}}>DECLARACIÓN DEL AFECTADO · sin comprobar</div>
<div style={{fontSize:"0.68rem",color:C.t1,lineHeight:1.6,whiteSpace:"pre-wrap"}}>{report.declaracion.text}</div>
<div style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,fontWeight:700,marginBottom:6,letterSpacing:"0.1em"}}>DECLARACIÓN DEL AFECTADO · sin comprobar</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.6,whiteSpace:"pre-wrap"}}>{report.declaracion.text}</div>
</div>
)}
{/* Direcciones atribuidas */}
<div style={{marginBottom:14}}>
{seccion(`DIRECCIONES QUE PODRÍAN SER DE QUIEN MOVIÓ EL DINERO (EL «ACTOR») — ${report.attributed.length}`, C.amber)}
<div style={{fontSize:"0.62rem",color:C.t2,marginBottom:8,lineHeight:1.5,marginTop:-4}}>Cada una lleva su fundamento y su certeza. Ninguna prueba quién es.</div>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:8,lineHeight:1.5,marginTop:-4}}>Cada una lleva su fundamento y su certeza. Ninguna prueba quién es.</div>
{report.attributed.length===0?(
<div style={{fontSize:"0.65rem",color:C.t2}}>Ninguna dirección, aparte de la salida de origen, tiene indicios suficientes para atribuirla al actor.</div>
<div style={{fontSize:"0.69rem",color:C.t2}}>Ninguna dirección, aparte de la salida de origen, tiene indicios suficientes para atribuirla al actor.</div>
):(
<div style={{display:"flex",flexDirection:"column",gap:6}}>
{report.attributed.map((a,i)=>(
<div key={i} style={{padding:"8px 10px",background:C.bgCard,border:`1px solid ${C.amber}30`,borderRadius:6}}>
<div style={{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"}}>
<span style={{fontSize:"0.6rem",color:C.t1,fontFamily:C.mono,wordBreak:"break-all"}}>{a.address}</span>
<span style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono,wordBreak:"break-all"}}>{a.address}</span>
{/* v1.50.6 (B4, IF-02): la certeza más alta de sus fundamentos, a la vista. */}
{(()=>{ const orden=["CERTEZA","PROBABLE","POSIBLE"]; const c=orden.find(o=>a.fundamentos.some(f=>!f.apoyo&&f.certainty===o)); return c?<CertaintyBadge level={c}/>:null; })()}
<VerEnMempool base={base} tipo="direccion" id={a.address} texto="↗"/>
</div>
<div style={{display:"flex",flexDirection:"column",gap:2}}>
{a.fundamentos.map((f,j)=>(
<div key={j} style={{fontSize:"0.56rem",color:C.t2,fontFamily:C.mono}}>
<div key={j} style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>
<span style={{color:C.amber}}>[{f.certainty}]</span> {f.basis}{f.refTxid?<> — tx <IdCopiable id={f.refTxid} n={16}/></>:""}
</div>
))}
@@ -319,15 +319,15 @@
{(report.destinatarios||[]).length>0&&(
<div style={{marginBottom:14}}>
{seccion(`DESTINATARIOS: PARECEN PAGOS A OTRA PERSONA — ${report.destinatarios.length}`, C.purple)}
<div style={{fontSize:"0.62rem",color:C.t2,marginBottom:8,lineHeight:1.5,marginTop:-4}}>No se atribuyen al actor. Cada uno lleva la certeza de la detección del cambio.</div>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:8,lineHeight:1.5,marginTop:-4}}>No se atribuyen al actor. Cada uno lleva la certeza de la detección del cambio.</div>
<div style={{display:"flex",flexDirection:"column",gap:6}}>
{report.destinatarios.map((x,i)=>(
<div key={i} style={{padding:"8px 10px",background:C.bgCard,border:`1px solid ${C.purple}30`,borderRadius:6}}>
<div style={{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"}}>
<span style={{fontSize:"0.6rem",color:C.t1,fontFamily:C.mono,wordBreak:"break-all"}}>{x.address}</span>
<span style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono,wordBreak:"break-all"}}>{x.address}</span>
<CertaintyBadge level={x.certainty}/>
</div>
<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono}}>{x.basis} — tx <IdCopiable id={x.txid} n={16}/></div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{x.basis} — tx <IdCopiable id={x.txid} n={16}/></div>
</div>
))}
</div>
@@ -337,18 +337,18 @@
{/* Fondos sin gastar */}
<div style={{marginBottom:14}}>
{seccion(`SALIDAS SIN GASTAR AL COMPROBARLAS — ${report.unspentFunds.length}`, C.green)}
<div style={{fontSize:"0.62rem",color:C.t2,marginBottom:8,lineHeight:1.5,marginTop:-4}}>Que una salida siga sin gastar no dice de quién es.</div>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:8,lineHeight:1.5,marginTop:-4}}>Que una salida siga sin gastar no dice de quién es.</div>
{report.unspentFunds.length===0?(
<div style={{fontSize:"0.65rem",color:C.t2}}>Ninguna en las ramas exploradas.</div>
<div style={{fontSize:"0.69rem",color:C.t2}}>Ninguna en las ramas exploradas.</div>
):(
<div style={{display:"flex",flexDirection:"column",gap:4}}>
{report.unspentFunds.map((u,i)=>(
<div key={i} style={{padding:"7px 10px",background:C.greenMuted,border:`1px solid ${C.green}30`,borderRadius:6}}>
<div style={{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"}}>
<span style={{fontSize:"0.6rem",color:C.t1,fontFamily:C.mono,wordBreak:"break-all"}}>{u.address}</span>
<span style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono,wordBreak:"break-all"}}>{u.address}</span>
<VerEnMempool base={base} tipo="direccion" id={u.address} texto="↗"/>
</div>
<div style={{fontSize:"0.58rem",color:C.green,fontFamily:C.mono,fontWeight:700}}>{btcTxt(u.amount)} · tx <IdCopiable id={u.txid} n={12}/>, salida {u.vout}</div>
<div style={{fontSize:"0.69rem",color:C.green,fontFamily:C.mono,fontWeight:700}}>{btcTxt(u.amount)} · tx <IdCopiable id={u.txid} n={12}/>, salida {u.vout}</div>
</div>
))}
</div>
@@ -362,7 +362,7 @@
{seccion(`RAMAS SIN SEGUIR — ${report.pendingBranches.length}`)}
<div style={{display:"flex",flexDirection:"column",gap:4,marginBottom:10}}>
{report.pendingBranches.map((b,i)=>(
<div key={i} style={{padding:"7px 10px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,lineHeight:1.5,wordBreak:"break-all"}}>
<div key={i} style={{padding:"7px 10px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.5,wordBreak:"break-all"}}>
<span style={{color:C.t1}}>{b.address}</span> · salida {b.vout} de <IdCopiable id={b.txid} n={16}/> · {btcTxt(b.amount)} · de lo seguido {btcTxt(b.seguido)} (proporcional) · {b.estado}
</div>
))}
@@ -370,10 +370,10 @@
</>)}
{(report.sinDeterminar||[]).length>0&&(<>
{seccion(`SIN DETERMINAR — ${report.sinDeterminar.length}`)}
<div style={{fontSize:"0.62rem",color:C.t2,marginBottom:6,lineHeight:1.5,marginTop:-4}}>Salidas no seguidas o donde se dejó de seguir. No se atribuyen al actor.</div>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:6,lineHeight:1.5,marginTop:-4}}>Salidas no seguidas o donde se dejó de seguir. No se atribuyen al actor.</div>
<div style={{display:"flex",flexDirection:"column",gap:4}}>
{report.sinDeterminar.map((x,i)=>(
<div key={i} style={{padding:"7px 10px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,lineHeight:1.5,wordBreak:"break-all"}}>
<div key={i} style={{padding:"7px 10px",background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.5,wordBreak:"break-all"}}>
<span style={{color:C.t1}}>{x.address}</span> — {x.basis} · tx <IdCopiable id={x.txid} n={16}/>
</div>
))}
@@ -384,7 +384,7 @@
{report.truncatedBranches.length>0&&(
<div style={{marginBottom:14,padding:"10px 12px",background:C.amberMuted,border:`1px solid ${C.amber}30`,borderRadius:6}}>
<div style={{fontSize:"0.65rem",color:C.amber,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{fontSize:"0.82rem",color:C.amber,fontFamily:C.mono,lineHeight:1.6}}>
{report.truncatedBranches.length===1?"1 rama llegó":`${report.truncatedBranches.length} ramas llegaron`} al tope de saltos ({per?.maxSaltos ?? maxHops}). No es un final natural. Para ir más allá, se empieza un «Nuevo seguimiento» con un tope mayor.
</div>
</div>
@@ -393,23 +393,23 @@
{/* Cronología */}
<div style={{marginBottom:14}}>
{seccion(`CRONOLOGÍA — ${report.chronology.length} TRANSACCIONES`)}
<div style={{fontSize:"0.62rem",color:C.t2,marginBottom:8,lineHeight:1.5,marginTop:-4}}>Banda de privacidad de cada transacción: BAJA quiere decir más fácil de seguir.</div>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:8,lineHeight:1.5,marginTop:-4}}>Banda de privacidad de cada transacción: BAJA quiere decir más fácil de seguir.</div>
<div style={{display:"flex",flexDirection:"column",gap:4,maxHeight:320,overflowY:"auto"}}>
{report.chronology.map((c,i)=>{
const bColor = bandColorRastro(c.band.value.replace(/^privacidad /,""));
return (
<div key={i} style={{padding:"7px 10px",background:C.bgCard,borderRadius:5,border:`1px solid ${C.border}`}}>
<div style={{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"}}>
<span style={{fontSize:"0.56rem",color:C.t2,fontFamily:C.mono,minWidth:50}}>{c.hop===0?"origen":`salto ${c.hop}`}</span>
<span style={{fontSize:"0.6rem",color:C.t1,fontFamily:C.mono,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}><IdCopiable id={c.txid} n={20}/></span>
<span style={{fontSize:"0.58rem",color:bColor,fontFamily:C.mono,fontWeight:600}} title="Banda de privacidad de la transacción (ALTA, MEDIA, BAJA), del analizador">{c.band.value}</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,minWidth:50}}>{c.hop===0?"origen":`salto ${c.hop}`}</span>
<span style={{fontSize:"0.69rem",color:C.t1,fontFamily:C.mono,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}><IdCopiable id={c.txid} n={20}/></span>
<span style={{fontSize:"0.69rem",color:bColor,fontFamily:C.mono,fontWeight:600}} title="Banda de privacidad de la transacción (ALTA, MEDIA, BAJA), del analizador">{c.band.value}</span>
</div>
<div style={{fontSize:"0.56rem",color:C.t2,fontFamily:C.mono,marginTop:3}}>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginTop:3}}>
salida {btcTxt(c.amount)}{c.followed!=null?` · seguido ${btcTxt(c.followed)} (proporcional)`:""} · {c.blockTime?fmt.date(c.blockTime):"sin confirmar"} · huella del monedero: {c.fingerprint.value}{c.fingerprint.certainty?` (${c.fingerprint.certainty})`:""}
</div>
{c.entityMarks.length>0&&(
<div style={{display:"flex",gap:6,flexWrap:"wrap",marginTop:4}}>
{c.entityMarks.map((m,j)=>(<span key={j} style={{fontSize:"0.55rem",fontFamily:C.mono,fontWeight:700,color:m.color,background:`${m.color}1a`,border:`1px solid ${m.color}55`,borderRadius:4,padding:"1px 6px"}}>{m.txt}</span>))}
{c.entityMarks.map((m,j)=>(<span key={j} style={{fontSize:"0.69rem",fontFamily:C.mono,fontWeight:700,color:m.color,background:`${m.color}1a`,border:`1px solid ${m.color}55`,borderRadius:4,padding:"1px 6px"}}>{m.txt}</span>))}
</div>
)}
</div>
@@ -423,7 +423,7 @@
{seccion("CONTEXTO")}
<div style={{display:"flex",flexDirection:"column",gap:8}}>
{report.recommendations.map((r,i)=>(
<div key={i} style={{padding:"8px 10px",background:r.fixed?C.redMuted:C.bgCard,border:`1px solid ${r.fixed?C.red:C.border}`,borderRadius:6,fontSize:"0.65rem",color:r.fixed?C.red:C.t2,lineHeight:1.6}}>
<div key={i} style={{padding:"8px 10px",background:r.fixed?C.redMuted:C.bgCard,border:`1px solid ${r.fixed?C.red:C.border}`,borderRadius:6,fontSize:"0.82rem",color:r.fixed?C.red:C.t2,lineHeight:1.6}}>
{r.text}
</div>
))}
@@ -434,15 +434,15 @@
{((report.mesa||[]).length>0||(report.vigiladas||[]).length>0)&&(
<div style={{marginBottom:14}}>
{seccion("MESA DE TRABAJO", C.amber)}
{(report.mesa||[]).map((m,i)=>(<div key={i} style={{fontSize:"0.64rem",color:C.t2,fontFamily:C.mono,marginBottom:3}}>★ <IdCopiable id={m.txid} n={16}/>{m.nota?` — ${m.nota}`:""}</div>))}
{(report.vigiladas||[]).map((v,i)=>(<div key={"v"+i} style={{fontSize:"0.64rem",color:C.t2,fontFamily:C.mono,marginBottom:3}}>◉ {abrevDir(v.address)} · {btcTxt(v.sats)} · última comprobación {v.ultima?fechaHora(v.ultima.fecha):"—"}</div>))}
{(report.mesa||[]).map((m,i)=>(<div key={i} style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:3}}>★ <IdCopiable id={m.txid} n={16}/>{m.nota?` — ${m.nota}`:""}</div>))}
{(report.vigiladas||[]).map((v,i)=>(<div key={"v"+i} style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:3}}>◉ {abrevDir(v.address)} · {btcTxt(v.sats)} · última comprobación {v.ultima?fechaHora(v.ultima.fecha):"—"}</div>))}
</div>
)}
{/* Metodología */}
<div style={{marginBottom:14}}>
{seccion("METODOLOGÍA")}
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.7,display:"flex",flexDirection:"column",gap:8}}>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7,display:"flex",flexDirection:"column",gap:8}}>
<div><strong style={{color:C.t1}}>Niveles de certeza:</strong> {report.methodology.levels}</div>
<div><strong style={{color:C.t1}}>Reglas usadas:</strong> {report.methodology.heuristics}</div>
<div><strong style={{color:C.t1}}>Límites:</strong> {report.methodology.limits}</div>
@@ -453,14 +453,14 @@
<div style={{marginBottom:14}}>
{seccion("GLOSARIO")}
<div style={{display:"flex",flexDirection:"column",gap:4}}>
{GLOSARIO_INFORME.map(([t,x])=>(<div key={t} style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.6}}><strong style={{color:C.t1}}>{t}:</strong> {x}</div>))}
{GLOSARIO_INFORME.map(([t,x])=>(<div key={t} style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}><strong style={{color:C.t1}}>{t}:</strong> {x}</div>))}
</div>
</div>
{/* Anexo de verificación */}
<div>
{seccion("ANEXO DE VERIFICACIÓN")}
<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
{report.verificationAppendix.txids.length===1?"1 txid":`${report.verificationAppendix.txids.length} txids`} · {report.verificationAppendix.addresses.length===1?"1 dirección":`${report.verificationAppendix.addresses.length} direcciones`}, completos en el informe descargado. Cualquiera puede comprobarlos en su propio nodo o en un explorador de bloques.
</div>
</div>
+15 -15
View File
@@ -1,33 +1,33 @@
function TxResult({tx, onAnalyze, base}) {
const [todasE,setTodasE]=useState(false), [todasS,setTodasS]=useState(false);
const nE = todasE ? tx.vin.length : 5, nS = todasS ? tx.vout.length : 5;
const verMas = (n, total, todas, set, que) => total > 5 && <button onClick={()=>set(v=>!v)} style={{marginTop:4,padding:"5px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.64rem",cursor:"pointer"}}>{todas ? `Ver solo las 5 primeras` : `…y ${fmt.num(total-5)} ${que} más: ver las ${fmt.num(total)}`}</button>;
const verMas = (n, total, todas, set, que) => total > 5 && <button onClick={()=>set(v=>!v)} style={{marginTop:4,padding:"5px 10px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>{todas ? `Ver solo las 5 primeras` : `…y ${fmt.num(total-5)} ${que} más: ver las ${fmt.num(total)}`}</button>;
return (
<div style={{display:"flex",flexDirection:"column",gap:10}}>
<Card glow={C.blue}>
<div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:12}}>
<div><div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,marginBottom:4}}>TRANSACCIÓN</div><div style={{fontSize:"0.7rem",fontFamily:C.mono,color:C.blue,wordBreak:"break-all"}}>{tx.txid}</div><div style={{display:"flex",gap:6,alignItems:"center",marginTop:6}}><BotonCopiar texto={tx.txid} etiqueta="el txid"/><VerEnMempool base={base} tipo="tx" id={tx.txid}/></div></div>
<div><div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:4}}>TRANSACCIÓN</div><div style={{fontSize:"0.7rem",fontFamily:C.mono,color:C.blue,wordBreak:"break-all"}}>{tx.txid}</div><div style={{display:"flex",gap:6,alignItems:"center",marginTop:6}}><BotonCopiar texto={tx.txid} etiqueta="el txid"/><VerEnMempool base={base} tipo="tx" id={tx.txid}/></div></div>
{tx.status&&tx.status.confirmed?<Badge color={C.green}>Confirmada · bloque {fmt.num(tx.status.block_height)}</Badge>:<Badge color={C.amber}>SIN CONFIRMAR</Badge>}
</div>
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(120px,1fr))",gap:12,paddingTop:12,borderTop:`1px solid ${C.border}`}}>
<Tag label="Bloque" value={tx.status&&tx.status.block_height!=null?`#${fmt.num(tx.status.block_height)}`:"mempool"} color={C.purple}/>
<Tag label="Comisión" value={fmtFee(comisionDe(tx))} color={C.amber}/>
<Tag label="Tarifa" value={fmtTasa(comisionDe(tx))} color={C.amber}/>
{comisionDe(tx).fee===0&&<div style={{gridColumn:"1 / -1",fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>{notaComisionCero(tx)}</div>}
{comisionDe(tx).fee===0&&<div style={{gridColumn:"1 / -1",fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>{notaComisionCero(tx)}</div>}
<Tag label="Tamaño virtual" value={tx.weight?`${Math.ceil(tx.weight/4)} vB`:"-"}/>
<Tag label="Tamaño en bytes" value={tx.size?`${tx.size} B`:"-"}/>
<Tag label="Fecha" value={tx.status&&tx.status.block_time?fmt.date(tx.status.block_time):"-"}/>
</div>
{onAnalyze&&<div style={{marginTop:12,paddingTop:12,borderTop:`1px solid ${C.border}`}}>
<button onClick={()=>onAnalyze(tx.txid)} style={{padding:"7px 16px",background:C.purpleMuted,border:`1px solid ${C.purple}40`,borderRadius:6,color:C.purple,fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer",fontWeight:700,letterSpacing:"0.1em"}}>
<button onClick={()=>onAnalyze(tx.txid)} style={{padding:"7px 16px",background:C.purpleMuted,border:`1px solid ${C.purple}40`,borderRadius:6,color:C.purple,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",fontWeight:700,letterSpacing:"0.1em"}}>
⌖ ANALIZAR PRIVACIDAD →
</button>
</div>}
</Card>
<div style={{display:"grid",gridTemplateColumns:"1fr 20px 1fr",gap:8,alignItems:"start"}}>
<Card><div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,marginBottom:10,textTransform:"uppercase"}}>Entradas ({tx.vin.length})</div>{tx.vin.slice(0,nE).map((inp,i)=><div key={i} style={{paddingBottom:8,marginBottom:8,borderBottom:i<Math.min(tx.vin.length,nE)-1?`1px solid ${C.border}`:"none"}}>{inp.is_coinbase?<div style={{fontSize:"0.68rem",color:C.amber,fontFamily:C.mono}}>coinbase</div>:<><div style={{fontSize:"0.62rem",fontFamily:C.mono,color:C.blue,marginBottom:3,wordBreak:"break-all"}}>{(inp.prevout&&inp.prevout.scriptpubkey_address?<IdEnlace base={base} tipo="direccion" id={inp.prevout.scriptpubkey_address} texto={fmt.hash(inp.prevout.scriptpubkey_address)}/>:etiquetaSinDir(inp.prevout))}</div>{inp.prevout&&inp.prevout.value!=null&&<div style={{fontSize:"0.68rem",color:C.red,fontFamily:C.mono}}>{fmt.btc(inp.prevout.value)}</div>}</>}</div>)}{verMas(nE, tx.vin.length, todasE, setTodasE, "entradas")}</Card>
<Card><div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:10,textTransform:"uppercase"}}>Entradas ({tx.vin.length})</div>{tx.vin.slice(0,nE).map((inp,i)=><div key={i} style={{paddingBottom:8,marginBottom:8,borderBottom:i<Math.min(tx.vin.length,nE)-1?`1px solid ${C.border}`:"none"}}>{inp.is_coinbase?<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono}}>coinbase</div>:<><div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.blue,marginBottom:3,wordBreak:"break-all"}}>{(inp.prevout&&inp.prevout.scriptpubkey_address?<IdEnlace base={base} tipo="direccion" id={inp.prevout.scriptpubkey_address} texto={fmt.hash(inp.prevout.scriptpubkey_address)}/>:etiquetaSinDir(inp.prevout))}</div>{inp.prevout&&inp.prevout.value!=null&&<div style={{fontSize:"0.69rem",color:C.red,fontFamily:C.mono}}>{fmt.btc(inp.prevout.value)}</div>}</>}</div>)}{verMas(nE, tx.vin.length, todasE, setTodasE, "entradas")}</Card>
<div style={{display:"flex",alignItems:"center",justifyContent:"center",color:C.amber,paddingTop:30,fontSize:"0.8rem"}}>▶</div>
<Card><div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,marginBottom:10,textTransform:"uppercase"}}>Salidas ({tx.vout.length})</div>{tx.vout.slice(0,nS).map((out,i)=><div key={i} style={{paddingBottom:8,marginBottom:8,borderBottom:i<Math.min(tx.vout.length,nS)-1?`1px solid ${C.border}`:"none"}}><div style={{fontSize:"0.62rem",fontFamily:C.mono,color:C.blue,marginBottom:3,wordBreak:"break-all"}}>{(out.scriptpubkey_address?<IdEnlace base={base} tipo="direccion" id={out.scriptpubkey_address} texto={fmt.hash(out.scriptpubkey_address)}/>:etiquetaSinDir(out))}</div><div style={{fontSize:"0.68rem",color:C.green,fontFamily:C.mono}}>{fmt.btc(out.value)}</div></div>)}{verMas(nS, tx.vout.length, todasS, setTodasS, "salidas")}</Card>
<Card><div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:10,textTransform:"uppercase"}}>Salidas ({tx.vout.length})</div>{tx.vout.slice(0,nS).map((out,i)=><div key={i} style={{paddingBottom:8,marginBottom:8,borderBottom:i<Math.min(tx.vout.length,nS)-1?`1px solid ${C.border}`:"none"}}><div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.blue,marginBottom:3,wordBreak:"break-all"}}>{(out.scriptpubkey_address?<IdEnlace base={base} tipo="direccion" id={out.scriptpubkey_address} texto={fmt.hash(out.scriptpubkey_address)}/>:etiquetaSinDir(out))}</div><div style={{fontSize:"0.69rem",color:C.green,fontFamily:C.mono}}>{fmt.btc(out.value)}</div></div>)}{verMas(nS, tx.vout.length, todasS, setTodasS, "salidas")}</Card>
</div>
</div>
);
@@ -45,7 +45,7 @@
const clave = { siempre:"Sí, siempre (va en la dirección)", si:"Sí (ya ha gastado)", no:"No (nunca ha gastado)" }[f.clavePublica] || nd;
return (
<Card>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:12}}>Ficha de la dirección</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:12}}>Ficha de la dirección</div>
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(150px,1fr))",gap:12}}>
<Tag label="Tipo" value={f.tipo||nd} color={C.t1}/>
<Tag label="Ha recibido" value={veces(f.recepciones, f.txRecibe)} color={C.blue}/>
@@ -56,7 +56,7 @@
{f.monedas&&<Tag label="Polvo sin gastar" value={`${fmt.num(f.monedas.polvo)} (menos de ${fmt.num(f.monedas.umbralPolvo)} sat)`} color={f.monedas.polvo?C.amber:C.t1}/>}
<Tag label="Sin confirmar" value={`${fmt.num(f.pendientes)} tx`} color={f.pendientes?C.amber:C.t1}/>
</div>
<div style={{marginTop:10,fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{marginTop:10,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
{f.completo
? <>Calculado con el historial completo ({fmt.num(f.vistas)} {f.vistas===1?"transacción":"transacciones"}).</>
: <>Historial parcial: llegaron {fmt.num(f.vistas)} de {fmt.num(f.total)} transacciones. Lo que necesita el historial entero (recuentos, «no reutilizada», «clave no visible») sale como «—».</>}
@@ -102,7 +102,7 @@
<Card glow={C.green}>
<div style={{marginBottom:12}}>
<div style={{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"}}>
<span style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono}}>DIRECCIÓN</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>DIRECCIÓN</span>
<VerEnMempool base={base} tipo="direccion" id={addr.address}/>
</div>
<div style={{fontSize:"0.72rem",fontFamily:C.mono,color:C.green,wordBreak:"break-all"}}>{addr.address}</div>
@@ -116,17 +116,17 @@
<Tag label="Monedas sin gastar" value={!sinHistorial&&Array.isArray(addr.utxos)?fmt.num(addr.utxos.length):"no disponible"} color={sinHistorial?C.t3:C.amber}/>
</div>
{sinHistorial&&(
<div style={{marginTop:12,padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}40`,borderRadius:6,fontSize:"0.63rem",color:C.t1,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{marginTop:12,padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}40`,borderRadius:6,fontSize:"0.82rem",color:C.t1,fontFamily:C.mono,lineHeight:1.6}}>
<strong style={{color:C.amber}}>Historial no disponible.</strong> Tu nodo da el saldo de esta dirección pero ninguna de sus transacciones. No está sin usar: suele ser una dirección con muchísimo historial (un exchange o un servicio), y Fulcrum no entrega historiales por encima de su tope (<code>max_history</code>). El saldo sí es el que da tu nodo; el resto no se puede saber desde aquí.
</div>
)}
{sumados&&(
<div style={{marginTop:10,fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{marginTop:10,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.6}}>
Totales calculados aquí sumando {sumados.transacciones===1?"su única transacción":`sus ${fmt.num(sumados.transacciones)} transacciones`} (solo lo confirmado); cuadran con el saldo que da tu nodo.
</div>
)}
{sinTotales&&!sinHistorial&&(
<div style={{marginTop:12,padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}40`,borderRadius:6,fontSize:"0.63rem",color:C.t1,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{marginTop:12,padding:"9px 12px",background:C.amberMuted,border:`1px solid ${C.amber}40`,borderRadius:6,fontSize:"0.82rem",color:C.t1,fontFamily:C.mono,lineHeight:1.6}}>
{electrum ? <>
<strong style={{color:C.amber}}>Totales no disponibles.</strong> Tu Mempool consulta a Fulcrum (protocolo Electrum), que da el saldo y la lista de transacciones de cada dirección, pero no el total recibido ni el enviado: para eso habría que sumar las {fmt.num(c.tx_count)} transacciones una a una. La web de tu Mempool tampoco los enseña. El balance, el número de transacciones y la lista de abajo sí son correctos.
{!Array.isArray(addr.utxos)&&<> Las monedas sin gastar (UTXOs) tampoco llegan: tu versión de Mempool no ofrece esa consulta con Fulcrum (las versiones recientes sí), y el historial es demasiado largo para reconstruirlas desde aquí.</>}
@@ -138,13 +138,13 @@
</Card>
<FichaDireccionCard ficha={ficha}/>
{analysis&&<PrivacyLab analysis={analysis} addr={addr}/>}
{addr.utxos&&addr.utxos.length>0&&<Card><div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:10}}>Monedas sin gastar (UTXOs)</div>{addr.utxos.slice(0,verTodasU?addr.utxos.length:6).map((u,i)=><div key={i} style={{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"wrap",padding:"6px 0",borderBottom:i<Math.min(addr.utxos.length,verTodasU?addr.utxos.length:6)-1?`1px solid ${C.border}`:"none"}}><span style={{fontSize:"0.68rem",fontFamily:C.mono,color:C.t2,display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"}}><IdEnlace base={base} tipo="tx" id={u.txid} texto={fmt.hash(u.txid)}/> salida {u.vout}</span><div style={{display:"flex",gap:6}}><Badge color={C.green}>{fmt.btc(u.value)}</Badge><Badge color={u.status&&u.status.confirmed?C.t2:C.amber}>{u.status&&u.status.confirmed?`#${fmt.num(u.status.block_height)}`:"mempool"}</Badge></div></div>)}{addr.utxos.length>6&&<button onClick={()=>setVerTodasU(v=>!v)} style={{marginTop:8,padding:"6px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.66rem",cursor:"pointer"}}>{verTodasU?"Ver solo 6":`Ver las ${fmt.num(addr.utxos.length)}`}</button>}</Card>}
{addr.txs&&addr.txs.length>0&&<Card><div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:10}}>Transacciones</div>{addr.txs.slice(0,verTodasTx?addr.txs.length:8).map((tx,i)=>{/* Efecto neto en ESTA dirección (con signo), no la suma de todas las salidas de la transacción (revisión UX-05). */ const rec=(tx.vout||[]).filter(v=>v.scriptpubkey_address===addr.address).reduce((s,v)=>s+v.value,0); const gas=(tx.vin||[]).filter(v=>v.prevout?.scriptpubkey_address===addr.address).reduce((s,v)=>s+(v.prevout.value||0),0); const neto=rec-gas;return<div key={i} style={{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"wrap",padding:"7px 0",borderBottom:i<Math.min(addr.txs.length,verTodasTx?addr.txs.length:8)-1?`1px solid ${C.border}`:"none"}}><div><IdEnlace base={base} tipo="tx" id={tx.txid} texto={fmt.hash(tx.txid)}/><div style={{fontSize:"0.6rem",color:C.t2,marginTop:2}}>{tx.status&&tx.status.block_time?fmt.date(tx.status.block_time):"pendiente"}</div></div><div style={{display:"flex",gap:6}}><Badge color={tx.status&&tx.status.confirmed?C.t2:C.amber}>{tx.status&&tx.status.confirmed?"confirmada":"sin confirmar"}</Badge><Badge color={neto>=0?C.green:C.amber}>{neto>=0?"+":""}{fmt.btc(neto)}</Badge></div></div>;})}{addr.txs.length>8&&<button onClick={()=>setVerTodasTx(v=>!v)} style={{marginTop:8,padding:"6px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.66rem",cursor:"pointer"}}>{verTodasTx?"Ver solo las 8 últimas":`Ver las ${fmt.num(addr.txs.length)} descargadas`}</button>}<div style={{fontSize:"0.58rem",color:C.t3,marginTop:6}}>Importe: lo que entró (+) o salió (−) de esta dirección en cada transacción.</div></Card>}
{addr.utxos&&addr.utxos.length>0&&<Card><div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:10}}>Monedas sin gastar (UTXOs)</div>{addr.utxos.slice(0,verTodasU?addr.utxos.length:6).map((u,i)=><div key={i} style={{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"wrap",padding:"6px 0",borderBottom:i<Math.min(addr.utxos.length,verTodasU?addr.utxos.length:6)-1?`1px solid ${C.border}`:"none"}}><span style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"}}><IdEnlace base={base} tipo="tx" id={u.txid} texto={fmt.hash(u.txid)}/> salida {u.vout}</span><div style={{display:"flex",gap:6}}><Badge color={C.green}>{fmt.btc(u.value)}</Badge><Badge color={u.status&&u.status.confirmed?C.t2:C.amber}>{u.status&&u.status.confirmed?`#${fmt.num(u.status.block_height)}`:"mempool"}</Badge></div></div>)}{addr.utxos.length>6&&<button onClick={()=>setVerTodasU(v=>!v)} style={{marginTop:8,padding:"6px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>{verTodasU?"Ver solo 6":`Ver las ${fmt.num(addr.utxos.length)}`}</button>}</Card>}
{addr.txs&&addr.txs.length>0&&<Card><div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:10}}>Transacciones</div>{addr.txs.slice(0,verTodasTx?addr.txs.length:8).map((tx,i)=>{/* Efecto neto en ESTA dirección (con signo), no la suma de todas las salidas de la transacción (revisión UX-05). */ const rec=(tx.vout||[]).filter(v=>v.scriptpubkey_address===addr.address).reduce((s,v)=>s+v.value,0); const gas=(tx.vin||[]).filter(v=>v.prevout?.scriptpubkey_address===addr.address).reduce((s,v)=>s+(v.prevout.value||0),0); const neto=rec-gas;return<div key={i} style={{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"wrap",padding:"7px 0",borderBottom:i<Math.min(addr.txs.length,verTodasTx?addr.txs.length:8)-1?`1px solid ${C.border}`:"none"}}><div><IdEnlace base={base} tipo="tx" id={tx.txid} texto={fmt.hash(tx.txid)}/><div style={{fontSize:"0.69rem",color:C.t2,marginTop:2}}>{tx.status&&tx.status.block_time?fmt.date(tx.status.block_time):"pendiente"}</div></div><div style={{display:"flex",gap:6}}><Badge color={tx.status&&tx.status.confirmed?C.t2:C.amber}>{tx.status&&tx.status.confirmed?"confirmada":"sin confirmar"}</Badge><Badge color={neto>=0?C.green:C.amber}>{neto>=0?"+":""}{fmt.btc(neto)}</Badge></div></div>;})}{addr.txs.length>8&&<button onClick={()=>setVerTodasTx(v=>!v)} style={{marginTop:8,padding:"6px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>{verTodasTx?"Ver solo las 8 últimas":`Ver las ${fmt.num(addr.txs.length)} descargadas`}</button>}<div style={{fontSize:"0.69rem",color:C.t3,marginTop:6}}>Importe: lo que entró (+) o salió (−) de esta dirección en cada transacción.</div></Card>}
</div>
);
}
function BlockResult({block}) {
return <Card glow={C.purple}><div style={{marginBottom:12}}><div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,marginBottom:4}}>BLOQUE</div><div style={{fontSize:"0.88rem",color:C.purple,fontFamily:C.mono,fontWeight:700}}>#{fmt.num(block.height)}</div><div style={{fontSize:"0.68rem",fontFamily:C.mono,color:C.t2,wordBreak:"break-all",marginTop:4}}>{block.id}</div></div><div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(130px,1fr))",gap:12,paddingTop:12,borderTop:`1px solid ${C.border}`}}><Tag label="Transacciones" value={fmt.num(block.tx_count)} color={C.blue}/><Tag label="Tamaño" value={fmt.mb(block.size)} color={C.t1}/><Tag label="Fees totales" value={block.extras&&block.extras.totalFees!=null?fmt.sbtc(block.extras.totalFees):"-"} color={C.amber}/><Tag label="Minero" value={block.extras&&block.extras.pool?block.extras.pool.name:"-"} color={C.green}/><Tag label="Fecha" value={fmt.date(block.timestamp)} color={C.t1}/></div></Card>;
return <Card glow={C.purple}><div style={{marginBottom:12}}><div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:4}}>BLOQUE</div><div style={{fontSize:"0.88rem",color:C.purple,fontFamily:C.mono,fontWeight:700}}>#{fmt.num(block.height)}</div><div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,wordBreak:"break-all",marginTop:4}}>{block.id}</div></div><div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(130px,1fr))",gap:12,paddingTop:12,borderTop:`1px solid ${C.border}`}}><Tag label="Transacciones" value={fmt.num(block.tx_count)} color={C.blue}/><Tag label="Tamaño" value={fmt.mb(block.size)} color={C.t1}/><Tag label="Fees totales" value={block.extras&&block.extras.totalFees!=null?fmt.sbtc(block.extras.totalFees):"-"} color={C.amber}/><Tag label="Minero" value={block.extras&&block.extras.pool?block.extras.pool.name:"-"} color={C.green}/><Tag label="Fecha" value={fmt.date(block.timestamp)} color={C.t1}/></div></Card>;
}
+25 -25
View File
@@ -20,7 +20,7 @@
const modo = ALMACEN.modoMemoria();
const total = lista.reduce((s, x) => s + x.bytes, 0);
const refrescar = () => setTick(n => n + 1);
const boton = {fontFamily:C.mono,fontSize:"0.68rem",padding:"6px 10px",borderRadius:6,border:`1px solid ${C.borderBright}`,background:"none",color:C.t2,cursor:"pointer"};
const boton = {fontFamily:C.mono,fontSize:"0.69rem",padding:"6px 10px",borderRadius:6,border:`1px solid ${C.borderBright}`,background:"none",color:C.t2,cursor:"pointer"};
const exportar = () => {
const blob = new Blob([JSON.stringify(ALMACEN.exportar(), null, 2)], {type:"application/json;charset=utf-8"});
const url = URL.createObjectURL(blob); const a = document.createElement("a");
@@ -51,16 +51,16 @@
return (
<div style={{marginTop:16,paddingTop:12,borderTop:`1px solid ${C.border}`}}>
<button onClick={()=>setAbierto(a=>!a)} style={{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",background:"none",border:"none",cursor:"pointer",padding:0,color:C.t1,textAlign:"left"}}>
<span style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase"}}>Datos guardados en este navegador</span>
<span style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2}}>{lista.length} · {tamTxt(total)} {abierto?"▴":"▾"}</span>
<span style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase"}}>Datos guardados en este navegador</span>
<span style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2}}>{lista.length} · {tamTxt(total)} {abierto?"▴":"▾"}</span>
</button>
{abierto&&(
<div style={{marginTop:10,display:"flex",flexDirection:"column",gap:10}}>
{lista.length===0
? <div style={{fontSize:"0.68rem",color:C.t3}}>Nada guardado.</div>
? <div style={{fontSize:"0.69rem",color:C.t3}}>Nada guardado.</div>
: <div style={{display:"flex",flexDirection:"column",gap:4}}>
{lista.map(x=>(
<div key={x.clave} style={{display:"flex",gap:8,fontSize:"0.66rem",color:C.t2,lineHeight:1.4}}>
<div key={x.clave} style={{display:"flex",gap:8,fontSize:"0.69rem",color:C.t2,lineHeight:1.4}}>
<span style={{flex:1,minWidth:0}}>{x.nombre}{x.donde==="memoria"&&<span style={{color:C.amber}}> · solo en esta pestaña</span>}</span>
<span style={{fontFamily:C.mono,whiteSpace:"nowrap"}}>{tamTxt(x.bytes)}</span>
</div>
@@ -71,12 +71,12 @@
<input type="checkbox" checked={modo} onChange={e=>{ if(e.target.checked){ setConfModo(true); } else { const fallidas = ALMACEN.setModoMemoria(false) || []; refrescar(); setMsg(fallidas.length ? `Modo «no guardar nada» desactivado, pero el navegador no ha dejado guardar ${fallidas.length} dato(s): siguen solo en esta pestaña y se perderán al cerrarla.` : "Modo «no guardar nada» desactivado: lo de esta pestaña se ha guardado."); } }} style={{marginTop:2,accentColor:C.amber}}/>
<div>
<div style={{fontSize:"0.72rem",color:modo?C.amber:C.t1,fontFamily:C.mono,fontWeight:modo?700:400}}>No guardar nada</div>
<div style={{fontSize:"0.62rem",color:C.t2,lineHeight:1.5,marginTop:2}}>Todo vive solo en la memoria de esta pestaña y se pierde al cerrarla. Lo único que se guarda es este interruptor, para recordar que está activo.</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5,marginTop:2}}>Todo vive solo en la memoria de esta pestaña y se pierde al cerrarla. Lo único que se guarda es este interruptor, para recordar que está activo.</div>
</div>
</label>
{confModo&&(
<div style={{padding:"8px 10px",border:`1px solid ${C.amber}55`,borderRadius:6,background:C.amberMuted,display:"flex",flexDirection:"column",gap:6}}>
<div style={{fontSize:"0.66rem",color:C.t1,lineHeight:1.5}}>¿Qué hacer con lo que ya está guardado ({(n=>`${n} ${n===1?"dato":"datos"}`)(lista.filter(x=>x.clave!=="modo-memoria").length)})?</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.5}}>¿Qué hacer con lo que ya está guardado ({(n=>`${n} ${n===1?"dato":"datos"}`)(lista.filter(x=>x.clave!=="modo-memoria").length)})?</div>
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}>
<button onClick={()=>{ALMACEN.setModoMemoria(true,true);setConfModo(false);refrescar();setMsg("Activado. Lo guardado se ha borrado del navegador; sigue en esta pestaña hasta cerrarla.");}} style={{...boton,color:C.red,borderColor:`${C.red}70`}}>Borrarlo y activar</button>
<button onClick={()=>{ALMACEN.setModoMemoria(true,false);setConfModo(false);refrescar();setMsg("Activado. Lo ya guardado sigue en el navegador; lo nuevo, no.");}} style={boton}>Dejarlo y activar</button>
@@ -92,9 +92,9 @@
</div>
{imp&&(
<div style={{padding:"8px 10px",border:`1px solid ${imp.val.ok?C.blue:C.red}55`,borderRadius:6,background:imp.val.ok?C.blueMuted:C.redMuted,display:"flex",flexDirection:"column",gap:6}}>
<div style={{fontSize:"0.66rem",color:C.t1}}>{imp.nombre}</div>
{imp.val.errores.map((e,i)=><div key={i} style={{fontSize:"0.64rem",color:imp.val.ok?C.amber:C.red}}>{e}</div>)}
{imp.val.entradas.length>0&&<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.5}}>Se importaría:{imp.val.entradas.map(x=><div key={x.clave}>· {x.nombre}{x.existe?" (ya hay uno: se sustituye)":""}</div>)}</div>}
<div style={{fontSize:"0.69rem",color:C.t1}}>{imp.nombre}</div>
{imp.val.errores.map((e,i)=><div key={i} style={{fontSize:"0.69rem",color:imp.val.ok?C.amber:C.red}}>{e}</div>)}
{imp.val.entradas.length>0&&<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.5}}>Se importaría:{imp.val.entradas.map(x=><div key={x.clave}>· {x.nombre}{x.existe?" (ya hay uno: se sustituye)":""}</div>)}</div>}
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}>
{imp.val.ok&&<button onClick={()=>importar("fusionar")} style={boton}>Añadir a lo que hay</button>}
{imp.val.ok&&<button onClick={()=>importar("reemplazar")} style={{...boton,color:C.red,borderColor:`${C.red}70`}}>Sustituir todo</button>}
@@ -106,14 +106,14 @@
{!confBorrar
? <button onClick={()=>setConfBorrar(true)} style={{...boton,alignSelf:"flex-start",color:C.red,borderColor:`${C.red}70`}}>Borrar todo</button>
: <div style={{padding:"8px 10px",border:`1px solid ${C.red}55`,borderRadius:6,background:C.redMuted,display:"flex",flexDirection:"column",gap:6}}>
<div style={{fontSize:"0.66rem",color:C.t1,lineHeight:1.5}}>Se borrará todo lo de la lista (también la URL del nodo, el tema, las marcas y notas) y lo que la app tiene en memoria. La app vuelve a empezar como recién abierta. No se puede deshacer.</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.5}}>Se borrará todo lo de la lista (también la URL del nodo, el tema, las marcas y notas) y lo que la app tiene en memoria. La app vuelve a empezar como recién abierta. No se puede deshacer.</div>
<div style={{display:"flex",gap:6,flexWrap:"wrap"}}>
<button onClick={borrarTodo} style={{...boton,color:C.red,borderColor:C.red,fontWeight:700}}>Sí, borrar todo</button>
<button onClick={()=>setConfBorrar(false)} style={boton}>Cancelar</button>
</div>
</div>}
{msg&&<div style={{fontSize:"0.64rem",color:C.green,lineHeight:1.5}}>{msg}</div>}
<div style={{fontSize:"0.62rem",color:C.t3,lineHeight:1.55}}>
{msg&&<div style={{fontSize:"0.82rem",color:C.green,lineHeight:1.5}}>{msg}</div>}
<div style={{fontSize:"0.82rem",color:C.t3,lineHeight:1.55}}>
Esto solo alcanza a lo que guarda Txoko. No borra el historial ni la caché del propio navegador, ni los registros de nginx en tu nodo, que anotan la ruta de cada consulta: qué transacciones y direcciones se han mirado.
</div>
</div>
@@ -171,34 +171,34 @@
<span style={{fontFamily:C.mono,color:C.green,fontSize:"0.82rem",fontWeight:700}}>AJUSTES</span>
<button onClick={onClose} style={{background:"none",border:"none",color:C.t2,cursor:"pointer",fontSize:"1rem",fontFamily:C.mono}}>✕</button>
</div>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Red</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Red</div>
<Segmentos color={signet?C.purple:C.green} valor={red} onCambio={setRed} opciones={[{id:"mainnet",label:"Mainnet · tu nodo"},{id:"signet",label:"Signet · pruebas"}]}/>
{signet&&<div style={{fontSize:"0.65rem",color:C.t2,marginBottom:14,lineHeight:1.6}}>Signet es la red de pruebas: las monedas no valen nada. Por defecto las consultas van a tu nodo, <span style={{fontFamily:C.mono,color:C.t1}}>{signetPorDefecto(urlMain)||"(pon antes la URL de mainnet)"}</span>, que las reenvía por <strong>Tor</strong> a mempool.space: no ve tu IP. Necesita en el nodo el servicio <span style={{fontFamily:C.mono}}>txoko-signet-tor</span> y su bloque de nginx (ver SETUP). Si algún día montas tu propia Mempool de signet, pon su URL abajo. Las direcciones de mainnet nunca se envían en modo signet.</div>}
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Nombre del nodo</div>
{signet&&<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:14,lineHeight:1.6}}>Signet es la red de pruebas: las monedas no valen nada. Por defecto las consultas van a tu nodo, <span style={{fontFamily:C.mono,color:C.t1}}>{signetPorDefecto(urlMain)||"(pon antes la URL de mainnet)"}</span>, que las reenvía por <strong>Tor</strong> a mempool.space: no ve tu IP. Necesita en el nodo el servicio <span style={{fontFamily:C.mono}}>txoko-signet-tor</span> y su bloque de nginx (ver SETUP). Si algún día montas tu propia Mempool de signet, pon su URL abajo. Las direcciones de mainnet nunca se envían en modo signet.</div>}
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Nombre del nodo</div>
<input value={name} onChange={e=>setName(e.target.value)} placeholder="Mi nodo"
style={{width:"100%",background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"10px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.8rem",outline:"none",boxSizing:"border-box",marginBottom:14}}/>
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>{signet?"URL de la Mempool de signet":"URL de tu Mempool"}</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>{signet?"URL de la Mempool de signet":"URL de tu Mempool"}</div>
<input value={signet?urlSig:urlMain} onChange={e=>setUrl(e.target.value)} placeholder={signet?(signetPorDefecto(urlMain)||"https://tu-nodo:4083/signet-tor"):(paginaHttps?"https://100.x.x.x:4083":"http://100.x.x.x:4080")}
style={{width:"100%",background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"10px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.8rem",outline:"none",boxSizing:"border-box",marginBottom:8}}/>
{choqueProtocolo&&<div style={{fontSize:"0.66rem",color:C.red,marginBottom:8,lineHeight:1.55}}>Esta página está abierta con <strong>https</strong>: el navegador bloqueará una URL <strong>http</strong> sin avisar. Usa la versión https: la de Txoko, <span style={{fontFamily:C.mono}}>https://IP-DE-TU-NODO:4083</span>.</div>}
{!signet&&<div style={{fontSize:"0.65rem",color:C.t2,marginBottom:12,lineHeight:1.6}}>
{choqueProtocolo&&<div style={{fontSize:"0.82rem",color:C.red,marginBottom:8,lineHeight:1.55}}>Esta página está abierta con <strong>https</strong>: el navegador bloqueará una URL <strong>http</strong> sin avisar. Usa la versión https: la de Txoko, <span style={{fontFamily:C.mono}}>https://IP-DE-TU-NODO:4083</span>.</div>}
{!signet&&<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:12,lineHeight:1.6}}>
{origen
? <>Si has abierto Txoko desde tu nodo, es la misma URL que la de esta página: <span style={{fontFamily:C.mono,color:C.t1}}>{origen}</span>{url.trim().replace(/\/$/,"")!==origen&&<button onClick={()=>setUrl(origen)} style={{marginLeft:8,padding:"2px 8px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.blue,fontFamily:C.mono,fontSize:"0.62rem",cursor:"pointer"}}>usar esta</button>}</>
? <>Si has abierto Txoko desde tu nodo, es la misma URL que la de esta página: <span style={{fontFamily:C.mono,color:C.t1}}>{origen}</span>{url.trim().replace(/\/$/,"")!==origen&&<button onClick={()=>setUrl(origen)} style={{marginLeft:8,padding:"2px 8px",background:"none",border:`1px solid ${C.border}`,borderRadius:4,color:C.blue,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>usar esta</button>}</>
: <>IP Tailscale del nodo con el puerto de Txoko: <span style={{fontFamily:C.mono}}>https://100.x.x.x:4083</span>. También vale la de Mempool (<span style={{fontFamily:C.mono}}>https://100.x.x.x:4081</span>, o <span style={{fontFamily:C.mono}}>http://100.x.x.x:4080</span> si abres Txoko por http).</>}
</div>}
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Web de Mempool (para los enlaces ↗) · opcional</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Web de Mempool (para los enlaces ↗) · opcional</div>
<input value={web} onChange={e=>setWeb(e.target.value)} placeholder={webPropuesta||"https://100.x.x.x:4081"}
style={{width:"100%",background:C.bg,border:`1px solid ${webOk?C.borderBright:C.red}`,borderRadius:6,padding:"10px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.8rem",outline:"none",boxSizing:"border-box",marginBottom:8}}/>
<div style={{fontSize:"0.65rem",color:webOk?C.t2:C.red,marginBottom:14,lineHeight:1.6}}>
<div style={{fontSize:"0.82rem",color:webOk?C.t2:C.red,marginBottom:14,lineHeight:1.6}}>
{webOk
? sigTor ? <>Por Tor no hay web que abrir: abrir mempool.space en el navegador enseñaría tu IP. Vacío: sin enlaces ↗ (queda el botón de copiar).</> : <>Es la página de Mempool que se abre al pulsar un txid o una dirección. Vacío: se usa <span style={{fontFamily:C.mono,color:C.t1}}>{webPropuesta||"la dirección de arriba"}</span>{/:4083\b/.test(url)?" (Txoko tiene su propio puerto, 4083; Mempool está en el 4081/4080)":""}.</>
: "Debe empezar por http:// o https://."}
</div>
{/* Tema: antes eran cuatro puntos de color en la cabecera que parecían luces de estado. */}
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Tema de color</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:6}}>Tema de color</div>
<div style={{display:"flex",gap:6,flexWrap:"wrap",marginBottom:16}}>
{THEME_META.map(t=>(
<button key={t.id} onClick={()=>onTheme&&onTheme(t.id)} style={{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",borderRadius:6,cursor:"pointer",background:themeId===t.id?C.bgCard:"none",border:`1px solid ${themeId===t.id?t.dot:C.border}`,color:themeId===t.id?C.t1:C.t2,fontFamily:C.mono,fontSize:"0.68rem"}}>
<button key={t.id} onClick={()=>onTheme&&onTheme(t.id)} style={{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",borderRadius:6,cursor:"pointer",background:themeId===t.id?C.bgCard:"none",border:`1px solid ${themeId===t.id?t.dot:C.border}`,color:themeId===t.id?C.t1:C.t2,fontFamily:C.mono,fontSize:"0.69rem"}}>
<span style={{width:12,height:12,borderRadius:"50%",background:t.dot,display:"inline-block"}}/>{t.label}
</button>
))}
@@ -211,7 +211,7 @@
<div style={{fontSize:"0.72rem",color:remember?C.amber:C.t2,fontFamily:C.mono,fontWeight:remember?700:400}}>
Recordar configuración
</div>
<div style={{fontSize:"0.62rem",color:C.t3,marginTop:3,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t3,marginTop:3,lineHeight:1.5}}>
{remember
? "La URL y el nombre se guardarán en este navegador. De tu nodo no se guarda ningún dato, solo su URL."
: "Sin marcar, tendrás que escribir la URL cada vez que abras Txoko."}
+13 -13
View File
@@ -77,7 +77,7 @@
return (
<Card>
<div style={{fontSize:"0.62rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:14}}>Conversor sat / BTC / EUR / USD</div>
<div style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:14}}>Conversor sat / BTC / EUR / USD</div>
<div style={{display:"flex",flexDirection:"column",gap:10}}>
{[
{label:"Satoshis", value:escrito.SAT??(sats?fmt.num(sats):""), placeholder:"100000", onChange:e=>handleSats(e.target.value), color:C.amber},
@@ -96,11 +96,11 @@
</div>
))}
</div>
{aviso&&<div role="status" style={{fontSize:"0.66rem",color:C.amber,fontFamily:C.mono,marginTop:10}}>⚠ {aviso}</div>}
{price&&<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,marginTop:10}}>Precio de 1 BTC: {fmtMoneda(price.USD)} USD · {fmtMoneda(price.EUR)} EUR · según tu Mempool</div>}
{RED.signet&&<div style={{fontSize:"0.62rem",color:C.purple,fontFamily:C.mono,marginTop:10}}>Signet: las monedas no tienen valor, así que no hay precio de mercado.</div>}
{!RED.signet&&!price&&base&&<div style={{fontSize:"0.62rem",color:C.amber,fontFamily:C.mono,marginTop:10}}>Tu Mempool no da precio. Se activa con FIAT_PRICE en su configuración (mempool-config.json) y reiniciando su servicio.</div>}
{!RED.signet&&!base&&<div style={{fontSize:"0.62rem",color:C.amber,fontFamily:C.mono,marginTop:10}}>Sin nodo no hay precio: lo da tu propio Mempool.</div>}
{aviso&&<div role="status" style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,marginTop:10}}>⚠ {aviso}</div>}
{price&&<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginTop:10}}>Precio de 1 BTC: {fmtMoneda(price.USD)} USD · {fmtMoneda(price.EUR)} EUR · según tu Mempool</div>}
{RED.signet&&<div style={{fontSize:"0.69rem",color:C.purple,fontFamily:C.mono,marginTop:10}}>Signet: las monedas no tienen valor, así que no hay precio de mercado.</div>}
{!RED.signet&&!price&&base&&<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,marginTop:10}}>Tu Mempool no da precio. Se activa con FIAT_PRICE en su configuración (mempool-config.json) y reiniciando su servicio.</div>}
{!RED.signet&&!base&&<div style={{fontSize:"0.69rem",color:C.amber,fontFamily:C.mono,marginTop:10}}>Sin nodo no hay precio: lo da tu propio Mempool.</div>}
</Card>
);
}
@@ -147,7 +147,7 @@
return (
<Card>
<div style={{fontSize:"0.62rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:14}}>Comprobar formato de dirección</div>
<div style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:14}}>Comprobar formato de dirección</div>
<div style={{display:"flex",gap:8,marginBottom:12}}>
<input value={addr} onChange={e=>setAddr(filtrarSecreto(e.target.value))} onKeyDown={e=>e.key==="Enter"&&validate()}
placeholder="Pega una dirección para comprobarla"
@@ -168,8 +168,8 @@
<div style={{display:"flex",flexDirection:"column",gap:4}}>
{result.details.map((d,i)=>(
<div key={i} style={{display:"flex",alignItems:"center",gap:6}}>
<span style={{color:C.t2,fontSize:"0.65rem"}}>·</span>
<span style={{fontSize:"0.68rem",color:C.t2}}>{d}</span>
<span style={{color:C.t2,fontSize:"0.69rem"}}>·</span>
<span style={{fontSize:"0.69rem",color:C.t2}}>{d}</span>
</div>
))}
</div>
@@ -217,8 +217,8 @@
return (
<Card>
<div style={{fontSize:"0.62rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Detector OP_RETURN</div>
<div style={{fontSize:"0.65rem",color:C.t2,marginBottom:12}}>Indica si una transacción contiene datos arbitrarios (OP_RETURN) y su tamaño.</div>
<div style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Detector OP_RETURN</div>
<div style={{fontSize:"0.69rem",color:C.t2,marginBottom:12}}>Indica si una transacción contiene datos arbitrarios (OP_RETURN) y su tamaño.</div>
<div style={{display:"flex",gap:8,marginBottom:12}}>
<input value={txid} onChange={e=>setTxid(filtrarSecreto(e.target.value))} onKeyDown={e=>e.key==="Enter"&&decode()}
placeholder="txid de una transacción"
@@ -236,11 +236,11 @@
Lleva {result.count===1?"1 salida":`${result.count} salidas`} de datos (OP_RETURN).
</div>
{result.outputs.map((o,i)=>(
<div key={i} style={{fontSize:"0.65rem",color:C.t2,fontFamily:C.mono,marginTop:4}}>
<div key={i} style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginTop:4}}>
Salida {o.vout!=null?o.vout:i}: {o.bytes} bytes de datos
</div>
))}
<div style={{fontSize:"0.6rem",color:C.t3,marginTop:10,lineHeight:1.5}}>
<div style={{fontSize:"0.82rem",color:C.t3,marginTop:10,lineHeight:1.5}}>
Se indica la presencia y el tamaño, no el contenido. Un OP_RETURN puede revelar qué protocolo o servicio se usó — ese es el dato relevante para tu privacidad.
</div>
</div>
+28 -28
View File
@@ -40,8 +40,8 @@
return (
<Card>
<div style={{fontSize:"0.62rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Auditoría de PSBT</div>
<div style={{fontSize:"0.65rem",color:C.t2,marginBottom:12,lineHeight:1.6}}>
<div style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Auditoría de PSBT</div>
<div style={{fontSize:"0.82rem",color:C.t2,marginBottom:12,lineHeight:1.6}}>
Revisa una transacción <strong style={{color:C.t1}}>antes de firmarla</strong>, cuando todavía puedes cambiarla. Todo se analiza en tu navegador: el archivo no se envía a ningún sitio, ni siquiera a tu nodo.
</div>
<textarea value={input} onChange={e=>cambiarTexto(filtrarSecreto(e.target.value))}
@@ -60,13 +60,13 @@
{(input||result||err)&&<button onClick={limpiar} style={{padding:"9px 14px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.7rem",cursor:"pointer"}}>Limpiar</button>}
</div>
{err&&<div style={{padding:"10px 12px",background:C.redMuted,border:`1px solid ${C.red}40`,borderRadius:6,color:C.red,fontFamily:C.mono,fontSize:"0.7rem",lineHeight:1.6}}>{err}</div>}
{err&&<div style={{padding:"10px 12px",background:C.redMuted,border:`1px solid ${C.red}40`,borderRadius:6,color:C.red,fontFamily:C.mono,fontSize:"0.82rem",lineHeight:1.6}}>{err}</div>}
{result&&(
<div style={{display:"flex",flexDirection:"column",gap:12}}>
{/* Resumen de la transacción */}
<div style={{padding:"12px 14px",background:C.bg,borderRadius:6,border:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,fontWeight:700,letterSpacing:"0.12em",marginBottom:10}}>QUÉ HACE ESTA TRANSACCIÓN</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,fontWeight:700,letterSpacing:"0.12em",marginBottom:10}}>QUÉ HACE ESTA TRANSACCIÓN</div>
<div style={{display:"flex",gap:18,flexWrap:"wrap"}}>
<Tag label="Entradas" value={R.entradas}/>
<Tag label="Salidas" value={R.salidas}/>
@@ -75,7 +75,7 @@
{R.fee!=null&&<Tag label="Comisión" value={R.importesInvalidos?"no cuadra (las salidas suman más que las entradas): la PSBT está mal o le faltan datos de las entradas":`${fmt.num(R.fee)} sat`} color={R.importesInvalidos?C.red:C.amber}/>}
<Tag label="Firmas ya puestas" value={R.firmasPresentes}/>
</div>
<div style={{marginTop:10,fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,lineHeight:1.7}}>
<div style={{marginTop:10,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.7}}>
Gasta monedas de tipo {R.tiposEntrada.join(", ")||"desconocido"} · envía a {R.tiposSalida.join(", ")}<br/>
{R.rbf ? "Señaliza RBF (BIP125) en sus entradas." : "No señaliza RBF (BIP125) en sus entradas. Que se pueda reemplazar depende también de la política de los nodos (Bitcoin Core acepta reemplazos sin señal desde la versión 28) y de lo que permita tu monedero."}
{R.locktime>0 && (R.locktime < 500000000
@@ -86,19 +86,19 @@
{/* Avisos */}
{result.avisos.length===0 ? (
<div style={{padding:"12px 14px",background:C.greenMuted,border:`1px solid ${C.green}40`,borderRadius:6,fontSize:"0.68rem",color:C.green,fontFamily:C.mono}}>
<div style={{padding:"12px 14px",background:C.greenMuted,border:`1px solid ${C.green}40`,borderRadius:6,fontSize:"0.69rem",color:C.green,fontFamily:C.mono}}>
✓ No se detectan problemas de privacidad en la estructura de esta transacción.
</div>
) : result.avisos.map((a,i)=>(
<div key={i} style={{padding:"12px 14px",background:C.bgCard,borderRadius:6,border:`1px solid ${colorNivel(a.nivel)}40`}}>
<div style={{display:"flex",alignItems:"center",gap:8,marginBottom:8,flexWrap:"wrap"}}>
<span style={{fontSize:"0.55rem",fontFamily:C.mono,fontWeight:700,color:colorNivel(a.nivel),border:`1px solid ${colorNivel(a.nivel)}50`,borderRadius:3,padding:"2px 6px"}}>{etiquetaNivel(a.nivel)}</span>
<span style={{fontSize:"0.69rem",fontFamily:C.mono,fontWeight:700,color:colorNivel(a.nivel),border:`1px solid ${colorNivel(a.nivel)}50`,borderRadius:3,padding:"2px 6px"}}>{etiquetaNivel(a.nivel)}</span>
<span style={{fontSize:"0.72rem",color:C.t1,fontWeight:600}}>{a.titulo}</span>
</div>
<div style={{fontSize:"0.65rem",color:C.t2,lineHeight:1.7,marginBottom:6}}>{a.hecho}</div>
<div style={{fontSize:"0.65rem",color:C.t1,lineHeight:1.7}}>{a.consecuencia}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7,marginBottom:6}}>{a.hecho}</div>
<div style={{fontSize:"0.82rem",color:C.t1,lineHeight:1.7}}>{a.consecuencia}</div>
{a.quePuedesHacer&&(
<div style={{marginTop:8,paddingTop:8,borderTop:`1px solid ${C.border}`,fontSize:"0.64rem",color:C.green,lineHeight:1.7}}>
<div style={{marginTop:8,paddingTop:8,borderTop:`1px solid ${C.border}`,fontSize:"0.82rem",color:C.green,lineHeight:1.7}}>
<strong>Qué lo cambia:</strong> {a.quePuedesHacer}
</div>
)}
@@ -107,7 +107,7 @@
{auditada && <ComprobarFirmada key={auditada.huella} auditada={auditada}/>}
<div style={{fontSize:"0.58rem",color:C.t3,fontFamily:C.mono,lineHeight:1.6}}>
<div style={{fontSize:"0.82rem",color:C.t3,fontFamily:C.mono,lineHeight:1.6}}>
{R.size} bytes analizados (PSBT …{R.huella}) · sin consultar el nodo · esta herramienta no firma ni modifica nada
</div>
</div>
@@ -158,22 +158,22 @@
const n = auditada.vin.length;
return (
<div style={{padding:"12px 14px",background:C.bg,borderRadius:6,border:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,fontWeight:700,letterSpacing:"0.12em",marginBottom:6}}>DESPUÉS DE FIRMAR: ¿LO FIRMADO ES LO AUDITADO?</div>
<div style={{fontSize:"0.64rem",color:C.t2,lineHeight:1.6,marginBottom:8}}>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,fontWeight:700,letterSpacing:"0.12em",marginBottom:6}}>DESPUÉS DE FIRMAR: ¿LO FIRMADO ES LO AUDITADO?</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6,marginBottom:8}}>
Cuando el monedero de firma (SeedSigner, Coldcard, Jade…) te enseñe la PSBT firmada, léela aquí antes de llevarla a Sparrow. Txoko comprueba que gasta las mismas monedas y envía lo mismo a los mismos sitios que la que acabas de revisar.
</div>
<div style={{display:"flex",gap:8,alignItems:"stretch",flexWrap:"wrap"}}>
<input value={texto} onChange={e=>desdeTexto(filtrarSecreto(e.target.value))} placeholder="Pega la PSBT firmada o la transacción final"
style={{flex:"1 1 200px",minWidth:0,background:C.bgCard,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"8px 10px",color:C.t1,fontFamily:C.mono,fontSize:"0.7rem",outline:"none"}}/>
<BotonQR campo="firmada" color={C.blue} onLeido={v=>desdeTexto(v)}/>
<label style={{padding:"8px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.66rem",cursor:"pointer",display:"flex",alignItems:"center"}}>
<label style={{padding:"8px 12px",background:"none",border:`1px solid ${C.border}`,borderRadius:6,color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer",display:"flex",alignItems:"center"}}>
archivo
<input type="file" accept=".psbt,.txn,.txt,application/octet-stream" style={{display:"none"}} onChange={e=>{ archivo(e.target.files[0]); e.target.value=""; }}/>
</label>
</div>
{err&&<div style={{marginTop:8,fontSize:"0.66rem",color:C.red,fontFamily:C.mono,lineHeight:1.6}}>{err}</div>}
{err&&<div style={{marginTop:8,fontSize:"0.82rem",color:C.red,fontFamily:C.mono,lineHeight:1.6}}>{err}</div>}
{res&&(res.igual ? (
<div style={{marginTop:10,padding:"10px 12px",background:C.greenMuted,border:`1px solid ${C.green}40`,borderRadius:6,fontSize:"0.68rem",color:C.t1,lineHeight:1.7}}>
<div style={{marginTop:10,padding:"10px 12px",background:C.greenMuted,border:`1px solid ${C.green}40`,borderRadius:6,fontSize:"0.82rem",color:C.t1,lineHeight:1.7}}>
<div style={{color:C.green,fontFamily:C.mono,fontWeight:700,marginBottom:4}}>✓ Es la misma transacción que has auditado</div>
Mismas monedas, mismos destinos, mismos importes, mismo locktime.{" "}
{res.completa
@@ -181,11 +181,11 @@
: res.todasFirmadas
? <>Las {n===1?"entrada lleva":`${n} entradas llevan`} firma{res.firmas.some(f=>f.n>1)?"s":""}; falta que el monedero la termine (Sparrow lo hace al cargarla).</>
: <span style={{color:C.amber}} title="Entradas y salidas se cuentan desde 0, como en Bitcoin Core, Sparrow o Mempool">Todavía {res.sinFirmar.length===1?`falta la firma de la entrada ${res.sinFirmar[0]}`:`faltan las firmas de las entradas ${res.sinFirmar.join(", ")}`}.</span>}
{res.txid&&<div style={{marginTop:6,fontFamily:C.mono,fontSize:"0.6rem",color:C.t2,wordBreak:"break-all"}}>txid {res.txid}</div>}
<div style={{marginTop:6,fontSize:"0.6rem",color:C.t2}}>Txoko comprueba que las firmas están, no que sean matemáticamente válidas: eso lo hace tu nodo al difundirla, y la rechaza si no lo son.</div>
{res.txid&&<div style={{marginTop:6,fontFamily:C.mono,fontSize:"0.69rem",color:C.t2,wordBreak:"break-all"}}>txid {res.txid}</div>}
<div style={{marginTop:6,fontSize:"0.69rem",color:C.t2}}>Txoko comprueba que las firmas están, no que sean matemáticamente válidas: eso lo hace tu nodo al difundirla, y la rechaza si no lo son.</div>
</div>
) : (
<div style={{marginTop:10,padding:"10px 12px",background:C.redMuted,border:`1px solid ${C.red}60`,borderRadius:6,fontSize:"0.68rem",color:C.t1,lineHeight:1.7}}>
<div style={{marginTop:10,padding:"10px 12px",background:C.redMuted,border:`1px solid ${C.red}60`,borderRadius:6,fontSize:"0.82rem",color:C.t1,lineHeight:1.7}}>
<div style={{color:C.red,fontFamily:C.mono,fontWeight:700,marginBottom:4}}>✗ {res.soloOrden ? "Es otra transacción: mismas monedas y destinos, en otro orden" : "NO es la transacción que has auditado"}</div>
<ul style={{margin:"4px 0 6px 18px",padding:0}} title="Entradas y salidas se cuentan desde 0, como en Bitcoin Core, Sparrow o Mempool">{res.diferencias.slice(0,8).map((d,i)=><li key={i}>{d}</li>)}{res.diferencias.length>8&&<li>…y {res.diferencias.length-8} diferencias más.</li>}</ul>
{res.soloOrden
@@ -230,8 +230,8 @@
return (
<Card>
<div style={{fontSize:"0.62rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Transacción en crudo (hex)</div>
<div style={{fontSize:"0.65rem",color:C.t2,marginBottom:12}}>Una transacción «en crudo» es su texto hexadecimal completo. Esto la descodifica: entradas, salidas con sus importes, RBF, locktime y txid. No comprueba firmas, y sin consultar el nodo no sabe cuánto vale cada moneda que gasta. Todo ocurre en el navegador.</div>
<div style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Transacción en crudo (hex)</div>
<div style={{fontSize:"0.69rem",color:C.t2,marginBottom:12}}>Una transacción «en crudo» es su texto hexadecimal completo. Esto la descodifica: entradas, salidas con sus importes, RBF, locktime y txid. No comprueba firmas, y sin consultar el nodo no sabe cuánto vale cada moneda que gasta. Todo ocurre en el navegador.</div>
<textarea value={input} onChange={e=>{ setInput(filtrarSecreto(e.target.value)); setResult(null); setErr(null); }}
placeholder="0100000001..."
rows={4}
@@ -255,14 +255,14 @@
<Tag label="Entradas" value={result.vin.length} color={C.t2}/>
<Tag label="Salidas" value={result.outs.length} color={C.t2}/>
</div>
<div style={{marginTop:10,fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,lineHeight:1.7,wordBreak:"break-all"}}>
<div style={{marginTop:10,fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:1.7,wordBreak:"break-all"}}>
txid {result.txid}<br/>
{result.segwit?"SegWit":"Sin datos SegWit"} · {result.vin.some(i=>i.sequence<0xfffffffe)?"señaliza RBF (BIP125)":"no señaliza RBF (BIP125)"} · locktime {result.locktime===0?"0 (sin efecto)":result.locktime<500000000?`${result.locktime} (altura de bloque)`:`${result.locktime} (marca de tiempo)`}
</div>
<div style={{marginTop:8,display:"flex",flexDirection:"column",gap:3}}>
<div style={{fontSize:"0.58rem",fontFamily:C.mono,color:C.t2}}>Salidas<NotaDesdeCero/></div>
<div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2}}>Salidas<NotaDesdeCero/></div>
{result.outs.map((o,i)=>(
<div key={i} style={{fontSize:"0.62rem",fontFamily:C.mono,color:C.t1}}>
<div key={i} style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t1}}>
<span style={{color:C.t2}}>salida {i}:</span> {fmtBtc(o.value)} · {PSBT_TIPOS[psbtScriptType(o.script)]}
</div>))}
</div>
@@ -311,8 +311,8 @@
return (
<Card>
<div style={{fontSize:"0.62rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Comprobar formato de firma</div>
<div style={{fontSize:"0.65rem",color:C.t2,marginBottom:12}}>Comprueba solo que la firma de un mensaje tiene la forma esperada: la clásica (unos 88 caracteres en base64) o la BIP-322 de las direcciones bc1, que es más larga. <strong style={{color:C.t1}}>No comprueba que la firma sea válida ni que la dirección sea de quien firma</strong>: eso exige verificarla criptográficamente, por ejemplo con <span style={{fontFamily:C.mono}}>verifymessage</span> de Bitcoin Core o con Sparrow.</div>
<div style={{fontSize:"0.69rem",color:C.blue,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:8}}>Comprobar formato de firma</div>
<div style={{fontSize:"0.69rem",color:C.t2,marginBottom:12}}>Comprueba solo que la firma de un mensaje tiene la forma esperada: la clásica (unos 88 caracteres en base64) o la BIP-322 de las direcciones bc1, que es más larga. <strong style={{color:C.t1}}>No comprueba que la firma sea válida ni que la dirección sea de quien firma</strong>: eso exige verificarla criptográficamente, por ejemplo con <span style={{fontFamily:C.mono}}>verifymessage</span> de Bitcoin Core o con Sparrow.</div>
<div style={{display:"flex",flexDirection:"column",gap:8,marginBottom:10}}>
{[
{label:"Dirección", value:addr, onChange:e=>setAddr(filtrarSecreto(e.target.value)), placeholder:"bc1q..."},
@@ -320,7 +320,7 @@
{label:"Firma", value:sig, onChange:e=>setSig(filtrarSecreto(e.target.value)), placeholder:"Base64 de la firma..."},
].map(f=>(
<div key={f.label}>
<div style={{fontSize:"0.6rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:4}}>{f.label}</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,textTransform:"uppercase",marginBottom:4}}>{f.label}</div>
<input value={f.value} onChange={f.onChange} placeholder={f.placeholder}
style={{width:"100%",background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none",boxSizing:"border-box"}}
onFocus={e=>e.target.style.borderColor=C.blue} onBlur={e=>e.target.style.borderColor=C.borderBright}
@@ -334,7 +334,7 @@
<div style={{fontSize:"0.7rem",color:result.valid===false?C.red:C.amber,fontFamily:C.mono,marginBottom:6,fontWeight:700}}>
{result.valid===false?"✗ Forma incorrecta":"Forma correcta (no verificada)"}
</div>
<div style={{fontSize:"0.68rem",color:C.t2,lineHeight:1.6}}>{result.note}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.6}}>{result.note}</div>
</div>
)}
</Card>
+10 -10
View File
@@ -25,13 +25,13 @@
);
};
const P = ({children}) => <p style={{fontSize:"0.78rem",color:C.t2,lineHeight:1.8,marginBottom:12}}>{children}</p>;
const P = ({children}) => <p style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.8,marginBottom:12}}>{children}</p>;
const H = ({children, color}) => <div style={{fontSize:"0.7rem",color:color||C.green,fontFamily:C.mono,textTransform:"uppercase",letterSpacing:"0.15em",fontWeight:700,marginBottom:8,marginTop:16}}>{children}</div>;
const Li = ({children}) => <div style={{display:"flex",gap:8,marginBottom:6}}><span style={{color:C.amber,flexShrink:0}}>·</span><span style={{fontSize:"0.78rem",color:C.t2,lineHeight:1.7}}>{children}</span></div>;
const Li = ({children}) => <div style={{display:"flex",gap:8,marginBottom:6}}><span style={{color:C.amber,flexShrink:0}}>·</span><span style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7}}>{children}</span></div>;
const Code = ({children}) => <code style={{background:C.bg,border:`1px solid ${C.border}`,borderRadius:4,padding:"2px 6px",fontFamily:C.mono,fontSize:"0.75rem",color:C.blue,wordBreak:"break-all"}}>{children}</code>;
const Callout = ({children, color}) => <div style={{padding:"10px 14px",background:`${color||C.amber}10`,border:`1px solid ${color||C.amber}30`,borderRadius:6,fontSize:"0.75rem",color:color||C.amber,lineHeight:1.7,marginTop:10,marginBottom:10}}>{children}</div>;
const Callout = ({children, color}) => <div style={{padding:"10px 14px",background:`${color||C.amber}10`,border:`1px solid ${color||C.amber}30`,borderRadius:6,fontSize:"0.82rem",color:color||C.amber,lineHeight:1.7,marginTop:10,marginBottom:10}}>{children}</div>;
const B = ({children}) => <strong style={{color:C.t1}}>{children}</strong>;
const Paso = ({n, children}) => <div style={{display:"flex",gap:10,marginBottom:10}}><span style={{fontFamily:C.mono,color:C.green,fontWeight:700,flexShrink:0}}>{n}.</span><span style={{fontSize:"0.78rem",color:C.t2,lineHeight:1.7}}>{children}</span></div>;
const Paso = ({n, children}) => <div style={{display:"flex",gap:10,marginBottom:10}}><span style={{fontFamily:C.mono,color:C.green,fontWeight:700,flexShrink:0}}>{n}.</span><span style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7}}>{children}</span></div>;
const Cert = ({level}) => {
const map = {
CERTEZA:{c:C.t1,d:"Se ve en la cadena, o se sigue de ella sin otra explicación (por ejemplo, que dos direcciones se gastaron juntas en la misma transacción)."},
@@ -40,15 +40,15 @@
"SIN DATOS":{c:C.t2,d:"Faltan datos para decir nada (por ejemplo, el nodo no dio la transacción de una entrada)."},
};
const m = map[level];
return <div style={{display:"flex",gap:10,marginBottom:10,alignItems:"flex-start"}}><span style={{background:`${m.c}18`,border:`1px solid ${m.c}35`,borderRadius:3,padding:"2px 7px",fontFamily:C.mono,fontSize:"0.62rem",fontWeight:700,color:m.c,flexShrink:0,marginTop:2}}>{level}</span><span style={{fontSize:"0.75rem",color:C.t2,lineHeight:1.7}}>{m.d}</span></div>;
return <div style={{display:"flex",gap:10,marginBottom:10,alignItems:"flex-start"}}><span style={{background:`${m.c}18`,border:`1px solid ${m.c}35`,borderRadius:3,padding:"2px 7px",fontFamily:C.mono,fontSize:"0.69rem",fontWeight:700,color:m.c,flexShrink:0,marginTop:2}}>{level}</span><span style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7}}>{m.d}</span></div>;
};
// Una fila de la guía de comprobaciones: nombre tal como sale en pantalla,
// certeza y efecto en la nota.
const Chk = ({nombre, cert, efecto, children}) => (
<div style={{paddingBottom:10,marginBottom:10,borderBottom:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.76rem",color:C.t1,fontWeight:600,marginBottom:3}}>{nombre}</div>
<div style={{fontSize:"0.62rem",fontFamily:C.mono,color:C.t2,marginBottom:4}}>{cert} · {efecto}</div>
<div style={{fontSize:"0.75rem",color:C.t2,lineHeight:1.7}}>{children}</div>
<div style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.t2,marginBottom:4}}>{cert} · {efecto}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7}}>{children}</div>
</div>
);
@@ -255,7 +255,7 @@
].map(([term, def]) => (
<div key={term} style={{paddingBottom:10,marginBottom:10,borderBottom:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.75rem",color:C.amber,fontFamily:C.mono,fontWeight:700,marginBottom:4}}>{term}</div>
<div style={{fontSize:"0.75rem",color:C.t2,lineHeight:1.7}}>{def}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7}}>{def}</div>
</div>
))}
</Section>
@@ -275,7 +275,7 @@
].map(([q, a]) => (
<div key={q} style={{paddingBottom:14,marginBottom:14,borderBottom:`1px solid ${C.border}`}}>
<div style={{fontSize:"0.75rem",color:C.t1,fontWeight:600,marginBottom:6}}>— {q}</div>
<div style={{fontSize:"0.75rem",color:C.t2,lineHeight:1.7}}>{a}</div>
<div style={{fontSize:"0.82rem",color:C.t2,lineHeight:1.7}}>{a}</div>
</div>
))}
</Section>
@@ -291,7 +291,7 @@
</Section>
<div style={{padding:"16px 0",textAlign:"center"}}>
<div style={{fontSize:"0.68rem",color:C.t2,fontFamily:C.mono,lineHeight:2}}>
<div style={{fontSize:"0.82rem",color:C.t2,fontFamily:C.mono,lineHeight:2}}>
Txoko Node Dashboard · Bitcoin Txoko<br/>
Software libre bajo licencia MIT<br/>
<span style={{color:C.amber}}>₿ txoko · tu nodo, tus reglas</span>
+4 -4
View File
@@ -58,11 +58,11 @@
<span style={{fontSize:"1.3rem",color:C.amber,fontWeight:700,lineHeight:1}}>₿</span>
<div>
<div style={{fontFamily:C.mono,fontSize:"0.82rem",color:C.green,fontWeight:700,letterSpacing:"0.06em"}}>{act.name||"MI NODO"}</div>
<div style={{fontSize:"0.58rem",color:C.t2,fontFamily:C.mono}}>{act.url?act.url.replace(/^https?:\/\//,""):"SIN NODO · DEMOSTRACIÓN"} · {act.red==="signet"?"SIGNET · SIN VALOR":"MAINNET"}</div>
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono}}>{act.url?act.url.replace(/^https?:\/\//,""):"SIN NODO · DEMOSTRACIÓN"} · {act.red==="signet"?"SIGNET · SIN VALOR":"MAINNET"}</div>
</div>
</div>
<div style={{display:"flex",alignItems:"center",gap:6}}>
<button onClick={()=>setShowConfig(true)} style={{background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,padding:"6px 12px",color:C.t2,fontFamily:C.mono,fontSize:"0.68rem",cursor:"pointer"}}>⚙ Ajustes</button>
<button onClick={()=>setShowConfig(true)} style={{background:C.bgCard,border:`1px solid ${C.border}`,borderRadius:6,padding:"6px 12px",color:C.t2,fontFamily:C.mono,fontSize:"0.69rem",cursor:"pointer"}}>⚙ Ajustes</button>
</div>
</div>
<div style={{display:"flex",borderBottom:`1px solid ${C.border}`,padding:"0 6px"}}>
@@ -100,8 +100,8 @@
</div>
<footer style={{borderTop:`1px solid ${C.border}`,padding:"10px 18px",display:"flex",alignItems:"center",justifyContent:"center",gap:6}}>
<span style={{fontSize:"0.95rem",color:C.amber}}>₿</span>
<span style={{fontFamily:C.mono,fontSize:"0.62rem",color:C.amber,letterSpacing:"0.12em"}}>txoko</span>
<span style={{fontFamily:C.mono,fontSize:"0.62rem",color:C.t2,letterSpacing:"0.05em"}}>· tu nodo, tus reglas · v{VERSION_APP}</span>
<span style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.amber,letterSpacing:"0.12em"}}>txoko</span>
<span style={{fontFamily:C.mono,fontSize:"0.69rem",color:C.t2,letterSpacing:"0.05em"}}>· tu nodo, tus reglas · v{VERSION_APP}</span>
</footer>
{showConfig&&<ConfigModal config={config} themeId={themeId} onTheme={switchTheme} onSave={cfg=>{setConfig(cfg);setShowConfig(false);}} onClose={()=>setShowConfig(false)}/>}
</div>
+47
View File
@@ -0,0 +1,47 @@
// v2.1.1 — U2 de la auditoría del 10-nov-2026: letra muy pequeña. En un
// iPhone 13, en la pantalla de un análisis, el 61 % del texto iba por debajo
// de 11 px y el 21 % por debajo de 10 px. Suelo nuevo: 11 px (0,69rem) para
// etiquetas y 13 px (0,82rem) para el texto de explicación, que es el que
// lleva interlineado de 1,5 o más en su mismo estilo.
//
// La prueba recorre todos los estilos de src/ para que el suelo no se pierda
// con el próximo texto que se añada.
//
// Uso: node tests/test56.js
const fs = require("fs");
const path = require("path");
const dir = path.join(__dirname, "..", "src");
const MIN_ETIQUETA = 0.69, MIN_EXPLICACION = 0.82;
let pass = 0, fail = 0;
const ok = (n, c, x) => { console.log(` ${c ? "✓" : "✗"} ${n}`); if (!c && x !== undefined) console.log(" " + JSON.stringify(x).slice(0, 600)); c ? pass++ : fail++; };
const tam = [], pequenas = [], explPequenas = [], raras = [];
for (const f of fs.readdirSync(dir).filter(f => /\.jsx?$/.test(f)).sort()) {
const s = fs.readFileSync(path.join(dir, f), "utf8");
for (const m of s.matchAll(/fontSize:\s?"(\d(?:\.\d+)?)rem"/g)) {
const v = parseFloat(m[1]);
// El objeto de estilo que lo contiene (llaves emparejadas).
let a = m.index, d = 0; while (a > 0) { a--; if (s[a] === "}") d++; else if (s[a] === "{") { if (d === 0) break; d--; } }
let b = m.index + m[0].length; d = 0; while (b < s.length) { if (s[b] === "{") d++; else if (s[b] === "}") { if (d === 0) break; d--; } b++; }
const lh = /lineHeight:\s*"?(\d(?:\.\d+)?)/.exec(s.slice(a, b));
const linea = s.slice(0, m.index).split("\n").length;
tam.push(v);
if (v < MIN_ETIQUETA) pequenas.push(`${f}:${linea} ${v}rem`);
if (lh && parseFloat(lh[1]) >= 1.5 && v < MIN_EXPLICACION) explPequenas.push(`${f}:${linea} ${v}rem`);
}
// Tamaños escritos de otra forma (px sueltos, números) se escaparían del suelo.
for (const m of s.matchAll(/fontSize:\s?(?!")([^,}\s]+)/g)) if (!/^(isMobile|walletReport|C\.|[a-zA-Z_.]+\?)/.test(m[1])) raras.push(`${f}: fontSize:${m[1]}`);
for (const m of s.matchAll(/fontSize:\s?"([^"]*)"/g)) if (!/^\d(\.\d+)?rem$/.test(m[1]) && !["inherit", "0.9em"].includes(m[1])) raras.push(`${f}: "${m[1]}"`);
}
console.log("=== U2. Suelo de tamaño de letra ===\n");
ok(`se han mirado los ${tam.length} tamaños de letra de src/`, tam.length > 600, tam.length);
ok("ninguno por debajo de 0,69rem (11 px)", pequenas.length === 0, pequenas.slice(0, 12));
ok("ningún texto de explicación (interlineado ≥ 1,5) por debajo de 0,82rem (13 px)", explPequenas.length === 0, explPequenas.slice(0, 12));
ok("el más pequeño es justo el suelo: 0,69rem = 11,04 px con la letra base de 16 px", Math.min(...tam) === MIN_ETIQUETA && MIN_ETIQUETA * 16 >= 11 && MIN_EXPLICACION * 16 >= 13);
ok("los títulos y cifras grandes no se han tocado (sigue habiendo 1rem, 1,08rem y 1,3rem)", [1, 1.08, 1.3].every(v => tam.includes(v)));
ok("no hay tamaños escritos de otra forma que se escapen del suelo", raras.length === 0, raras);
const css = fs.readFileSync(path.join(__dirname, "..", "plantilla.html"), "utf8");
ok("la página no fija un tamaño base distinto del normal (16 px)", !/html\s*\{[^}]*font-size/.test(css) && !/body\s*\{[^}]*font-size/.test(css));
console.log(`\n${pass} ✓ · ${fail} ✗`);
process.exit(fail ? 1 : 0);