Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
898a8f424a
|
||
|
|
43260d7c02
|
||
|
|
45fc11546d
|
||
|
|
82d1748905
|
||
|
|
4fad712701
|
||
|
|
53c1401ef1
|
||
|
|
c44859b3d7
|
||
|
|
481f20b419
|
||
|
|
525fd21069
|
||
|
|
9a18de0df8
|
@@ -10,6 +10,43 @@ y el versionado sigue [Versionado Semántico](https://semver.org/lang/es/):
|
||||
- **MENOR** — características nuevas que no rompen lo anterior
|
||||
- **PARCHE** — arreglos de errores
|
||||
|
||||
---
|
||||
## [2.1.1] — 2026-11-15
|
||||
|
||||
**Lo que quedaba de la auditoría del 10 de noviembre, y una xpub que no dice de qué tipo es.** Nueve arreglos, casi todos de la misma familia: que la app no afirme nada sobre datos que no tiene, y que se lea mejor.
|
||||
|
||||
### Añadido
|
||||
- **«Buscar el tipo en mi nodo» (xpub suelta).** Una xpub (o tpub) no dice qué tipo de direcciones usa la wallet: la de una wallet Taproot se cargaba como SegWit nativa (bc1q…) y había que acertar el tipo a mano. Ahora hay un botón que calcula las 15 primeras direcciones (10 de recepción y 5 de cambio) de los cuatro tipos y pregunta a tu nodo en cuáles hay movimientos: 60 consultas, que se anuncian antes de hacerlas. Es una **propuesta** («Actividad encontrada en Taproot (bc1p…). ¿Es esa tu wallet?») con su botón «Cargar como…»; no cambia nada sola, y sigue haciendo falta confirmar la recepción 0. Con actividad en varios tipos no propone ninguno. Lo que no se pudo preguntar no se da por vacío. Cargar la wallet sigue sin preguntar nada al nodo: la búsqueda la pides tú.
|
||||
- **Cómo empiezan tus direcciones, a la vista.** Al comparar la recepción 0, el principio (bc1q, bc1p, 3, 1) va destacado y se dice el tipo en palabras: es lo primero que delata un tipo equivocado.
|
||||
- **El descriptor, recomendado.** En «Cargar mi wallet» el descriptor pasa delante de la xpub: dice él mismo el tipo.
|
||||
|
||||
### Cambiado
|
||||
- **Sin actividad no hay nota.** El informe de una wallet sin movimientos ya no daba «ALTA», pero enseñaba «Reutilizadas 0» y «Grupos vinculados 0», que se leen como un resultado: ahora son «—». El texto depende de cuánto se sabe del tipo: con una xpub de tipo supuesto, «lo más probable es que el tipo de dirección no sea el correcto», y ofrece la búsqueda; con descriptor o zpub/ypub, «Sin actividad todavía: no hay nada que medir». Si además fallaron consultas al nodo, ni siquiera «sin actividad»: «No se sabe si hay actividad».
|
||||
- **Pago por lotes: un solo criterio (F1).** Analizada directamente, una transacción solo era lote si casi todos sus importes eran distintos; vista como origen de otra, bastaba con 20 salidas. La misma transacción real (1 → 133 salidas a 133 direcciones, con importes repetidos) era «No es un pago por lotes», con «exposición ninguna», y a un salto «viene de un pago por lotes». Ahora es lote, se mire desde donde se mire, si tiene 5 salidas o más con casi todos los importes distintos, o si paga a 20 direcciones distintas o más, y no es una mezcla. La nota de quien cobra no cambia (lo decidió quien pagó); lo que cambia es que ahora ve la exposición. De paso, una mezcla de importes variados con 20 salidas ya no se anuncia a un salto como «pago por lotes».
|
||||
- **Un salto atrás no afirma nada de lo que no se pudo mirar (F2).** «Mirado un salto: de dónde vienen 0 de N entradas» seguía con «No añaden nada especial: ni mezclas, ni pelado, ni lotes, ni minado» y la etiqueta CERTEZA. Ahora dice «no se pudo mirar ninguna entrada», sin certeza (SIN DATOS) y sin afirmar nada.
|
||||
- **Con el nodo caído, rayas en vez de ejemplos (U5).** Con un nodo configurado que no respondía, bajo el aviso rojo seguían las cifras de ejemplo a todo color («Sincronizado: Sí ✓»). Los ejemplos quedan para el modo demostración (sin nodo). Con nodo, lo que no llega es una raya (—) o la marca SIN DATOS, también en la pestaña de la red; la comprobación de seguridad del nodo ya no opina a partir de datos de ejemplo, y el explorador no calcula confirmaciones con una altura de ejemplo.
|
||||
- **Letra (U1, U2, U3).** La letra de los datos es IBM Plex Mono, que ya viajaba con la app pero no se usaba nunca (en un iPhone salía Courier). Suelo de tamaño: 11 px para etiquetas y 13 px para explicaciones (antes, en un móvil, el 61 % del texto de un análisis iba por debajo de 11 px; ahora, el 0 %). El gris tenue llega a 4,5:1 de contraste en los cuatro temas (antes, de 2,1 a 3,1:1).
|
||||
- **Móvil (U6).** La fila del txid encoge y salta de línea: antes el botón ANALIZAR se salía de su tarjeta y, en un móvil de 320 px, se ensanchaba la página entera. Lo mismo en las demás filas de campo y botón. El simulador de gasto se queda en una línea mientras no haya wallet cargada.
|
||||
|
||||
### Arreglado
|
||||
- **El servicio de métricas no se cae con una cabecera `Host` mal formada (S1).** Solo se alcanzaba desde la propia máquina y systemd lo levantaba a los 5 s, pero bastaba una petición rara para tumbarlo.
|
||||
|
||||
### Para actualizar
|
||||
- `dist/dashboard.html` y el `app-….js` nuevo, como siempre.
|
||||
- **Esta vez también `system-metrics.js`** (por S1): cópialo al nodo y reinicia el servicio (`sudo systemctl restart txoko-metrics`). Si usas tu copia con credenciales (`system-metrics.local.js`), el cambio es una sola línea: la base de `new URL(...)` pasa a ser `"http://localhost"`.
|
||||
- Ni `vendor/` ni nginx cambian.
|
||||
|
||||
### Lo que queda
|
||||
- Teclado y lector de pantalla (U4 de la auditoría): merece su propia versión.
|
||||
- En los temas Piedra y Archivo quedan dos colores de acento algo por debajo de 4,5:1 (el rótulo de la pestaña activa y el ámbar): no son el gris, y cambiarlos es cambiar el tema.
|
||||
|
||||
### Pruebas
|
||||
- Nueve ficheros nuevos, uno por arreglo: `tests/test50.js` a `tests/test58.js` (189 casos). `tests/test36.js`, al día con el cambio de U5.
|
||||
- Cada arreglo se estropeó a mano para ver fallar su prueba: 34 cambios, 34 cazados (7 en F1, 22 en X1 y 5 en U5).
|
||||
- X1 se probó con los vectores oficiales de los BIP 44, 84 y 86 (semilla pública «abandon … about») y un nodo de mentira. Los tres vectores de BIP 86 de `tests/test49.js` se compararon además con el texto del BIP: coinciden.
|
||||
- En un navegador real (Chromium), con la CSP de producción y un nodo simulado: los casos de X1 (actividad en Taproot, tipo equivocado y analizado, ningún tipo, nodo que falla, descriptor con y sin actividad); nodo caído, nodo sin métricas y modo demostración; y un recorrido de ocho pantallas a 320, 390 y 1280 px en los cuatro temas, sin desplazamiento lateral y sin errores de consola.
|
||||
- No probado: contra el nodo real, ni con una wallet real (te toca a ti, en el signet).
|
||||
|
||||
---
|
||||
## [2.1.0] — 2026-11-10
|
||||
|
||||
|
||||
@@ -44,6 +44,12 @@ puede saber, quiero saberlo — es el fallo que más me importa de todos.
|
||||
un carácter cambiado. Debería decirte que algo no cuadra, no inventarse una
|
||||
respuesta.
|
||||
|
||||
**Carga una xpub «a secas»** (de una wallet de prueba, mejor en signet). Una
|
||||
xpub no dice si la wallet es Taproot, SegWit o antigua. Mira qué tipo supone la
|
||||
app, pulsa «Buscar el tipo en mi nodo» y comprueba que propone el bueno y que
|
||||
te deja a ti la última palabra. Y analiza una wallet sin estrenar: no debería
|
||||
ponerle nota, porque no hay nada que medir.
|
||||
|
||||
**Prueba el peritaje** (rastro de fondos robados) con cualquier transacción
|
||||
pública conocida y mira si lo que concluye se sostiene.
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ Las librerías (React, Babel, las fuentes) viven aparte, en `vendor/`, servidas
|
||||
## Limitaciones conocidas
|
||||
|
||||
- **Watch-only requiere HTTPS** — la derivación de direcciones desde el xpub usa la Web Crypto API del navegador, que solo está disponible en contextos seguros (HTTPS). Si sirves el dashboard por HTTP, esta función no estará disponible (el resto sí). Ver SETUP.md para configurar un certificado autofirmado. Las etiquetas BIP-329 funcionan por HTTP sin problema
|
||||
- **Watch-only: SegWit nativa, Taproot, anidada y legacy** — se derivan direcciones bc1q (zpub), bc1p (Taproot de una sola clave, BIP86: xpub eligiendo el tipo, o descriptor tr(…)), 3… (ypub) y 1… (xpub). Multifirma y Taproot con scripts aún no
|
||||
- **Watch-only: SegWit nativa, Taproot, anidada y legacy** — se derivan direcciones bc1q (zpub), bc1p (Taproot de una sola clave, BIP86: descriptor tr(…), o xpub eligiendo el tipo o buscándolo en el nodo por su actividad), 3… (ypub) y 1… (xpub). Multifirma y Taproot con scripts aún no
|
||||
- **Análisis de transacción aislada** — sin seguir el grafo completo, algunas heurísticas tienen techo. El rastro de procedencia amplía el contexto pero es bajo demanda y no exhaustivo
|
||||
- **Base de datos de entidades parcial** — ~1.450 direcciones (lista OFAC completa a 01/10/2026, exchanges, minería y otros servicios). Es una copia fija que no se actualiza sola; no es completa
|
||||
- **Fingerprinting conservador** — requiere varias señales coincidentes; prefiere no detectar antes que detectar mal
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
// Versión de la app: la usan el pie de página y la cabecera del informe
|
||||
// de seguimiento. Una sola constante para que no se desalineen.
|
||||
const VERSION_APP = "2.1.0";
|
||||
const VERSION_APP = "2.1.1";
|
||||
|
||||
// Detecta pantalla estrecha (móvil) y se reajusta al rotar/redimensionar.
|
||||
// Reutilizable para adaptar cualquier vista a móvil sin media queries CSS.
|
||||
|
||||
+12
-7
@@ -5,7 +5,12 @@
|
||||
// Las fuentes nuevas (Lora, Source Serif 4, Courier Prime) se sirven desde
|
||||
// el propio nodo como las IBM Plex — ver instalar-fuentes.sh. Si aún no
|
||||
// están instaladas, cada pila cae en una letra parecida del sistema.
|
||||
const LETRA_TERMINAL = { sans:"'IBM Plex Sans','Helvetica Neue',sans-serif", mono:"monospace", serif:null, italica:false };
|
||||
// v2.1.1 (U1): la letra de datos es IBM Plex Mono, que ya viaja con la app
|
||||
// (vendor/fonts). Hasta la v2.1.0 los temas decían solo «monospace»: el
|
||||
// navegador no llegaba a cargarla nunca y en un iPhone los datos salían
|
||||
// en Courier. Si no está instalada, cae en la del sistema, como antes.
|
||||
const LETRA_MONO = "'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace";
|
||||
const LETRA_TERMINAL = { sans:"'IBM Plex Sans','Helvetica Neue',sans-serif", mono:LETRA_MONO, serif:null, italica:false };
|
||||
const THEMES = {
|
||||
cypherpunk: {
|
||||
bg:"#05080d", bgCard:"#090e16", bgHover:"#0d1520",
|
||||
@@ -15,20 +20,20 @@
|
||||
purple:"#b06ef3", purpleMuted:"rgba(176,110,243,0.08)",
|
||||
blue:"#41c8f5", blueMuted:"rgba(65,200,245,0.08)",
|
||||
red:"#f56565", redMuted:"rgba(245,101,101,0.08)",
|
||||
t1:"#dde6f0", t2:"#6b88a8", t3:"#3a4d63",
|
||||
t1:"#dde6f0", t2:"#6b88a8", t3:"#6581a0",
|
||||
headerBg:"rgba(5,8,13,0.93)",
|
||||
...LETRA_TERMINAL,
|
||||
},
|
||||
amber: {
|
||||
bg:"#0b0802", bgCard:"#110c04", bgHover:"#181107", border:"#2b1f0b", borderBright:"#3f2e12", green:"#ffb000", greenMuted:"rgba(255,176,0,0.09)", amber:"#ff8f1f", amberMuted:"rgba(255,143,31,0.09)", purple:"#ffc857", purpleMuted:"rgba(255,200,87,0.09)", blue:"#e0a64a", blueMuted:"rgba(224,166,74,0.09)", red:"#ff5533", redMuted:"rgba(255,85,51,0.09)", t1:"#ffd48a", t2:"#b8893f", t3:"#6e5226", headerBg:"rgba(11,8,2,0.95)",
|
||||
sans:"monospace", mono:"monospace", serif:null, italica:false, // fósforo: todo en terminal
|
||||
bg:"#0b0802", bgCard:"#110c04", bgHover:"#181107", border:"#2b1f0b", borderBright:"#3f2e12", green:"#ffb000", greenMuted:"rgba(255,176,0,0.09)", amber:"#ff8f1f", amberMuted:"rgba(255,143,31,0.09)", purple:"#ffc857", purpleMuted:"rgba(255,200,87,0.09)", blue:"#e0a64a", blueMuted:"rgba(224,166,74,0.09)", red:"#ff5533", redMuted:"rgba(255,85,51,0.09)", t1:"#ffd48a", t2:"#b8893f", t3:"#9e7636", headerBg:"rgba(11,8,2,0.95)",
|
||||
sans:LETRA_MONO, mono:LETRA_MONO, serif:null, italica:false, // fósforo: todo en terminal
|
||||
},
|
||||
piedra: {
|
||||
bg:"#14110f", bgCard:"#1b1714", bgHover:"#231e1a", border:"#2c2520", borderBright:"#3d342d", green:"#93b083", greenMuted:"rgba(147,176,131,0.09)", amber:"#d6a145", amberMuted:"rgba(214,161,69,0.09)", purple:"#cf6a57", purpleMuted:"rgba(207,106,87,0.09)", blue:"#c8b79a", blueMuted:"rgba(200,183,154,0.09)", red:"#e0533f", redMuted:"rgba(224,83,63,0.09)", t1:"#eee6da", t2:"#a59886", t3:"#6c6157", headerBg:"rgba(20,17,15,0.95)",
|
||||
sans:"'IBM Plex Sans','Helvetica Neue',sans-serif", mono:"monospace", serif:"'Lora',Charter,Georgia,serif", italica:false
|
||||
bg:"#14110f", bgCard:"#1b1714", bgHover:"#231e1a", border:"#2c2520", borderBright:"#3d342d", green:"#93b083", greenMuted:"rgba(147,176,131,0.09)", amber:"#d6a145", amberMuted:"rgba(214,161,69,0.09)", purple:"#cf6a57", purpleMuted:"rgba(207,106,87,0.09)", blue:"#c8b79a", blueMuted:"rgba(200,183,154,0.09)", red:"#e0533f", redMuted:"rgba(224,83,63,0.09)", t1:"#eee6da", t2:"#a59886", t3:"#908475", headerBg:"rgba(20,17,15,0.95)",
|
||||
sans:"'IBM Plex Sans','Helvetica Neue',sans-serif", mono:LETRA_MONO, serif:"'Lora',Charter,Georgia,serif", italica:false
|
||||
},
|
||||
archivo: {
|
||||
bg:"#f2ede3", bgCard:"#f9f6ef", bgHover:"#ebe5d8", border:"#dcd3c1", borderBright:"#c7bca6", green:"#2e5a43", greenMuted:"rgba(46,90,67,0.09)", amber:"#946510", amberMuted:"rgba(148,101,16,0.09)", purple:"#1e2a46", purpleMuted:"rgba(30,42,70,0.09)", blue:"#3a5878", blueMuted:"rgba(58,88,120,0.09)", red:"#a5221b", redMuted:"rgba(165,34,27,0.09)", t1:"#1c1a17", t2:"#5b544a", t3:"#9b9282", headerBg:"rgba(242,237,227,0.96)",
|
||||
bg:"#f2ede3", bgCard:"#f9f6ef", bgHover:"#ebe5d8", border:"#dcd3c1", borderBright:"#c7bca6", green:"#2e5a43", greenMuted:"rgba(46,90,67,0.09)", amber:"#946510", amberMuted:"rgba(148,101,16,0.09)", purple:"#1e2a46", purpleMuted:"rgba(30,42,70,0.09)", blue:"#3a5878", blueMuted:"rgba(58,88,120,0.09)", red:"#a5221b", redMuted:"rgba(165,34,27,0.09)", t1:"#1c1a17", t2:"#5b544a", t3:"#6e665a", headerBg:"rgba(242,237,227,0.96)",
|
||||
sans:"'Source Serif 4',Charter,'Bitstream Charter',Georgia,serif", mono:"'Courier Prime','Courier 10 Pitch','Courier New',monospace", serif:"'Source Serif 4',Charter,'Bitstream Charter',Georgia,serif", italica:true
|
||||
},
|
||||
};
|
||||
|
||||
@@ -223,3 +223,99 @@
|
||||
health: { band: healthBand, color: healthColor, msg: healthMsg } };
|
||||
}
|
||||
|
||||
|
||||
// ── Tipo de una xpub por su actividad (v2.1.1, X1) ──────────────────
|
||||
// Una xpub (o tpub) suelta no dice qué tipo de direcciones usa la wallet:
|
||||
// puede ser SegWit nativa, Taproot, SegWit anidada o antigua, y la misma
|
||||
// clave da direcciones distintas en cada uno. Hasta la v2.1.0 se suponía
|
||||
// SegWit nativa y había que acertar a mano con los botones. Aquí se
|
||||
// calculan las primeras direcciones de los cuatro tipos y se pregunta al
|
||||
// nodo en cuáles ha habido movimientos. El resultado es una PROPUESTA:
|
||||
// quien confirma sigue siendo la persona, comparando la recepción 0.
|
||||
//
|
||||
// Lo que no se pudo preguntar no se da por vacío: con consultas fallidas
|
||||
// nunca se dice «ninguno tiene actividad».
|
||||
const TIPOS_XPUB = ["p2wpkh", "p2tr", "p2sh-p2wpkh", "p2pkh"];
|
||||
const DETECCION_RECEPCION = 10, DETECCION_CAMBIO = 5;
|
||||
const DETECCION_CONSULTAS = TIPOS_XPUB.length * (DETECCION_RECEPCION + DETECCION_CAMBIO);
|
||||
// ¿Ha tenido movimientos esta dirección, según lo que responde el nodo?
|
||||
// Cuenta lo confirmado y lo que espera en la mempool; y una dirección con
|
||||
// dinero recibido pero sin número de transacciones (pasa con Mempool
|
||||
// sobre Electrum) no está «sin usar».
|
||||
function direccionConActividad(info) {
|
||||
const c = (info && info.chain_stats) || {}, m = (info && info.mempool_stats) || {};
|
||||
return ((c.tx_count || 0) + (m.tx_count || 0)) > 0 || ((c.funded_txo_count || 0) + (m.funded_txo_count || 0)) > 0 || ((c.funded_txo_sum || 0) + (m.funded_txo_sum || 0)) > 0;
|
||||
}
|
||||
function veredictoTipo(tipos) {
|
||||
const con = tipos.filter(t => t.conActividad > 0);
|
||||
const fallos = tipos.reduce((s, t) => s + t.fallos, 0), miradas = tipos.reduce((s, t) => s + t.miradas, 0);
|
||||
// «ninguno» solo si se pudo preguntar por todas y ninguna tiene nada.
|
||||
const clase = con.length === 1 ? "uno" : con.length > 1 ? "varios" : miradas === 0 ? "sin_datos" : fallos > 0 ? "incompleto" : "ninguno";
|
||||
return { tipos, clase, propuesto: con.length === 1 ? con[0].script : null, conActividad: con.map(t => t.script), fallos, miradas, consultas: miradas + fallos };
|
||||
}
|
||||
// derivar(xpub, n, script, { ramas }) → { receive, change } · consultar(direccion) →
|
||||
// lo que da /api/address/… (o lanza si el nodo no responde) · sigue() →
|
||||
// false si la persona cambió de wallet mientras tanto (se abandona).
|
||||
async function buscarTipoPorActividad(xpub, { derivar, consultar, lote = 5, pausa = 120, alAvanzar, sigue } = {}) {
|
||||
const tipos = [], cola = [];
|
||||
for (const script of TIPOS_XPUB) {
|
||||
// Solo las que se van a preguntar: 10 de recepción y 5 de cambio.
|
||||
const rec = await derivar(xpub, DETECCION_RECEPCION, script, { ramas: [0] });
|
||||
const cam = await derivar(xpub, DETECCION_CAMBIO, script, { ramas: [1] });
|
||||
const dirs = [...rec.receive.slice(0, DETECCION_RECEPCION), ...cam.change.slice(0, DETECCION_CAMBIO)];
|
||||
const t = { script, total: dirs.length, miradas: 0, conActividad: 0, fallos: 0 };
|
||||
tipos.push(t);
|
||||
for (const d of dirs) cola.push({ d, t });
|
||||
}
|
||||
for (let i = 0; i < cola.length; i += lote) {
|
||||
if (sigue && !sigue()) return null;
|
||||
await Promise.all(cola.slice(i, i + lote).map(async ({ d, t }) => {
|
||||
try { const info = await consultar(d); t.miradas++; if (direccionConActividad(info)) t.conActividad++; }
|
||||
catch { t.fallos++; }
|
||||
}));
|
||||
if (alAvanzar) alAvanzar(Math.min(i + lote, cola.length), cola.length);
|
||||
if (pausa && i + lote < cola.length) await new Promise(r => setTimeout(r, pausa));
|
||||
}
|
||||
if (sigue && !sigue()) return null;
|
||||
return veredictoTipo(tipos);
|
||||
}
|
||||
// Lo que se dice de la búsqueda. `actual` es el tipo cargado ahora mismo.
|
||||
// nombres: TIPO_SCRIPT. tono: "ok" | "aviso" | "neutro".
|
||||
function textoDeteccion(res, actual, nombres) {
|
||||
const N = s => nombres[s] || s;
|
||||
const cuantas = t => `${t.conActividad} de las ${t.miradas} primeras direcciones`;
|
||||
const coda = res.fallos > 0 ? ` ${res.fallos === 1 ? "Una consulta a tu nodo no respondió" : `${res.fallos} consultas a tu nodo no respondieron`}: puede haber actividad que no se ha visto.` : "";
|
||||
if (res.clase === "uno") {
|
||||
const t = res.tipos.find(x => x.script === res.propuesto);
|
||||
return res.propuesto === actual
|
||||
? { tono: "ok", titulo: `Actividad encontrada en ${N(actual)}, el tipo que ya está cargado`, texto: `Tu nodo conoce movimientos en ${cuantas(t)} de ese tipo, y en ninguna de los otros tres.${coda} Es una pista, no una prueba: confirma abajo que la recepción 0 es la de tu wallet.` }
|
||||
: { tono: "aviso", titulo: `Actividad encontrada en ${N(res.propuesto)}`, texto: `Tu nodo conoce movimientos en ${cuantas(t)} de ese tipo, y en ninguna de ${N(actual)}, el tipo cargado ahora.${coda} ¿Es esa tu wallet? Cárgala con ese tipo y confirma la recepción 0.` };
|
||||
}
|
||||
if (res.clase === "varios")
|
||||
return { tono: "aviso", titulo: "Hay actividad en más de un tipo de dirección", texto: `${res.tipos.filter(t => t.conActividad > 0).map(t => `${N(t.script)}: ${cuantas(t)}`).join(" · ")}.${coda} La misma clave se ha usado con varios tipos, o alguien pagó a una dirección de otro tipo. La app no puede saber cuál es tu wallet: elige el tipo cuyas direcciones coincidan con las suyas.` };
|
||||
if (res.clase === "ninguno")
|
||||
return { tono: "neutro", titulo: "Sin actividad en ninguno de los cuatro tipos", texto: `Se ha preguntado a tu nodo por las primeras ${res.tipos[0].total} direcciones de cada tipo (${res.consultas} consultas) y ninguna tiene movimientos. O la wallet está sin estrenar, o esta clave no es la de la cuenta que usas, o tu nodo todavía no tiene el índice de direcciones al día. Sin actividad, el tipo solo lo puedes decir tú: mira cómo empiezan las direcciones de tu wallet.` };
|
||||
if (res.clase === "incompleto")
|
||||
return { tono: "aviso", titulo: "No se ha visto actividad, pero la búsqueda quedó incompleta", texto: `${res.fallos} de las ${res.consultas} consultas a tu nodo no respondieron. En las que sí, ninguna dirección tiene movimientos; de las demás no se sabe nada. Vuelve a intentarlo cuando el nodo esté menos ocupado.` };
|
||||
return { tono: "aviso", titulo: "No se pudo preguntar a tu nodo", texto: `Ninguna de las ${res.consultas} consultas respondió, así que no se sabe en qué tipo hay actividad. Comprueba la conexión con el nodo (⚙ Ajustes) y vuelve a intentarlo.` };
|
||||
}
|
||||
// El mensaje del informe cuando ninguna dirección calculada tiene
|
||||
// movimientos. No es una nota: sin actividad no hay nada que medir. Lo
|
||||
// que cambia es cuánto se sabe del tipo de dirección.
|
||||
// origen: "descriptor" | "prefijo" (ypub/zpub) | "elegido" | "supuesto"
|
||||
function mensajeSinActividad({ origen, tipo, clave, direcciones, fallos }) {
|
||||
if (fallos > 0) return { banda: "SIN DATOS", titulo: "No se sabe si hay actividad",
|
||||
msg: `${fallos === 1 ? "Una consulta a tu nodo falló" : `${fallos} consultas a tu nodo fallaron`} y en las demás direcciones no hay movimientos. No se puede decir que la wallet esté sin usar: de las direcciones que no se pudieron leer no se sabe nada. Vuelve a pulsar «⊙ Analizar wallet».` };
|
||||
const mas = `Si has usado muchas direcciones, prueba con 50 o 100.`;
|
||||
if (origen === "descriptor" || origen === "prefijo") return { banda: "SIN ACTIVIDAD", titulo: "Sin actividad todavía: no hay nada que medir",
|
||||
msg: `Ninguna de las ${direcciones} direcciones calculadas tiene movimientos. El tipo de dirección (${tipo}) lo ${origen === "descriptor" ? "dice el descriptor" : `indica el prefijo ${clave}`}, así que no es eso: o la wallet está sin estrenar, o es la clave de otra cuenta, o la actividad está más allá de las direcciones calculadas. ${mas}` };
|
||||
if (origen === "elegido") return { banda: "SIN ACTIVIDAD", titulo: "Sin actividad en estas direcciones",
|
||||
msg: `Ninguna de las ${direcciones} direcciones calculadas tiene movimientos. Si tu wallet sí los tiene, puede que el tipo elegido (${tipo}) no sea el suyo: una ${clave} no lo indica. En el panel de la wallet puedes buscar el tipo en tu nodo o probar otro. ${mas}` };
|
||||
return { banda: "SIN ACTIVIDAD", titulo: "Sin actividad en estas direcciones",
|
||||
msg: `Ninguna de las ${direcciones} direcciones calculadas tiene movimientos. Si tu wallet sí los tiene, lo más probable es que el tipo de dirección no sea el correcto: una ${clave} no lo indica y se ha supuesto ${tipo}. En el panel de la wallet puedes buscar el tipo en tu nodo o elegir otro. ${mas}` };
|
||||
}
|
||||
// De dónde sale el tipo de dirección de la wallet cargada.
|
||||
const origenTipoWallet = w => !w ? null : w.descriptor ? "descriptor" : w.scriptSupuesto ? "supuesto" : (w.tipo === "xpub" || w.tipo === "tpub") ? "elegido" : "prefijo";
|
||||
// Cómo empieza una dirección, para compararla de un vistazo: «bc1p», «bc1q», «3», «1» (y tb1p, tb1q, 2, m/n en la red de pruebas).
|
||||
const prefijoDireccion = a => { const m = /^(bc1[pq]|tb1[pq]|bcrt1[pq])/i.exec(a || ""); return m ? m[1].toLowerCase() : (a || "").slice(0, 1); };
|
||||
// ── fin tipo por actividad
|
||||
|
||||
+63
-8
@@ -271,6 +271,27 @@
|
||||
// Mezcla con forma de Whirlpool: tantas entradas como salidas (5 o más)
|
||||
// y todas las salidas del mismo importe.
|
||||
const esMezcla = tx => (tx.vout || []).length >= 5 && tx.vin.length === tx.vout.length && new Set(tx.vout.map(o => o.value)).size === 1;
|
||||
// ── Pago por lotes: un solo criterio (v2.1.1, F1) ──────────────────
|
||||
// Hasta la v2.1.0 había dos varas de medir. Analizada directamente, una
|
||||
// transacción solo era lote si casi todos sus importes eran distintos;
|
||||
// vista como origen de otra, bastaba con 20 salidas. La misma transacción
|
||||
// real (0b875761…, 1 → 133 salidas a 133 direcciones, con importes que se
|
||||
// repiten) era «No es un pago por lotes» por un lado y «viene de un pago
|
||||
// por lotes» por el otro. Ahora es lote, se mire desde donde se mire, si:
|
||||
// · tiene 5 salidas o más y casi todas de importes distintos (≥ 80 %), o
|
||||
// · paga a 20 direcciones distintas o más,
|
||||
// y no es una mezcla. El origen pregunta a analyzeTx por la transacción
|
||||
// de la que viene la entrada: es el mismo código, no una copia.
|
||||
const LOTE_MIN_DESTINOS = 20;
|
||||
function formaDeLote(gastables, esCoinJoin) {
|
||||
if (esCoinJoin) return null;
|
||||
const n = gastables.length, importes = new Set(gastables.map(o => o.value)).size;
|
||||
const porImportes = n >= 5 && importes >= 5 && importes / n >= 0.8;
|
||||
// Una salida sin dirección (P2PK, script suelto) cuenta por su script.
|
||||
const destinos = new Set(gastables.map(o => o.scriptpubkey_address || o.scriptpubkey).filter(Boolean)).size;
|
||||
const porDestinos = destinos >= LOTE_MIN_DESTINOS;
|
||||
return porImportes || porDestinos ? { salidas: n, destinos, porImportes, porDestinos } : null;
|
||||
}
|
||||
|
||||
function analyzeTx(tx, ctx) {
|
||||
const checks = [];
|
||||
@@ -921,9 +942,10 @@
|
||||
// cambio. Un batch real (exchange/servicio pagando a muchos) tiene
|
||||
// muchos outputs casi todos con valores distintos. No exigimos que TODOS
|
||||
// sean distintos (dos destinatarios pueden recibir la misma cantidad).
|
||||
const uniqueOutValues = new Set(spendableValues);
|
||||
const distinctRatio = spendableOuts.length > 0 ? uniqueOutValues.size / spendableOuts.length : 0;
|
||||
const isBatch = spendableOuts.length >= 5 && distinctRatio >= 0.8 && uniqueOutValues.size >= 5 && !likelyCJ;
|
||||
// v2.1.1 (F1): también es lote el que paga a 20 direcciones distintas o
|
||||
// más, aunque repita importes. Ver formaDeLote.
|
||||
const lote = formaDeLote(spendableOuts, likelyCJ || esMezcla(tx));
|
||||
const isBatch = !!lote;
|
||||
// v1.53.0: al cerrar un canal no hay cambio: cada salida es de una parte.
|
||||
// En un Tx0, el cambio es lo que no va a la mezcla ni al coordinador.
|
||||
const changeGuess = lnCierre ? SIN_CAMBIO
|
||||
@@ -1118,7 +1140,7 @@
|
||||
detail: isBatch && rol === "envias"
|
||||
? `Eres tú quien paga (una entrada es de tu wallet): ${spendableOuts.length} salidas en una sola transacción. Ahorra comisión, pero deja ver que pagas a muchos a la vez y hace que todos los que cobran compartan tu origen: cualquiera de ellos ve los pagos a los demás. Tu cambio se evalúa en su propio check, sin la exención de los lotes.`
|
||||
: isBatch
|
||||
? `${spendableOuts.length} salidas, casi todas de importes distintos: compatible con un exchange o servicio que paga a muchos destinatarios en una sola transacción. Compartes las mismas entradas —y por tanto el mismo origen— con los otros destinatarios del lote, lo que permite a un observador agruparos.${rol === "desconocido" ? " (Se supone que cobras: sin wallet cargada, la app no sabe si el lote lo hiciste tú.)" : ""}`
|
||||
? `${lote.porImportes ? `${spendableOuts.length} salidas, casi todas de importes distintos` : `${spendableOuts.length} salidas a ${lote.destinos} direcciones distintas (con importes que se repiten)`}: compatible con un exchange o servicio que paga a muchos destinatarios en una sola transacción. Compartes las mismas entradas —y por tanto el mismo origen— con los otros destinatarios del lote, lo que permite a un observador agruparos.${rol === "desconocido" ? " (Se supone que cobras: sin wallet cargada, la app no sabe si el lote lo hiciste tú.)" : ""}`
|
||||
: "No tiene forma de pago por lotes.",
|
||||
didactic: "Exchanges y custodios agrupan múltiples pagos en una transacción para ahorrar comisiones. Recibir de un pago por lotes reduce tu privacidad: los demás destinatarios comparten origen contigo, así que un observador puede correlacionar todos los pagos del lote. Y si el origen es un exchange que verificó tu identidad (KYC), ese servicio sabe a quién pagó. Por eso se informa aparte, en «lo que hicieron otros»: te expone, pero no lo decidiste tú y no resta de tu nota.",
|
||||
penalty: isBatch ? heredado.batch_payment : 0,
|
||||
@@ -1333,7 +1355,11 @@
|
||||
const conPadre = entradas.filter(e => e.p);
|
||||
const deMezcla = conPadre.filter(e => esMezcla(e.p) && e.v.prevout && e.v.prevout.value === e.p.vout[0].value);
|
||||
const toxico = conPadre.filter(e => { const t0 = detectaTx0(e.p); return t0 && t0.cambio && e.p.vout.indexOf(t0.cambio) === e.v.vout; });
|
||||
const deLote = conPadre.filter(e => e.p.vout.length >= 20 && !esMezcla(e.p));
|
||||
// v2.1.1 (F1): el mismo criterio que el análisis directo, preguntado
|
||||
// a este mismo analizador (sin vecinas: no mira más allá). Si la
|
||||
// anterior no se puede analizar, no se supone que sea un lote.
|
||||
const esLoteVec = p => { try { return !!analyzeTx(p).lote; } catch { return false; } };
|
||||
const deLote = conPadre.filter(e => esLoteVec(e.p));
|
||||
const deMinero = conPadre.filter(e => (e.p.vin || []).some(x => x.is_coinbase));
|
||||
const hallazgos = [];
|
||||
const ajenoP = rol === "recibes";
|
||||
@@ -1405,9 +1431,35 @@
|
||||
}
|
||||
if (aperturaConfirmada.length) hallazgos.push(`la salida ${aperturaConfirmada[0]} abrió un canal Lightning: se ve porque después se cerró como tal`);
|
||||
const nSig = Object.keys(vecSig).length;
|
||||
checks.push({ id:"vecinas", label:`Mirado un salto: de dónde vienen ${conPadre.length} de ${tx.vin.length} entradas${nSig ? ` y quién gastó ${nSig === 1 ? "1 salida" : `${nSig} salidas`}` : ""}`, certainty:"CERTEZA", pass:true, informational:true, actionability:null,
|
||||
detail: `Se han traído de tu nodo las transacciones de las que vienen ${conPadre.length === tx.vin.length ? "todas las entradas" : `${conPadre.length} de las ${tx.vin.length} entradas`}${nSig ? `, y quién gastó ${nSig === 1 ? "una salida" : `${nSig} salidas`}` : ""}. Nada ha salido de tu red. ${hallazgos.length ? `Lo que añaden: ${hallazgos.join("; ")}.` : `No añaden nada especial: ni mezclas, ni pelado, ni lotes, ni minado${nSig ? ", ni canales" : ""}.`}${conPadre.length < tx.vin.length ? " Lo que no se pudo mirar no se supone." : ""}`,
|
||||
penalty: 0 });
|
||||
// v2.1.1 (F2): no se afirma nada de lo que no se ha mirado. Hasta la
|
||||
// v2.1.0, con 0 de N entradas traídas se seguía diciendo «No añaden
|
||||
// nada especial: ni mezclas, ni pelado…» y con CERTEZA: un hueco en
|
||||
// los datos leído como un dato. Ahora cada frase habla solo de lo que
|
||||
// sí se trajo, y si no se trajo nada, se dice eso y nada más.
|
||||
const nMir = conPadre.length, nEnt = tx.vin.length;
|
||||
const nMirables = tx.vin.filter(v => !v.is_coinbase).length;
|
||||
const lasEntradas = nEnt === 1 ? "la entrada" : `las ${nEnt} entradas`;
|
||||
const gastoSal = nSig ? `quién gastó ${nSig === 1 ? "1 salida" : `${nSig} salidas`}` : "";
|
||||
if (nMir === 0 && !nSig) {
|
||||
// Una transacción que solo crea monedas nuevas no tiene «de dónde
|
||||
// viene»: no hay nada que mirar ni nada que decir.
|
||||
if (nMirables > 0) checks.push({ id:"vecinas", label:`Un salto atrás: no se pudo mirar ${nEnt === 1 ? "la entrada" : "ninguna entrada"}`, certainty:null, pass:true, informational:true, actionability:null, sinDatos:true,
|
||||
detail: `No se pudo traer de tu nodo ${nEnt === 1 ? "la transacción de la que viene la entrada" : `ninguna de las transacciones de las que vienen ${lasEntradas}`}. De un salto atrás no se sabe nada: ni que haya mezclas, lotes o monedas recién minadas, ni que no los haya.`,
|
||||
penalty: 0 });
|
||||
} else {
|
||||
const label = nMir === 0
|
||||
? `Mirado un salto: ${gastoSal} (de dónde ${nEnt === 1 ? "viene la entrada" : "vienen las entradas"}, no se pudo mirar)`
|
||||
: `Mirado un salto: de dónde vienen ${nMir} de ${nEnt} entradas${nSig ? ` y ${gastoSal}` : ""}`;
|
||||
const traido = nMir === 0
|
||||
? `Se ha traído de tu nodo ${nSig === 1 ? "quién gastó una salida" : `quién gastó ${nSig} salidas`}`
|
||||
: `Se han traído de tu nodo las transacciones de las que vienen ${nMir === nEnt ? "todas las entradas" : `${nMir} de las ${nEnt} entradas`}${nSig ? `, y quién gastó ${nSig === 1 ? "una salida" : `${nSig} salidas`}` : ""}`;
|
||||
const nada = nMir === 0
|
||||
? "Lo mirado no añade nada especial: no se ve ningún canal."
|
||||
: `${nMir < nEnt ? "Lo mirado no añade" : "No añaden"} nada especial: ni mezclas, ni pelado, ni lotes, ni minado${nSig ? ", ni canales" : ""}.`;
|
||||
checks.push({ id:"vecinas", label, certainty:"CERTEZA", pass:true, informational:true, actionability:null,
|
||||
detail: `${traido}. Nada ha salido de tu red. ${hallazgos.length ? `Lo que añaden: ${hallazgos.join("; ")}.` : nada}${nMir < nMirables ? (nMir === 0 ? ` De ${lasEntradas} no se sabe nada: lo que no se pudo mirar no se supone.` : " Lo que no se pudo mirar no se supone.") : ""}`,
|
||||
penalty: 0 });
|
||||
}
|
||||
}
|
||||
|
||||
// ── 17. Detección de entidades conocidas ──────────────────────────
|
||||
@@ -1597,6 +1649,9 @@
|
||||
wallets: simulada ? [] : detectedWallets,
|
||||
rol: { papel: rol, entradasPropias, salidasPropias: salidasPropiasIdx, declarado: !!papelDeclarado },
|
||||
simulada,
|
||||
// v2.1.1 (F1): si tiene forma de pago por lotes y por qué (o null).
|
||||
// Lo lee este mismo analizador cuando la transacción es el origen de otra.
|
||||
lote,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -187,7 +187,10 @@
|
||||
const fallos = vigente ? NODE_HEALTH.fallos : new Map();
|
||||
const oks = vigente ? NODE_HEALTH.oks : new Set();
|
||||
const sustituidos = vigente ? NODE_HEALTH.sustituidos : new Map();
|
||||
return { fallos, oks, sustituidos, esEjemplo: path => !base || fallos.has(claveRuta(path)) || sustituidos.has(rutaExacta(path)) };
|
||||
// v2.1.1 (U5): sinDatos(ruta) → con un nodo configurado, esa parte no
|
||||
// contestó y no hay dato que enseñar (ni de ejemplo: ver useApi.get).
|
||||
return { fallos, oks, sustituidos, esEjemplo: path => !base || fallos.has(claveRuta(path)) || sustituidos.has(rutaExacta(path)),
|
||||
sinDatos: path => !!base && (fallos.has(claveRuta(path)) || sustituidos.has(rutaExacta(path))) };
|
||||
}
|
||||
const esFalloDeNodo = e => !(e && e.bloqueado) && !/HTTP 4\d\d/.test((e && e.message) || "");
|
||||
|
||||
@@ -202,7 +205,13 @@
|
||||
} catch (e) {
|
||||
if (esFalloDeNodo(e)) marcarNodo(baseUrl, path, (e && e.name === "AbortError") ? "sin respuesta (timeout)" : ((e && e.message) || "sin respuesta"));
|
||||
// Un null o una lista vacía no son datos de ejemplo: no se marcan.
|
||||
if (mockData != null && !(Array.isArray(mockData) && mockData.length === 0)) marcarSustituido(baseUrl, path, (e && e.message) || "sin respuesta");
|
||||
// v2.1.1 (U5): los datos de ejemplo son solo para el modo
|
||||
// demostración (sin nodo). Con un nodo configurado que no contesta
|
||||
// ya no se devuelven: hasta la v2.1.0 se pintaban a todo color
|
||||
// («Sincronizado: Sí ✓») bajo el aviso de que el nodo no respondía.
|
||||
// Ahora llega null, la ruta queda marcada «sin datos» y cada
|
||||
// pantalla pone una raya.
|
||||
if (mockData != null && !(Array.isArray(mockData) && mockData.length === 0)) { marcarSustituido(baseUrl, path, (e && e.message) || "sin respuesta"); return null; }
|
||||
return mockData;
|
||||
}
|
||||
}, [baseUrl]);
|
||||
|
||||
+18
-18
@@ -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,19 +207,19 @@
|
||||
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",
|
||||
"No hay ningún nodo configurado: todo lo que ves son datos de ejemplo, no reales. Para ver los tuyos, pon la URL de tu nodo en Ajustes.");
|
||||
if (h.fallos.size === 0) return null;
|
||||
if (h.oks.size === 0) return caja(C.red, C.redMuted, "TU NODO NO RESPONDE · LO QUE VES ES DE EJEMPLO",
|
||||
<span>No hay respuesta de <span style={{fontFamily:C.mono}}>{base}</span>. Los datos de esta pantalla son de ejemplo, no reales. Comprueba en Ajustes que la URL empiece igual que esta página (<strong>https://</strong>), que el nodo esté encendido y, si estás fuera de casa, que Tailscale esté conectado en este dispositivo.</span>);
|
||||
if (h.oks.size === 0) return caja(C.red, C.redMuted, "TU NODO NO RESPONDE · NO HAY DATOS QUE ENSEÑAR",
|
||||
<span>No hay respuesta de <span style={{fontFamily:C.mono}}>{base}</span>. Donde debería haber datos verás una raya (—): la app no los rellena con ejemplos. Comprueba en Ajustes que la URL empiece igual que esta página (<strong>https://</strong>), que el nodo esté encendido y, si estás fuera de casa, que Tailscale esté conectado en este dispositivo.</span>);
|
||||
return caja(C.amber, C.amberMuted, "TU NODO RESPONDE A MEDIAS",
|
||||
<span>Algunas partes no contestan: {[...new Set([...h.fallos.keys()].map(nombreParteNodo))].join(", ")}. Donde ponga <strong>EJEMPLO</strong>, esos datos no son reales.</span>);
|
||||
<span>Algunas partes no contestan: {[...new Set([...h.fallos.keys()].map(nombreParteNodo))].join(", ")}. Donde ponga <strong>SIN DATOS</strong> o una raya (—), esa parte no ha contestado: no se rellena con ejemplos.</span>);
|
||||
}
|
||||
|
||||
// v1.50.2 (auditoría B1, AR-08): qué parte del nodo falla, con nombre, no
|
||||
@@ -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.
|
||||
@@ -292,13 +292,13 @@
|
||||
function Inicio({onIr}) {
|
||||
const acciones = [
|
||||
{titulo:"Auditar una transacción", desc:"Pega el identificador de una transacción (txid) y mira qué revela de quien la hizo.", color:C.purple, destino:"auditoria"},
|
||||
{titulo:"Revisar mi wallet (xpub)", desc:"Pega tu clave pública (xpub o zpub; en Sparrow, «Master Public Key»). Nunca la semilla. La app marca qué direcciones son tuyas.", color:C.green, destino:"wallet"},
|
||||
{titulo:"Revisar mi wallet (descriptor o xpub)", desc:"Pega tu clave pública (xpub o zpub; en Sparrow, «Master Public Key»). Nunca la semilla. La app marca qué direcciones son tuyas.", color:C.green, destino:"wallet"},
|
||||
{titulo:"Explorar la cadena", desc:"Busca una dirección, un bloque o una transacción.", color:C.blue, destino:"lab"},
|
||||
{titulo:"Seguir unos fondos", desc:"De dónde vino o a dónde fue, salto a salto.", color:C.red, destino:"peritaje"},
|
||||
];
|
||||
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"}}>
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
@@ -563,7 +563,7 @@
|
||||
checks.forEach(c => {
|
||||
const estado = c.informational ? "informativa" : (c.pass ? "sin problema" : "a revisar");
|
||||
const detalle = (c.detail||"").replace(/\|/g,"\\|").replace(/\n/g," ");
|
||||
L.push(`| ${c.label} | ${c.certainty} | ${estado} | ${detalle} |`);
|
||||
L.push(`| ${c.label} | ${c.certainty || "SIN DATOS"} | ${estado} | ${detalle} |`);
|
||||
});
|
||||
L.push("");
|
||||
L.push(`---`);
|
||||
@@ -579,39 +579,39 @@
|
||||
|
||||
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>
|
||||
<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>}
|
||||
<div style={{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:14,paddingTop:14,borderTop:`1px solid ${C.border}`}}>
|
||||
<span style={{fontSize:"0.69rem",fontFamily:C.mono,color:C.purple,textTransform:"uppercase",letterSpacing:"0.2em",fontWeight:700}}>Privacidad</span>
|
||||
<div style={{flex:"1 1 20px",minWidth:0,height:1,background:`linear-gradient(to right,${C.purple}40,transparent)`}}/>
|
||||
{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
@@ -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)}
|
||||
|
||||
+49
-38
@@ -31,6 +31,16 @@
|
||||
|
||||
if(!mempoolData)return<Spinner/>;
|
||||
const{fees,mempool,height,diff}=mempoolData;
|
||||
// v2.1.1 (U5): con un nodo configurado que no contesta, cada dato que
|
||||
// falta es una raya gris. Los ejemplos, solo en modo demostración.
|
||||
const raya = (v, f) => v == null ? "—" : f(v);
|
||||
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.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>);
|
||||
|
||||
return (
|
||||
<div style={{display:"flex",flexDirection:"column",gap:12}}>
|
||||
@@ -46,23 +56,24 @@
|
||||
<Badge color={RED.signet?C.purple:C.green}>{RED.signet?"SIGNET":"MAINNET"}</Badge>
|
||||
</div>
|
||||
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(130px,1fr))",gap:14,paddingTop:12,borderTop:`1px solid ${C.border}`}}>
|
||||
<Tag label="Bloque actual" value={`#${fmt.num(height)}`} color={C.purple}/>
|
||||
<Tag label="Sin confirmar" value={fmt.num(mempool.count)} color={C.amber}/>
|
||||
<Tag label="Tamaño mempool" value={fmt.mb(mempool.vsize)} color={C.t1}/>
|
||||
<Tag label="Tarifa mínima" value={`${fees.minimumFee} sat/vB`} color={C.blue}/>
|
||||
<Tag label="Próximo ajuste" value={`${diff.remainingBlocks} bloques`} color={C.t1}/>
|
||||
<Tag label="Bloque actual" value={raya(height, h=>`#${fmt.num(h)}`)} color={gris(height, C.purple)}/>
|
||||
<Tag label="Sin confirmar" value={raya(mempool, m=>fmt.num(m.count))} color={gris(mempool, C.amber)}/>
|
||||
<Tag label="Tamaño mempool" value={raya(mempool, m=>fmt.mb(m.vsize))} color={gris(mempool, C.t1)}/>
|
||||
<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.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}}>
|
||||
<IconoBtc/> Bitcoin Core {base&&salud.esEjemplo("/system/bitcoin")&&<Badge color={C.amber}>EJEMPLO · txoko-metrics no contesta</Badge>}
|
||||
<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</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 ? <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}/>
|
||||
@@ -78,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}}>
|
||||
<span>⬡</span> Sistema {base&&salud.esEjemplo("/system/info")&&<Badge color={C.amber}>EJEMPLO · txoko-metrics no contesta</Badge>}
|
||||
<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</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 ? <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 */}
|
||||
@@ -98,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>
|
||||
@@ -113,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 */}
|
||||
@@ -157,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>
|
||||
@@ -175,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>
|
||||
@@ -186,11 +197,11 @@
|
||||
|
||||
{/* 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={`${diff.difficultyChange>0?"+":""}${fmtDec(Number(diff.difficultyChange), 2)} %`} color={diff.difficultyChange>0?C.red:C.green}/>
|
||||
<Tag label="Tiempo promedio" value={`${diff.timeAvg?fmtDec(diff.timeAvg/60000, 1):"-"} min`} color={C.blue}/>
|
||||
<Tag label="Bloques restantes" value={fmt.num(diff.remainingBlocks)} color={C.t1}/>
|
||||
<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)}/>
|
||||
<Tag label="Bloques restantes" value={raya(diff, d=>fmt.num(d.remainingBlocks))} color={gris(diff, C.t1)}/>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -393,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>
|
||||
@@ -409,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`}}>
|
||||
@@ -418,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"}
|
||||
@@ -426,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>
|
||||
)}
|
||||
@@ -478,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>
|
||||
@@ -489,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 */}
|
||||
@@ -499,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>
|
||||
@@ -513,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>}
|
||||
@@ -526,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
@@ -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 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}>EJEMPLO</Badge> Tu nodo no ha dado {ej.map(([,n])=>n).join(", ")}{motivos.length?` (${motivos.join("; ")})`:""}: lo que ves ahí son <strong>datos de ejemplo</strong>, no los de la red.</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>
|
||||
|
||||
+26
-23
@@ -106,10 +106,10 @@
|
||||
<div style={{display:"flex",flexDirection:"column",gap:12}}>
|
||||
{!base&&<DemoBanner/>}
|
||||
<SectionTitle accent={C.purple} icon="⌕">Explorar la cadena</SectionTitle>
|
||||
<div style={{display:"flex",gap:8}}>
|
||||
<div style={{display:"flex",gap:8,flexWrap:"wrap"}}>
|
||||
<input value={query} onChange={e=>setQuery(filtrarSecreto(e.target.value))} onKeyDown={e=>e.key==="Enter"&&search()}
|
||||
placeholder="txid · dirección · altura · hash de bloque"
|
||||
style={{flex:1,background:C.bgCard,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"11px 14px",color:C.t1,fontFamily:C.mono,fontSize:"0.78rem",outline:"none"}}
|
||||
style={{flex:"1 1 150px",minWidth:0,background:C.bgCard,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"11px 14px",color:C.t1,fontFamily:C.mono,fontSize:"0.78rem",outline:"none"}}
|
||||
onFocus={e=>e.target.style.borderColor=C.purple} onBlur={e=>e.target.style.borderColor=C.borderBright}
|
||||
/>
|
||||
<BotonQR campo="busqueda" onLeido={v=>setQuery(v)}/>
|
||||
@@ -154,8 +154,11 @@
|
||||
try{ tx=await getStrict(`/api/tx/${q}`); }
|
||||
catch(e2){ const m=String(e2&&e2.message||""); throw new Error(/HTTP 4\d\d/.test(m)?"desconocida":m||"sin respuesta"); }
|
||||
if(!tx)throw new Error("desconocida");
|
||||
const height=await get("/api/blocks/tip/height",MOCK_HEIGHT);
|
||||
const confs=tx.status?.confirmed?(height-tx.status.block_height+1):0;
|
||||
// v2.1.1 (U5): si el nodo da la transacción pero no la altura de
|
||||
// la cadena, las confirmaciones no se calculan con la altura de
|
||||
// ejemplo: se dice que no se saben.
|
||||
const height=await get("/api/blocks/tip/height",null);
|
||||
const confs=tx.status?.confirmed?(Number.isFinite(height)?(height-tx.status.block_height+1):null):0;
|
||||
setResult({tx,confs,height});
|
||||
}catch(e){setErr(e.message==="desconocida"
|
||||
? `Tu nodo no conoce esta transacción. Comprueba el txid y que es de esta red (${RED.signet?"signet":"mainnet"}); si se acaba de enviar, puede que aún no le haya llegado.`
|
||||
@@ -164,23 +167,23 @@
|
||||
};
|
||||
|
||||
const statusColor = result
|
||||
? result.confs===0 ? C.amber : result.confs<6 ? C.blue : C.green
|
||||
? result.confs===0 ? C.amber : result.confs==null ? C.t2 : result.confs<6 ? C.blue : C.green
|
||||
: C.t2;
|
||||
const statusLabel = result
|
||||
? result.confs===0 ? "SIN CONFIRMAR" : result.confs<6 ? `${result.confs} CONFIRMACI${result.confs===1?"ÓN":"ONES"}` : `${fmt.num(result.confs)} CONFIRMACIONES ✓`
|
||||
? result.confs===0 ? "SIN CONFIRMAR" : result.confs==null ? "CONFIRMADA · NO SE SABE CUÁNTAS CONFIRMACIONES" : result.confs<6 ? `${result.confs} CONFIRMACI${result.confs===1?"ÓN":"ONES"}` : `${fmt.num(result.confs)} CONFIRMACIONES ✓`
|
||||
: "";
|
||||
|
||||
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={{display:"flex",gap:8,marginBottom:err||result?"10px":"0"}}>
|
||||
<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,flexWrap:"wrap",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"
|
||||
style={{flex:1,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none"}}
|
||||
style={{flex:"1 1 150px",minWidth:0,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none"}}
|
||||
onFocus={e=>e.target.style.borderColor=C.green} onBlur={e=>e.target.style.borderColor=C.borderBright}
|
||||
/>
|
||||
<BotonQR campo="txid" color={C.green} onLeido={v=>setTxid(v)}/>
|
||||
@@ -193,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}}>
|
||||
@@ -201,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>
|
||||
@@ -392,25 +395,25 @@
|
||||
|
||||
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}}>
|
||||
<div style={{display:"flex",gap:8,flexWrap:"wrap",marginBottom:10}}>
|
||||
<input value={addr} onChange={e=>setAddr(filtrarSecreto(e.target.value))} onKeyDown={e=>e.key==="Enter"&&fetchUtxos()}
|
||||
placeholder="Dirección Bitcoin (bc1q..., bc1p..., 1..., 3...)"
|
||||
style={{flex:1,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none"}}
|
||||
style={{flex:"1 1 150px",minWidth:0,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none"}}
|
||||
onFocus={e=>e.target.style.borderColor=C.purple} onBlur={e=>e.target.style.borderColor=C.borderBright}
|
||||
/>
|
||||
<BotonQR campo="direccion" onLeido={v=>setAddr(v)}/>
|
||||
@@ -432,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>
|
||||
)}
|
||||
@@ -452,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>
|
||||
|
||||
@@ -468,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>
|
||||
@@ -477,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>
|
||||
@@ -494,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
@@ -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)}
|
||||
|
||||
@@ -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&¶da.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&¶da.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&¶da&&<ParadaBox p={parada}/>}
|
||||
{!esActual&¶da&&<div style={{fontSize:"0.66rem",color:C.t2,fontFamily:C.mono}}>{parada.titulo}</div>}
|
||||
{!esActual&¶da&&<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 ? (
|
||||
|
||||
@@ -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}
|
||||
|
||||
+31
-24
@@ -88,49 +88,56 @@
|
||||
};
|
||||
|
||||
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 };
|
||||
// v2.1.1 (U6): sin wallet cargada el simulador no puede hacer nada, y
|
||||
// ocupaba media pantalla por delante del campo del txid. Se queda en
|
||||
// una línea hasta que haya wallet.
|
||||
if (!walletAddrs) return (
|
||||
<div data-simulador="plegado" style={{ padding: "9px 14px", background: C.bgCard, border: `1px solid ${C.border}`, borderRadius: 8, fontSize: "0.69rem", color: C.t2, fontFamily: C.mono, lineHeight: 1.4 }}>
|
||||
<span style={{ color: C.amber, fontWeight: 700 }}>¿QUÉ REVELARÍA ESTE GASTO?</span> · simula un gasto antes de hacerlo. Necesita una wallet cargada (arriba).
|
||||
</div>);
|
||||
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
|
||||
? (base ? "Necesita el informe de la wallet: pulsa «⊙ Analizar wallet» arriba y, cuando termine, aquí saldrán tus monedas sin gastar."
|
||||
: "Necesita el informe de la wallet, y sin nodo (⚙ Ajustes) no se puede calcular: no hay a quién preguntar por tus monedas. La app no trae una wallet de ejemplo.")
|
||||
: (base ? "Necesita una wallet cargada (xpub o descriptor, arriba) y su informe («Analizar wallet»)."
|
||||
: (base ? "Necesita una wallet cargada (descriptor o xpub, arriba) y su informe («Analizar wallet»)."
|
||||
: "Necesita una wallet cargada y su informe, que se calcula preguntando a tu nodo. Sin nodo (⚙ Ajustes) no hay monedas que elegir, y la app no trae una wallet de ejemplo.")}
|
||||
</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 +146,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>)}
|
||||
|
||||
+206
-110
@@ -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 && (
|
||||
@@ -113,6 +113,13 @@
|
||||
const [verifWallet,setVerifWallet]=useState(null);
|
||||
const verifRef=useRef(null);
|
||||
const [verDondeClave,setVerDondeClave]=useState(false);
|
||||
// v2.1.1 (X1): en qué tipo de dirección tiene actividad una xpub suelta.
|
||||
// null | {estado:"buscando",hechas,total,clave} | {estado:"hecho",res,clave} | {estado:"error",mensaje,clave}
|
||||
// La búsqueda la pide la persona con un botón: cargar la wallet sigue
|
||||
// sin preguntar nada al nodo. `clave` es la xpub a la que se refiere.
|
||||
const [tipoDet,setTipoDet]=useState(null);
|
||||
const detGen=useRef(0);
|
||||
const olvidarTipo = () => { detGen.current++; setTipoDet(null); };
|
||||
// Un secreto pegado (xprv, WIF, semilla) no llega ni a quedarse en el
|
||||
// campo: se borra al pegarlo y el mensaje no lo repite (v1.44).
|
||||
const cambiarEntradaWallet = (v) => {
|
||||
@@ -137,6 +144,8 @@
|
||||
setXpubError(e.message); setXpubLoading(false); return;
|
||||
}
|
||||
const desc = plan.modo === "descriptor" ? plan : null;
|
||||
// Lo que se buscó para otra clave no vale para esta.
|
||||
if (tipoDet && tipoDet.clave !== plan.xpub) olvidarTipo();
|
||||
const addrs = await deriveAddresses(plan.xpub, xpubCount, desc ? null : elegido, desc ? { script: desc.script, ramas: desc.ramas } : {});
|
||||
setWalletAddrs({ ...addrs, descriptor: desc ? { huella: desc.huella, ruta: desc.ruta, sumas: desc.sumas, notaPrefijo: desc.notaPrefijo, notaRuta: desc.notaRuta, lineas: desc.lineas, ramas: desc.ramas } : null });
|
||||
// El panel se queda abierto: el paso siguiente («Analizar wallet»)
|
||||
@@ -147,7 +156,31 @@
|
||||
setXpubLoading(false);
|
||||
};
|
||||
|
||||
const clearWallet = () => { setWalletAddrs(null); setXpubInput(""); setXpubError(null); olvidarInforme(); };
|
||||
const clearWallet = () => { setWalletAddrs(null); setXpubInput(""); setXpubError(null); olvidarInforme(); olvidarTipo(); };
|
||||
|
||||
// v2.1.1 (X1): pregunta al nodo por las primeras direcciones de los
|
||||
// cuatro tipos y dice en cuál hay movimientos. Propone; no cambia nada.
|
||||
const xpubSinTipo = !!walletAddrs && !walletAddrs.descriptor && (walletAddrs.tipo==="xpub"||walletAddrs.tipo==="tpub");
|
||||
const buscarTipo = async () => {
|
||||
if (!xpubSinTipo || !base || (tipoDet && tipoDet.estado==="buscando")) return;
|
||||
const gen = ++detGen.current;
|
||||
let plan;
|
||||
try { plan = await analizarEntradaWallet(xpubInput.trim(), RED.signet ? "tb" : "bc"); }
|
||||
catch (e) { setTipoDet({ estado:"error", mensaje:e.message, clave:null }); return; }
|
||||
setTipoDet({ estado:"buscando", hechas:0, total:DETECCION_CONSULTAS, clave:plan.xpub });
|
||||
try {
|
||||
const res = await buscarTipoPorActividad(plan.xpub, {
|
||||
derivar: deriveAddresses,
|
||||
consultar: d => getStrict(`/api/address/${d}`),
|
||||
alAvanzar: (hechas,total) => { if (gen===detGen.current) setTipoDet(v => v&&v.estado==="buscando" ? { ...v, hechas, total } : v); },
|
||||
sigue: () => gen===detGen.current,
|
||||
});
|
||||
if (!res || gen!==detGen.current) return;
|
||||
setTipoDet({ estado:"hecho", res, clave:plan.xpub });
|
||||
} catch (e) {
|
||||
if (gen===detGen.current) setTipoDet({ estado:"error", mensaje:e.message, clave:plan.xpub });
|
||||
}
|
||||
};
|
||||
|
||||
// Determinar si una dirección es mía y de qué rama
|
||||
const myAddr = (addr) => {
|
||||
@@ -239,6 +272,15 @@
|
||||
report.scanErrors = scanErrors;
|
||||
report.scanComplete = scanErrors.length === 0;
|
||||
report.alcance = { recepcion: walletAddrs.receive.length, cambio: walletAddrs.change.length, script: walletAddrs.script, scriptSupuesto: walletAddrs.scriptSupuesto };
|
||||
// v2.1.1 (X1): sin actividad no hay nota, y lo que se dice depende
|
||||
// de cuánto se sabe del tipo de dirección. Si además fallaron
|
||||
// consultas, ni siquiera se puede decir «sin actividad».
|
||||
if (report.health.band === "SIN ACTIVIDAD") {
|
||||
const sa = mensajeSinActividad({ origen: origenTipoWallet(walletAddrs), tipo: TIPO_SCRIPT[walletAddrs.script]||walletAddrs.script, clave: walletAddrs.tipo, direcciones: all.length, fallos: scanErrors.length });
|
||||
report.health = { ...report.health, band: sa.banda, titulo: sa.titulo, msg: sa.msg, color: sa.banda==="SIN DATOS" ? C.amber : report.health.color };
|
||||
report.sinNota = true;
|
||||
report.origenTipo = origenTipoWallet(walletAddrs);
|
||||
}
|
||||
if (gen !== walletGen.current) return; // la wallet cambió mientras se escaneaba
|
||||
setWalletReport(report);
|
||||
} catch(e) {
|
||||
@@ -308,28 +350,28 @@
|
||||
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(220px,1fr))",gap:8}}>
|
||||
<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 (xpub o descriptor)"}</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.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.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 (xpub o descriptor)</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}}>
|
||||
Pega la clave pública de tu wallet (empieza por xpub, ypub o zpub) o su descriptor. <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>
|
||||
<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.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>
|
||||
@@ -338,7 +380,7 @@
|
||||
<div><strong style={{color:C.t1}}>BitBoxApp:</strong> entra en la cuenta → información de la cuenta: ahí está la clave pública extendida.</div>
|
||||
<div><strong style={{color:C.t1}}>BlueWallet:</strong> entra en la wallet → ⋯ (detalles) → «Mostrar XPUB».</div>
|
||||
<div><strong style={{color:C.t1}}>Electrum:</strong> menú Monedero → Información → Clave pública maestra.</div>
|
||||
<div style={{marginTop:4,color:C.t3}}>Los nombres pueden cambiar un poco según la versión. Lo que buscas es un texto largo que empieza por xpub, ypub o zpub, o un descriptor como wpkh([huella/84h/0h/0h]xpub…/<0;1>/*)#suma. Valen los descriptores wpkh(…), sh(wpkh(…)), pkh(…) y tr(…) de una sola clave (Taproot), y recepción y cambio pueden ir en dos líneas. Una wallet Taproot no tiene prefijo propio: su clave empieza por xpub, así que o pegas el descriptor tr(…) o pegas la xpub y eliges «Taproot (bc1p…)». La multifirma y el Taproot con scripts todavía no se pueden cargar.</div>
|
||||
<div style={{marginTop:4,color:C.t3}}>Los nombres pueden cambiar un poco según la versión. Lo que buscas es un texto largo que empieza por xpub, ypub o zpub, o un descriptor como wpkh([huella/84h/0h/0h]xpub…/<0;1>/*)#suma. Valen los descriptores wpkh(…), sh(wpkh(…)), pkh(…) y tr(…) de una sola clave (Taproot), y recepción y cambio pueden ir en dos líneas. Una wallet Taproot no tiene prefijo propio: su clave empieza por xpub, así que o pegas el descriptor tr(…) o pegas la xpub y eliges «Taproot (bc1p…)» (o pulsas «Buscar el tipo en mi nodo»). La multifirma y el Taproot con scripts todavía no se pueden cargar.</div>
|
||||
</div>)}
|
||||
</div>
|
||||
{/* Este aviso no es adorno. La versión anterior decía solo "el
|
||||
@@ -347,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.
|
||||
@@ -355,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.</>
|
||||
@@ -365,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]).</>}
|
||||
@@ -382,37 +424,81 @@
|
||||
<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>)}
|
||||
{(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 style={{display:"flex",flexDirection:"column",gap:3,marginBottom:10}}>
|
||||
{(walletAddrs.receive.length?walletAddrs.receive:walletAddrs.change).slice(0,3).map((a,i)=>(
|
||||
<div key={i} style={{fontSize:"0.6rem",fontFamily:C.mono,color:C.t1}}>
|
||||
<span style={{color:C.t2}}>{walletAddrs.receive.length?"recepción":"cambio"} {i}:</span> {a}
|
||||
{/* v2.1.1 (X1): el tipo, por la actividad. Lo pide la persona. */}
|
||||
{xpubSinTipo&&(
|
||||
<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.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.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.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.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.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.69rem",cursor:"pointer",fontWeight:700}}>
|
||||
Cargar como {TIPO_SCRIPT[t]}
|
||||
</button>))}
|
||||
</div>)}
|
||||
<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.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.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.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")
|
||||
? <>Una {walletAddrs.tipo} no dice qué tipo de direcciones usa tu wallet. Prueba los botones de tipo de arriba (Taproot bc1p…, SegWit anidada 3…, antigua 1…): el que dé la misma dirección es el bueno. Fíjate en cómo empiezan las direcciones de tu wallet: eso te dice cuál.</>
|
||||
? <>Una {walletAddrs.tipo} no dice qué tipo de direcciones usa tu wallet. Prueba los botones de tipo de arriba (Taproot bc1p…, SegWit anidada 3…, antigua 1…): el que dé la misma dirección es el bueno. Fíjate en cómo empiezan las direcciones de tu wallet: eso te dice cuál. Si no lo sabes, «Buscar el tipo en mi nodo» te dice en cuál hay movimientos.</>
|
||||
: <>La app ha calculado direcciones {TIPO_SCRIPT[walletAddrs.script]} porque es lo que indica el prefijo {walletAddrs.tipo}. Si las de tu wallet empiezan por otra cosa, exporta la clave con el prefijo que corresponde: zpub para bc1q…, ypub para 3…, o una xpub y eliges el tipo aquí (Taproot, bc1p…, no tiene prefijo propio: va con xpub o con su descriptor tr(…)).</>}
|
||||
<div style={{marginTop:4}}>Comprueba también que es la clave de la misma cuenta y wallet, y que miras su primera dirección de <em>{walletAddrs.receive.length?"recepción":"cambio"}</em>{walletAddrs.receive.length?", no una de cambio":", no una de recepción"}.{walletAddrs.profundidad!==3?" Además, esta clave no es de una cuenta normal (mira el aviso de arriba).":""}</div>
|
||||
<div style={{marginTop:4,color:C.t2}}>Mientras no coincidan, el análisis de abajo sería sobre direcciones que no son las tuyas.</div>
|
||||
@@ -421,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>
|
||||
):(
|
||||
@@ -445,7 +531,7 @@
|
||||
Sparrow trae varias. Intro carga; Mayús+Intro, salto. */}
|
||||
<textarea value={xpubInput} onChange={e=>cambiarEntradaWallet(e.target.value)}
|
||||
onKeyDown={e=>{ if(e.key==="Enter"&&!e.shiftKey){ e.preventDefault(); loadWallet(); } }}
|
||||
placeholder="xpub… / zpub… o descriptor de Sparrow o Core: wpkh([…]xpub…/<0;1>/*)#… o tr(…)"
|
||||
placeholder="descriptor de Sparrow o Core (recomendado): wpkh([…]xpub…/<0;1>/*)#… o tr(…) · o una xpub… / zpub…"
|
||||
rows={xpubInput.includes("\n")?4:1} spellCheck={false} autoComplete="off" autoCorrect="off" autoCapitalize="off"
|
||||
style={{flex:1,minWidth:0,resize:"vertical",background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"8px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.7rem",outline:"none",lineHeight:1.4}}
|
||||
/>
|
||||
@@ -463,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>
|
||||
)}
|
||||
|
||||
@@ -472,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=[
|
||||
@@ -494,11 +580,11 @@
|
||||
`## Salud general: ${health.band}`,``,health.msg,``,
|
||||
`- Transacciones analizadas: ${totalTxs}`,
|
||||
`- Direcciones con actividad: ${activeCount}`,
|
||||
`- Direcciones que han recibido más de una vez: ${reusedAddrs.length}`,
|
||||
`- Direcciones que han recibido más de una vez: ${walletReport.sinNota?"sin medir (no hay actividad)":reusedAddrs.length}`,
|
||||
...reusedAddrs.map(([a,n])=>` - ${a}: ${n} veces`),
|
||||
`- Grupos de direcciones vinculadas: ${clusters.length}`,``,
|
||||
`- Grupos de direcciones vinculadas: ${walletReport.sinNota?"sin medir (no hay actividad)":clusters.length}`,``,
|
||||
`## Grupos de direcciones vinculadas`,``,
|
||||
...(clusters.length===0?[`Ninguna transacción une tus direcciones entre sí.`]:clusters.flatMap((c,i)=>{
|
||||
...(walletReport.sinNota?[`Sin actividad en las direcciones calculadas: no hay nada que medir.`]:clusters.length===0?[`Ninguna transacción une tus direcciones entre sí.`]:clusters.flatMap((c,i)=>{
|
||||
const txs=[...new Set(walletReport.linkReasons.filter(r=>r.addrs.some(a=>c.includes(a))).map(r=>r.txid))];
|
||||
return [`### Grupo ${i+1} — ${c.length} direcciones`,``,`Vinculadas al gastarse juntas en ${txs.length} transacci${txs.length===1?"ón":"ones"}: ${txs.join(", ")}`,``,...c.map(a=>`- ${a}`),``];
|
||||
})),``,
|
||||
@@ -507,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>
|
||||
)}
|
||||
@@ -524,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>
|
||||
@@ -548,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>
|
||||
@@ -573,26 +659,33 @@
|
||||
{/* Bloque 1: Salud general */}
|
||||
<div style={{display:"flex",alignItems:"center",gap:14,padding:"12px 14px",background:C.bgCard,borderRadius:8,marginBottom:14,border:`1px solid ${walletReport.health.color}30`}}>
|
||||
<div style={{width:48,height:48,borderRadius:"50%",border:`3px solid ${walletReport.health.color}`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
|
||||
<span style={{fontSize:walletReport.health.band==="SIN ACTIVIDAD"?"0.5rem":"0.6rem",fontFamily:C.mono,fontWeight:700,color:walletReport.health.color,textAlign:"center",lineHeight:1.1}}>{walletReport.health.band==="SIN ACTIVIDAD"?"—":walletReport.health.band}</span>
|
||||
<span style={{fontSize:walletReport.sinNota?"0.5rem":"0.6rem",fontFamily:C.mono,fontWeight:700,color:walletReport.health.color,textAlign:"center",lineHeight:1.1}}>{walletReport.sinNota?"—":walletReport.health.band}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{flex:1,minWidth:0}}>
|
||||
<div style={{fontSize:"0.72rem",color:walletReport.health.color,fontWeight:700,marginBottom:4}}>
|
||||
{walletReport.health.band==="SIN ACTIVIDAD"?"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"}
|
||||
{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>
|
||||
{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"}
|
||||
<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.69rem",cursor:"pointer",fontWeight:700}}>
|
||||
⌕ Buscar el tipo en mi nodo
|
||||
</button>)}
|
||||
{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>; })()}
|
||||
<div style={{display:"flex",gap:16,marginTop:8}}>
|
||||
{(()=>{ 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,rowGap:8,flexWrap:"wrap",marginTop:8}}>
|
||||
{[
|
||||
{label:"Transacciones",v:walletReport.totalTxs},
|
||||
{label:"Direcciones usadas",v:walletReport.activeCount},
|
||||
{label:"Reutilizadas",v:walletReport.reusedAddrs.length,warn:walletReport.reusedAddrs.length>0},
|
||||
{label:"Grupos vinculados",v:walletReport.clusters.length,warn:walletReport.clusters.length>0},
|
||||
// Sin actividad, «0 reutilizadas» y «0 grupos» no son un resultado: no se ha medido nada.
|
||||
{label:"Reutilizadas",v:walletReport.sinNota?"—":walletReport.reusedAddrs.length,warn:walletReport.reusedAddrs.length>0},
|
||||
{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>
|
||||
))}
|
||||
@@ -603,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>
|
||||
)}
|
||||
@@ -619,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>
|
||||
)}
|
||||
@@ -658,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)));
|
||||
@@ -667,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>
|
||||
);
|
||||
@@ -694,8 +787,8 @@
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{walletReport.clusters.length===0&&walletReport.health.band!=="SIN ACTIVIDAD"&&(
|
||||
<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}}>
|
||||
{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.69rem",color:C.green,fontFamily:C.mono}}>
|
||||
✓ Ninguna transacción une tus direcciones entre sí (en las {walletReport.totalTxs} analizadas).
|
||||
</div>
|
||||
)}
|
||||
@@ -703,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;
|
||||
@@ -714,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. */}
|
||||
@@ -739,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>
|
||||
)}
|
||||
|
||||
@@ -749,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>
|
||||
@@ -775,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>
|
||||
)}
|
||||
@@ -783,11 +876,14 @@
|
||||
)}
|
||||
|
||||
<Card>
|
||||
<div style={{fontSize:"0.62rem",color:C.t2,fontFamily:C.mono,marginBottom:10}}>ANALIZAR TRANSACCIÓN · pega su txid</div>
|
||||
<div style={{display:"flex",gap:8}}>
|
||||
<div style={{fontSize:"0.69rem",color:C.t2,fontFamily:C.mono,marginBottom:10}}>ANALIZAR TRANSACCIÓN · pega su txid</div>
|
||||
{/* v2.1.1 (U6): el campo encoge (minWidth:0) y la fila salta de línea.
|
||||
Antes el campo no bajaba de su ancho natural y el botón se salía
|
||||
de la tarjeta; en un móvil de 320 px se ensanchaba la página. */}
|
||||
<div data-fila-txid="1" style={{display:"flex",gap:8,flexWrap:"wrap"}}>
|
||||
<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)"
|
||||
style={{flex:1,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"11px 14px",color:C.t1,fontFamily:C.mono,fontSize:"0.78rem",outline:"none"}}
|
||||
style={{flex:"1 1 150px",minWidth:0,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"11px 14px",color:C.t1,fontFamily:C.mono,fontSize:"0.78rem",outline:"none"}}
|
||||
onFocus={e=>e.target.style.borderColor=C.purple} onBlur={e=>e.target.style.borderColor=C.borderBright}
|
||||
/>
|
||||
<BotonQR campo="txid" onLeido={v=>setQuery(v)}/>
|
||||
@@ -799,7 +895,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>
|
||||
@@ -815,8 +911,8 @@
|
||||
</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}}>
|
||||
⌂ {v.label}. {v.detail.replace(/^Se han traído de tu nodo [^.]*\. /,"")}
|
||||
<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&&(
|
||||
<div style={{fontSize:"0.7rem",color:C.amber,fontFamily:C.mono,padding:"2px 4px"}}>
|
||||
@@ -827,10 +923,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>
|
||||
@@ -843,7 +939,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}/>
|
||||
@@ -852,7 +948,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);
|
||||
@@ -860,10 +956,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
@@ -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>
|
||||
|
||||
@@ -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
@@ -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."}
|
||||
|
||||
+17
-17
@@ -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,11 +147,11 @@
|
||||
|
||||
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={{display:"flex",gap:8,marginBottom:12}}>
|
||||
<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,flexWrap:"wrap",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"
|
||||
style={{flex:1,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none"}}
|
||||
style={{flex:"1 1 150px",minWidth:0,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none"}}
|
||||
onFocus={e=>e.target.style.borderColor=C.blue} onBlur={e=>e.target.style.borderColor=C.borderBright}
|
||||
/>
|
||||
<BotonQR campo="direccion" color={C.blue} onLeido={v=>setAddr(v)}/>
|
||||
@@ -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,12 +217,12 @@
|
||||
|
||||
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={{display:"flex",gap:8,marginBottom:12}}>
|
||||
<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,flexWrap:"wrap",marginBottom:12}}>
|
||||
<input value={txid} onChange={e=>setTxid(filtrarSecreto(e.target.value))} onKeyDown={e=>e.key==="Enter"&&decode()}
|
||||
placeholder="txid de una transacción"
|
||||
style={{flex:1,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none"}}
|
||||
style={{flex:"1 1 150px",minWidth:0,background:C.bg,border:`1px solid ${C.borderBright}`,borderRadius:6,padding:"9px 12px",color:C.t1,fontFamily:C.mono,fontSize:"0.75rem",outline:"none"}}
|
||||
onFocus={e=>e.target.style.borderColor=C.blue} onBlur={e=>e.target.style.borderColor=C.borderBright}
|
||||
/>
|
||||
<BotonQR campo="txid" color={C.blue} onLeido={v=>setTxid(v)}/>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
+13
-13
@@ -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>
|
||||
);
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<Paso n={4}><B>Entra siempre por https.</B> Para calcular tus direcciones a partir de la xpub, la app usa la criptografía del navegador, que solo funciona en páginas seguras.</Paso>
|
||||
<H>Las cuatro cosas que se pueden hacer</H>
|
||||
<Li><B>Auditar una transacción</B> — pegas su identificador (txid: en tu monedero, en el detalle del movimiento) y ves qué revela de quien la hizo. En Analizar → Auditar privacidad.</Li>
|
||||
<Li><B>Revisar mi wallet</B> — pegas tu clave pública extendida (xpub o zpub, nunca la semilla; en Sparrow: Settings → Keystore → Master Public Key; en otros monederos suele estar en la información de la cuenta, como «clave pública extendida» o «xpub») y la app marca qué direcciones son tuyas y cómo están vinculadas entre sí, y te deja simular qué revelaría un gasto antes de hacerlo. En la misma pantalla.</Li>
|
||||
<Li><B>Revisar mi wallet</B> — pegas el descriptor de tu wallet o su clave pública extendida (xpub o zpub, nunca la semilla; en Sparrow: Settings → Keystore → Master Public Key; en otros monederos suele estar en la información de la cuenta, como «clave pública extendida» o «xpub») y la app marca qué direcciones son tuyas y cómo están vinculadas entre sí, y te deja simular qué revelaría un gasto antes de hacerlo. En la misma pantalla.</Li>
|
||||
<Li><B>Explorar la cadena</B> — buscas una dirección, un bloque o una transacción. En Analizar → Explorar la cadena.</Li>
|
||||
<Li><B>Seguimiento de fondos</B> — hacia atrás (<B>Procedencia</B>: de dónde vino) o hacia delante (<B>Destino</B>: a dónde fue, por ejemplo tras un robo o una pérdida). En la pestaña Seguimiento.</Li>
|
||||
<H>Si ves datos de ejemplo</H>
|
||||
@@ -114,7 +114,7 @@
|
||||
<Section id="auditar" title="Analizar → Auditar privacidad" accent={C.purple}>
|
||||
<H color={C.purple}>Qué se puede hacer</H>
|
||||
<Li><B>Analizar una transacción</B> — por su txid. Se ve el resultado de privacidad, su estado (bloque, comisión, tarifa, tamaño) y, al final, un acceso a su procedencia (ver «Seguimiento de fondos»).</Li>
|
||||
<Li><B>Cargar tu wallet (solo lectura)</B> — con la clave pública extendida (xpub/zpub; en Sparrow: Settings → Keystore → Master Public Key). Calcula tus direcciones SegWit nativas (<B>bc1q…</B>), Taproot (<B>bc1p…</B>), SegWit anidadas (<B>3…</B>) o antiguas (<B>1…</B>), según el prefijo de la clave (zpub, ypub, xpub) o lo que elijas. Una wallet Taproot no tiene prefijo propio: su clave empieza por xpub y el tipo lo eliges tú, o pegas su descriptor tr(…), o lees el QR de la cuenta, que ya lo dice. Necesita https. El xpub no sale del navegador, pero para saber qué pasó con cada dirección hay que preguntar al nodo por ella: si el nodo no es tuyo, quien lo opera puede ver tu wallet entera.</Li>
|
||||
<Li><B>Cargar tu wallet (solo lectura)</B> — con la clave pública extendida (xpub/zpub; en Sparrow: Settings → Keystore → Master Public Key). Calcula tus direcciones SegWit nativas (<B>bc1q…</B>), Taproot (<B>bc1p…</B>), SegWit anidadas (<B>3…</B>) o antiguas (<B>1…</B>), según el prefijo de la clave (zpub, ypub, xpub) o lo que elijas. Lo más seguro es pegar el <B>descriptor</B>, que dice él mismo el tipo. Una xpub suelta no lo dice (y una wallet Taproot no tiene prefijo propio: su clave empieza por xpub): el tipo lo eliges tú, o pulsas <B>«Buscar el tipo en mi nodo»</B>, que pregunta por las primeras 15 direcciones de cada uno de los cuatro tipos (60 consultas) y te dice en cuál hay movimientos. Es una propuesta: quien confirma eres tú, comparando la recepción 0 con la de tu wallet. Si ninguna dirección calculada tiene movimientos, el informe no pone nota: sin actividad no hay nada que medir. Necesita https. El xpub no sale del navegador, pero para saber qué pasó con cada dirección hay que preguntar al nodo por ella: si el nodo no es tuyo, quien lo opera puede ver tu wallet entera.</Li>
|
||||
<Li><B>…o con su descriptor</B> — en el mismo campo vale el descriptor de salida de la wallet. En <B>Sparrow</B>: File → Export Wallet → Output Descriptor; guarda un archivo de texto que empieza por «# Receive and change descriptor:» y sigue con wpkh([…, y pegas el archivo entero (las líneas que empiezan por # se ignoran). En <B>Bitcoin Core</B>: <span style={{fontFamily:C.mono}}>listdescriptors</span> (sin «true», que sacaría las claves privadas) y copias las dos líneas «desc» del tipo de tu wallet, recepción (/0/*) y cambio (/1/*); se juntan solas si son de la misma clave. Se aceptan <B>wpkh(…)</B> (bc1q…), <B>tr(…)</B> de una sola clave (Taproot, bc1p…), <B>sh(wpkh(…))</B> (3…) y <B>pkh(…)</B> (1…), con o sin origen [huella/ruta], terminados en /0/*, /1/* o /<0;1>/* (las dos ramas). El tipo de dirección lo dice el descriptor, no el prefijo de la clave. Si trae suma de verificación (#…), se comprueba y un carácter mal copiado se rechaza; si no la trae, se carga y se avisa. Todavía <B>no</B> se pueden cargar multifirma o miniscript (wsh(…), sortedmulti…) ni el Taproot con árbol de scripts (un tr(…) que lleva algo más que la clave). Si lo pegado lleva una clave privada (xprv, WIF) o una semilla, se borra sin procesarla. Y una clave de red de pruebas no se deriva en mainnet, ni al revés.</Li>
|
||||
<Li><B>Importar etiquetas</B> — el archivo de etiquetas de Sparrow (File → Export → Export Labels, formato BIP-329). Se lee en el navegador y no sale de él.</Li>
|
||||
<Li><B>Informe de wallet</B> — direcciones reutilizadas, grupos de direcciones vinculadas, polvo recibido, movimientos entre tus propias direcciones y la nota de cada transacción.</Li>
|
||||
@@ -152,7 +152,7 @@
|
||||
<Chk nombre="Entradas en formato antiguo (direcciones 1… o 3…)" cert="CERTEZA" efecto="resta 15">Cada vez menos gente usa esos formatos, así que hay menos transacciones parecidas entre las que pasar desapercibido.</Chk>
|
||||
<Chk nombre="Salidas que vuelven a una dirección que gasta" cert="CERTEZA" efecto="resta 20 (no se suma a la del cambio)">Mandar dinero de vuelta a la dirección de la que sale la deja reutilizada a la vista de todos.</Chk>
|
||||
<H color={C.purple}>Lo que decidieron otros (no resta)</H>
|
||||
<Chk nombre="Pago por lotes (muchos destinatarios a la vez)" cert="PROBABLE" efecto="exposición">Cinco salidas o más, casi todas de importes distintos: un exchange o servicio pagando a muchos a la vez.</Chk>
|
||||
<Chk nombre="Pago por lotes (muchos destinatarios a la vez)" cert="PROBABLE" efecto="exposición">Cinco salidas o más, casi todas de importes distintos, o pagos a veinte direcciones distintas o más: un exchange o servicio pagando a muchos a la vez. Es el mismo criterio cuando se mira de dónde viene una entrada («Una entrada viene de un pago por lotes»).</Chk>
|
||||
<Chk nombre="Datos escritos en la cadena (OP_RETURN)" cert="CERTEZA" efecto="exposición">La transacción lleva datos de algún protocolo. Se dice el tamaño, no el contenido.</Chk>
|
||||
<Chk nombre="Salidas por debajo del mínimo de la red («polvo») / Salida muy pequeña (posible envío de polvo)" cert="CERTEZA / POSIBLE" efecto="exposición">Salidas por debajo de lo que la red considera rentable gastar (certeza), o de menos de 1.000 sat (posible envío de polvo).</Chk>
|
||||
<H color={C.purple}>Informativas (no restan)</H>
|
||||
@@ -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
@@ -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>
|
||||
|
||||
+7
-1
@@ -470,7 +470,13 @@ const server = http.createServer(async (req, res) => {
|
||||
// Solo lectura: cualquier otro método se rechaza.
|
||||
if (req.method !== "GET") { res.writeHead(405); return res.end(JSON.stringify({ error: "Solo GET" })); }
|
||||
|
||||
const url = new URL(req.url, `http://${req.headers.host || "localhost"}`);
|
||||
// La base es fija: solo hace falta para separar la ruta de los parámetros.
|
||||
// Hasta la v2.1.0 se montaba con la cabecera Host de la petición, fuera de
|
||||
// todo try: un Host mal formado («a b», «[») hacía saltar new URL y tumbaba
|
||||
// el servicio entero (systemd lo levantaba a los 5 s).
|
||||
let url;
|
||||
try { url = new URL(req.url, "http://localhost"); }
|
||||
catch { res.writeHead(400); return res.end(JSON.stringify({ error: "Bad request" })); }
|
||||
const handler = routes[url.pathname];
|
||||
|
||||
if (!handler) {
|
||||
|
||||
@@ -47,6 +47,15 @@ node tests/test33.js # «¿Qué revelaría este gasto?»: transacción simulada
|
||||
node tests/test34.js # entropía de Boltzmann: casos a mano (1 entrada, 2×2 iguales = 3), fuerza bruta independiente hasta 5×5 (1.496 = Whirlpool), matriz coherente, OP_RETURN fuera, coinbase no; 9×9 y 40×60 → completo:false al instante, 8×8 iguales < 2 s, corte por maxMs y maxCombinaciones
|
||||
node tests/test35.js # dibujo del flujo: alto proporcional al importe, mínimo para el polvo, «+N más» con su suma, cambio y pago desde change_detection, OP_RETURN, vuelta a la misma dirección, numeración desde 0, coinbase como monedas nuevas, simulación, wallet, entidades y enlaces seguros de Boltzmann; marcas que no se inventan
|
||||
node tests/test49.js # Taproot de una sola clave (v2.1.0): bech32m (BIP350), el retoque de la clave (BIP341), los vectores oficiales de BIP86, descriptores tr(…), la xpub suelta con «Taproot» elegido, lo que sigue sin cargarse (árbol de scripts, rawtr, multi_a) y lo que consume el tipo: simulador e informe de wallet con direcciones bc1p
|
||||
node tests/test50.js # v2.1.1 (S1): el servicio de métricas no se cae con una cabecera Host mal formada (con un http de mentira: sin puerto ni comandos)
|
||||
node tests/test51.js # v2.1.1 (F2): un salto atrás no afirma nada de las entradas que no se pudieron mirar
|
||||
node tests/test52.js # v2.1.1 (F1): un solo criterio para «pago por lotes»; directo y a un salto dicen lo mismo de todas las transacciones de prueba
|
||||
node tests/test53.js # v2.1.1 (X1): el tipo de una xpub suelta por su actividad (vectores de BIP 44, 84 y 86, nodo de mentira), sin actividad no hay nota, prefijo a la vista
|
||||
node tests/test54.js # v2.1.1 (U5): con un nodo configurado nunca llegan datos de ejemplo; las pantallas ponen rayas
|
||||
node tests/test55.js # v2.1.1 (U1): la letra de datos es IBM Plex Mono
|
||||
node tests/test56.js # v2.1.1 (U2): suelo de letra (11 px etiquetas, 13 px explicaciones) en todos los estilos de src/
|
||||
node tests/test57.js # v2.1.1 (U6): las filas de campo y botón caben en un móvil; el simulador se pliega sin wallet
|
||||
node tests/test58.js # v2.1.1 (U3): el gris tenue llega a 4,5:1 en los cuatro temas (fórmula de WCAG)
|
||||
node tests/test48.js # auditoría en caliente (1-nov): dirección mal copiada o de la red de pruebas, alturas de 7 cifras y futuras, hash desconocido, sin «a medias» por lo escrito, conversor que no se inventa números, CORS fuera de /api/, integrity de React, OP_RETURN sin txid
|
||||
```
|
||||
|
||||
|
||||
+4
-4
@@ -88,7 +88,7 @@ const MAIN = "https://nodo:4083", SIG = "https://nodo:4083/signet-tor";
|
||||
ok("apiGetJson conserva su guarda (no llega ni al fetch)", e && e.bloqueado && pedidas.length === 0);
|
||||
}
|
||||
|
||||
console.log("\n=== Datos de ejemplo marcados aunque el nodo conteste 4xx (A1-03) ===\n");
|
||||
console.log("\n=== Lo que el nodo no da queda marcado aunque conteste 4xx (A1-03; desde la v2.1.1, sin datos de ejemplo) ===\n");
|
||||
{
|
||||
const { R } = capaDeRed(url => /fee-rates|address\/x/.test(url) ? 404 : /mempool$/.test(url) ? 403 : 200);
|
||||
const { get } = R.useApi(MAIN);
|
||||
@@ -98,9 +98,9 @@ const MAIN = "https://nodo:4083", SIG = "https://nodo:4083/signet-tor";
|
||||
const d3 = await get("/api/v1/fees/recommended", MOCK);
|
||||
const vacio = await get("/api/address/x/txs", []);
|
||||
const salud = R.useNodeHealth(MAIN);
|
||||
ok("un 404 que devuelve datos de ejemplo → esEjemplo() lo dice", d1 === MOCK && salud.esEjemplo("/api/v1/mining/blocks/fee-rates/1w"));
|
||||
ok("un 403 igual", d2 === MOCK && salud.esEjemplo("/api/mempool"));
|
||||
ok("…y una respuesta buena de la misma familia /api/v1 no queda marcada", d3 !== MOCK && !salud.esEjemplo("/api/v1/fees/recommended"));
|
||||
ok("un 404 donde se esperaban datos → queda marcado «sin datos» (v2.1.1: ya no se devuelve el ejemplo)", d1 === null && salud.esEjemplo("/api/v1/mining/blocks/fee-rates/1w") && salud.sinDatos("/api/v1/mining/blocks/fee-rates/1w"));
|
||||
ok("un 403 igual", d2 === null && salud.sinDatos("/api/mempool"));
|
||||
ok("…y una respuesta buena de la misma familia /api/v1 no queda marcada", d3 !== MOCK && d3 !== null && !salud.esEjemplo("/api/v1/fees/recommended") && !salud.sinDatos("/api/v1/fees/recommended"));
|
||||
ok("un 4xx no cuenta como «nodo caído» (el aviso global no salta)", salud.fallos.size === 0);
|
||||
ok("una lista vacía no es «dato de ejemplo»: no se marca", Array.isArray(vacio) && !salud.sustituidos.has("/api/address/x/txs"));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
// v2.1.1 — S1 de la auditoría del 10-nov-2026: el servicio de métricas se
|
||||
// caía con una cabecera Host mal formada. La dirección de cada petición se
|
||||
// montaba con `new URL(req.url, "http://" + Host)` fuera de todo try, y el
|
||||
// manejador es asíncrono: la excepción quedaba sin recoger y Node cerraba el
|
||||
// proceso. Ahora la base es fija y una ruta imposible se contesta con 400.
|
||||
//
|
||||
// La prueba carga system-metrics.js con un `http` de mentira: no abre ningún
|
||||
// puerto, no ejecuta ningún comando y no toca Bitcoin Core.
|
||||
//
|
||||
// Uso: node tests/test50.js
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const src = fs.readFileSync(path.join(__dirname, "..", "system-metrics.js"), "utf8").replace(/^#!.*\n/, "");
|
||||
|
||||
let manejador = null;
|
||||
const httpFalso = { createServer: h => { manejador = h; return { listen() {} }; }, request() { throw new Error("la prueba no debe llamar a Bitcoin Core"); } };
|
||||
const requireFalso = m => m === "http" ? httpFalso : m === "child_process" ? { exec() { throw new Error("la prueba no debe ejecutar comandos"); } } : require(m);
|
||||
new Function("require", "process", "console", src)(requireFalso, { env: {}, platform: process.platform, uptime: () => 0 }, { log() {}, error() {}, warn() {} });
|
||||
|
||||
let pass = 0, fail = 0;
|
||||
const ok = (n, c, x) => { console.log(` ${c ? "✓" : "✗"} ${n}`); if (!c && x !== undefined) console.log(" " + JSON.stringify(x)); c ? pass++ : fail++; };
|
||||
|
||||
const pedir = async (url, host, method = "GET") => {
|
||||
const r = { estado: null, cuerpo: null, error: null };
|
||||
const res = { setHeader() {}, writeHead(c) { r.estado = c; }, end(b) { r.cuerpo = b; } };
|
||||
try { await manejador({ url, method, headers: host === undefined ? {} : { host } }, res); }
|
||||
catch (e) { r.error = e.message; }
|
||||
return r;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
console.log("=== S1. Una cabecera Host mal formada no tumba el servicio ===\n");
|
||||
ok("el servicio se carga sin abrir puerto", typeof manejador === "function");
|
||||
for (const host of ["a b", "[", "exa mple.com:99999", "::::", "", "%%%"]) {
|
||||
const r = await pedir("/no-existe", host);
|
||||
ok(`Host «${host}» → se contesta (404), sin excepción`, r.error === null && r.estado === 404, r);
|
||||
}
|
||||
const sin = await pedir("/no-existe", undefined);
|
||||
ok("sin cabecera Host → 404, sin excepción", sin.error === null && sin.estado === 404, sin);
|
||||
const normal = await pedir("/no-existe?x=1", "127.0.0.1:4082");
|
||||
ok("Host normal → 404 para una ruta que no existe (como antes)", normal.error === null && normal.estado === 404, normal);
|
||||
const post = await pedir("/system/info", "a b", "POST");
|
||||
ok("otro método → 405 (como antes)", post.error === null && post.estado === 405, post);
|
||||
const mala = await pedir("//[", "127.0.0.1:4082");
|
||||
ok("ruta imposible de leer → 400, sin excepción", mala.error === null && mala.estado === 400, mala);
|
||||
ok("la base de la URL ya no depende de la petición", !/new URL\([^)]*headers/.test(src) && /new URL\(req\.url, "http:\/\/localhost"\)/.test(src));
|
||||
|
||||
console.log(`\n${pass} ✓ · ${fail} ✗`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
})();
|
||||
@@ -0,0 +1,98 @@
|
||||
// v2.1.1 — F2 de la auditoría del 10-nov-2026: «Mirado un salto: de dónde
|
||||
// vienen 0 de N entradas» seguía con «No añaden nada especial: ni mezclas, ni
|
||||
// pelado, ni lotes, ni minado» y la etiqueta CERTEZA. Si no se pudo mirar
|
||||
// nada, no hay nada que «no añada»: era un hueco en los datos leído como un
|
||||
// dato. Ahora cada frase habla solo de lo que se trajo del nodo.
|
||||
//
|
||||
// Uso: node tests/test51.js
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const lines = require("./fuente.js")().split("\n");
|
||||
const cut = (desde, hasta) => {
|
||||
const s = lines.findIndex(l => l.includes(desde));
|
||||
const e = lines.findIndex((l, i) => i > s && l.includes(hasta));
|
||||
if (s === -1 || e === -1) { console.error(`No se localiza «${desde}» en el código de la app`); process.exit(1); }
|
||||
return lines.slice(s, e).join("\n");
|
||||
};
|
||||
const E = new Function(`const C = { green:"g", amber:"a", red:"r", t1:"t1", t2:"t", blue:"b", purple:"p" };
|
||||
const ENTITY_INDEX = new Map(); const OFAC_SET = new Set();
|
||||
${cut("// ── FORMATO: lógica pura", "// ── fin formato")}
|
||||
${cut("function detectWallets", "function analyzeAddress")}
|
||||
return { analyzeTx };`)();
|
||||
const leer = f => JSON.parse(fs.readFileSync(path.join(__dirname, "fixtures", f), "utf8"));
|
||||
const F = leer("vecinas-26oct.json"), X = leer("especiales-26oct.json").txs;
|
||||
const T = F.txs, caso = k => T[F.casos[k]];
|
||||
const padresDe = (tx, quitar = 0) => { const p = {}; tx.vin.slice(quitar).forEach(v => { if (T[v.txid]) p[v.txid] = T[v.txid]; }); return p; };
|
||||
|
||||
let pass = 0, fail = 0;
|
||||
const ok = (n, c, x) => { console.log(` ${c ? "✓" : "✗"} ${n}`); if (!c && x !== undefined) console.log(" " + JSON.stringify(x)); c ? pass++ : fail++; };
|
||||
const vec = a => a.checks.find(c => c.id === "vecinas");
|
||||
const AFIRMA = /No añaden|no añade nada|ni mezclas|ni pelado|ni lotes|ni minado/;
|
||||
|
||||
console.log("=== 1. Sin ninguna entrada mirada no se afirma nada ===\n");
|
||||
{
|
||||
const t = caso("postmix_juntas4");
|
||||
const a = E.analyzeTx(t, { vecinas: { padres: {}, siguientes: {} } });
|
||||
const v = vec(a);
|
||||
ok("4 entradas, 0 traídas: hay aviso, y dice que no se pudo mirar ninguna", !!v && v.label === "Un salto atrás: no se pudo mirar ninguna entrada", v && v.label);
|
||||
ok("…sin la etiqueta CERTEZA (sale como SIN DATOS)", v && v.certainty === null && v.sinDatos === true, v && v.certainty);
|
||||
ok("…y sin «No añaden nada especial», «ni mezclas», «ni lotes»…", v && !AFIRMA.test(v.label + " " + v.detail), v && v.detail);
|
||||
ok("…dice que de un salto atrás no se sabe nada", v && /no se sabe nada/.test(v.detail));
|
||||
ok("…ya no dice «0 de 4»", v && !/\b0 de\b/.test(v.label + v.detail));
|
||||
ok("…no resta ni cambia la nota respecto a no mirar", a.score === E.analyzeTx(t).score && v.penalty === 0 && v.informational === true);
|
||||
ok("…y no aparece ninguna señal de vecinas inventada", !a.checks.some(c => ["postmix", "origen_lote", "origen_minado", "pelado_salto", "origen_entidad"].includes(c.id)));
|
||||
const s = caso("postmix_sola");
|
||||
const v1 = vec(E.analyzeTx(s, { vecinas: { padres: {}, siguientes: {} } }));
|
||||
ok("1 entrada, 0 traídas: en singular («no se pudo mirar la entrada»)", v1 && v1.label === "Un salto atrás: no se pudo mirar la entrada" && /de la que viene la entrada/.test(v1.detail) && !/las 1 entradas/.test(v1.detail), v1 && v1.label);
|
||||
}
|
||||
|
||||
console.log("\n=== 2. Lo que sí se miró se sigue diciendo igual ===\n");
|
||||
{
|
||||
const t = caso("lote_origen");
|
||||
const j = caso("postmix_juntas4");
|
||||
const todo = vec(E.analyzeTx(t, { vecinas: { padres: padresDe(t), siguientes: {} } }));
|
||||
ok("todas traídas: «Mirado un salto: de dónde vienen N de N entradas», con CERTEZA", todo && new RegExp(`^Mirado un salto: de dónde vienen ${t.vin.length} de ${t.vin.length} entradas$`).test(todo.label) && todo.certainty === "CERTEZA", todo && todo.label);
|
||||
ok("…y empieza por «Se han traído de tu nodo…» (la pantalla quita esa frase)", /^Se han traído de tu nodo las transacciones de las que vienen todas las entradas\. /.test(todo.detail));
|
||||
// Padres «sosos» hechos a mano: una entrada y unas pocas salidas de dos
|
||||
// importes (ni lote, ni mezcla, ni minado): nada que contar.
|
||||
const soso = v => ({ txid: v.txid, version: 2, locktime: 0, status: { confirmed: true, block_height: 800000 },
|
||||
vin: [{ txid: "11".repeat(32), vout: 0, is_coinbase: false, sequence: 4294967293, prevout: { scriptpubkey_type: "v0_p2wpkh", scriptpubkey_address: "bc1qsoso", scriptpubkey: "0014" + "22".repeat(20), value: 9000000 } }],
|
||||
vout: Array.from({ length: v.vout + 3 }, (_, k) => ({ scriptpubkey_type: "v0_p2wpkh", scriptpubkey_address: "bc1qsoso" + k, scriptpubkey: "0014" + "33".repeat(20), value: k % 2 ? 1234567 : 2345678 })) });
|
||||
const sosos = (tx, n) => Object.fromEntries(tx.vin.slice(0, n).map(v => [v.txid, soso(v)]));
|
||||
const limpia = vec(E.analyzeTx(j, { vecinas: { padres: sosos(j, 4), siguientes: {} } }));
|
||||
ok("todo mirado y sin nada que contar: «No añaden nada especial: ni mezclas, ni pelado, ni lotes, ni minado.» (como antes)", limpia && /No añaden nada especial: ni mezclas, ni pelado, ni lotes, ni minado\.$/.test(limpia.detail), limpia && limpia.detail);
|
||||
const media = vec(E.analyzeTx(j, { vecinas: { padres: sosos(j, 2), siguientes: {} } }));
|
||||
ok("2 de 4 miradas y sin nada que contar: «Lo mirado no añade…», no «No añaden» de todas", media && /Lo mirado no añade nada especial/.test(media.detail) && !/No añaden/.test(media.detail) && /no se pudo mirar no se supone/.test(media.detail), media && media.detail);
|
||||
const parcial = vec(E.analyzeTx(j, { vecinas: { padres: padresDe(j, 3), siguientes: {} } }));
|
||||
ok("1 de 4 traídas: «1 de 4» y «lo que no se pudo mirar no se supone»", parcial && /vienen 1 de 4 entradas/.test(parcial.label) && /no se pudo mirar no se supone/.test(parcial.detail), parcial && parcial.label);
|
||||
}
|
||||
|
||||
console.log("\n=== 3. Solo salidas miradas: no se habla de las entradas ===\n");
|
||||
{
|
||||
const ap = X.ln_apertura_generica, i = ap.vout.findIndex(o => o.scriptpubkey_type === "v0_p2wsh");
|
||||
const con = vec(E.analyzeTx(ap, { vecinas: { padres: {}, siguientes: { [i]: X.ln_cierre_cooperativo } } }));
|
||||
ok("canal visto por su cierre, 0 entradas traídas: lo cuenta", con && /abrió un canal Lightning/.test(con.detail) && con.certainty === "CERTEZA");
|
||||
ok("…la etiqueta dice que de las entradas no se pudo mirar", con && /quién gastó 1 salida/.test(con.label) && /no se pudo mirar/.test(con.label) && !/\b0 de\b/.test(con.label), con && con.label);
|
||||
ok("…y que de las entradas no se sabe nada", con && /no se sabe nada/.test(con.detail) && !/ni mezclas/.test(con.detail), con && con.detail);
|
||||
const otra = vec(E.analyzeTx(ap, { vecinas: { padres: {}, siguientes: { [i]: X.bip47_1 } } }));
|
||||
ok("salida mirada sin nada que contar: «no se ve ningún canal», y nada de mezclas ni lotes", otra && /no se ve ningún canal/.test(otra.detail) && !/ni mezclas|ni lotes|ni minado|ni pelado/.test(otra.detail), otra && otra.detail);
|
||||
ok("…empieza por «Se ha traído de tu nodo…»", otra && /^Se ha traído de tu nodo quién gastó una salida\. /.test(otra.detail));
|
||||
}
|
||||
|
||||
console.log("\n=== 4. Monedas nuevas: no hay nada que mirar ===\n");
|
||||
{
|
||||
const cb = JSON.parse(fs.readFileSync(path.join(__dirname, "fixtures", "reales", "coinbase-6c7edc23.json"), "utf8"));
|
||||
const a = E.analyzeTx(cb, { vecinas: { padres: {}, siguientes: {} } });
|
||||
ok("una recompensa de minado no dice «no se pudo mirar» (no hay de dónde venir)", !vec(a), vec(a) && vec(a).label);
|
||||
}
|
||||
|
||||
console.log("\n=== 5. La pantalla y el informe ===\n");
|
||||
{
|
||||
const src = fs.readFileSync(path.join(__dirname, "..", "src", "50-pestana-auditoria.jsx"), "utf8");
|
||||
ok("la pantalla quita «Se ha traído…» y «Se han traído…»", /Se han\? traído de tu nodo/.test(src));
|
||||
const inf = fs.readFileSync(path.join(__dirname, "..", "src", "22-informe-privacidad.jsx"), "utf8");
|
||||
ok("el informe en Markdown escribe SIN DATOS, no «null»", /c\.certainty \|\| "SIN DATOS"/.test(inf));
|
||||
}
|
||||
|
||||
console.log(`\n${pass} ✓ · ${fail} ✗`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
// v2.1.1 — F1 de la auditoría del 10-nov-2026: dos varas de medir para «pago
|
||||
// por lotes». Analizada directamente, una transacción solo era lote si casi
|
||||
// todos sus importes eran distintos; vista como origen de otra, bastaba con
|
||||
// 20 salidas. La misma transacción real (0b875761…, 1 → 133 salidas a 133
|
||||
// direcciones, con importes repetidos) era «No es un pago por lotes», con
|
||||
// «exposición ninguna», y a un salto «viene de un pago por lotes».
|
||||
//
|
||||
// Ahora hay un solo criterio (formaDeLote) y el origen se lo pregunta al
|
||||
// mismo analizador: directo y a un salto tienen que decir lo mismo de
|
||||
// cualquier transacción.
|
||||
//
|
||||
// Uso: node tests/test52.js
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const lines = require("./fuente.js")().split("\n");
|
||||
const cut = (desde, hasta) => {
|
||||
const s = lines.findIndex(l => l.includes(desde));
|
||||
const e = lines.findIndex((l, i) => i > s && l.includes(hasta));
|
||||
if (s === -1 || e === -1) { console.error(`No se localiza «${desde}» en el código de la app`); process.exit(1); }
|
||||
return lines.slice(s, e).join("\n");
|
||||
};
|
||||
const E = new Function(`const C = { green:"g", amber:"a", red:"r", t1:"t1", t2:"t", blue:"b", purple:"p" };
|
||||
const ENTITY_INDEX = new Map(); const OFAC_SET = new Set();
|
||||
${cut("// ── FORMATO: lógica pura", "// ── fin formato")}
|
||||
${cut("function detectWallets", "function analyzeAddress")}
|
||||
return { analyzeTx, formaDeLote };`)();
|
||||
const leer = f => JSON.parse(fs.readFileSync(path.join(__dirname, "fixtures", f), "utf8"));
|
||||
const F = leer("vecinas-26oct.json"), X = leer("especiales-26oct.json").txs, T = F.txs;
|
||||
const REALES = ["batch-payment", "coinbase-6c7edc23", "joinmarket-coinjoin", "op-return-charley", "whirlpool-ashigaru", "whirlpool-coinjoin"].map(n => leer(path.join("reales", n + ".json")));
|
||||
|
||||
let pass = 0, fail = 0;
|
||||
const ok = (n, c, x) => { console.log(` ${c ? "✓" : "✗"} ${n}`); if (!c && x !== undefined) console.log(" " + JSON.stringify(x)); c ? pass++ : fail++; };
|
||||
const ch = (a, id) => a.checks.find(c => c.id === id);
|
||||
|
||||
// Transacciones hechas a mano.
|
||||
const IN = (v, a, id) => ({ txid: id || "aa".repeat(32), vout: 0, sequence: 0xfffffffd, is_coinbase: false, prevout: { value: v, scriptpubkey_type: "v0_p2wpkh", scriptpubkey_address: a, scriptpubkey: "0014" + "22".repeat(20) } });
|
||||
const OUT = (v, a) => ({ value: v, scriptpubkey_type: "v0_p2wpkh", scriptpubkey_address: a, scriptpubkey: "0014" + "11".repeat(20) });
|
||||
const TX = (vin, vout, id = "ff".repeat(32)) => ({ txid: id, version: 2, vin, vout, weight: 800, fee: 2000, locktime: 0, status: { confirmed: true, block_height: 870000 } });
|
||||
// Una transacción que gasta la salida 0 de `padre`, y su análisis con ese padre a la vista.
|
||||
const hija = padre => TX([IN(padre.vout[0].value, padre.vout[0].scriptpubkey_address || "bc1qsin", padre.txid)], [OUT(1000, "bc1qh1"), OUT(padre.vout[0].value - 3000, "bc1qh2")], "ee".repeat(32));
|
||||
const aUnSalto = padre => !!ch(E.analyzeTx(hija(padre), { vecinas: { padres: { [padre.txid]: padre }, siguientes: {} } }), "origen_lote");
|
||||
const directo = t => !!E.analyzeTx(t).lote;
|
||||
const esLoteCheck = t => ch(E.analyzeTx(t), "batch_payment").pass === false;
|
||||
|
||||
console.log("=== 1. El caso real de la auditoría: 1 → 133 salidas con importes repetidos ===\n");
|
||||
{
|
||||
const p = Object.values(T).find(t => t.txid.startsWith("0b875761"));
|
||||
ok("es la del informe: 1 entrada, 133 salidas a 133 direcciones, importes que se repiten", !!p && p.vin.length === 1 && p.vout.length === 133 && new Set(p.vout.map(o => o.scriptpubkey_address)).size === 133 && new Set(p.vout.map(o => o.value)).size / 133 < 0.8);
|
||||
const a = E.analyzeTx(p), b = ch(a, "batch_payment");
|
||||
ok("analizada directamente: «Pago por lotes» (antes: «No es un pago por lotes»)", b.pass === false && /^Pago por lotes/.test(b.label) && b.certainty === "PROBABLE", b.label);
|
||||
ok("…y dice por qué: 133 direcciones distintas, con importes que se repiten", /133 salidas a 133 direcciones distintas \(con importes que se repiten\)/.test(b.detail) && !/casi todas de importes distintos/.test(b.detail), b.detail.slice(0, 120));
|
||||
ok("…quien cobra de ahí tiene exposición (antes: ninguna)", a.exposicion.puntos > 0 && a.exposicion.items.some(i => i.id === "batch_payment") && a.exposicion.nivel !== "ninguna", a.exposicion);
|
||||
ok("…y no le baja la nota: lo decidió quien pagó", a.score === 100 && a.band === "ALTA" && b.heredado === true, { score: a.score, band: a.band });
|
||||
ok("a un salto: «Una entrada viene de un pago por lotes» (como antes)", (() => { const t = T[F.casos.lote_origen]; const o = ch(E.analyzeTx(t, { vecinas: { padres: { [p.txid]: p }, siguientes: {} } }), "origen_lote"); return o && o.certainty === "POSIBLE" && /133 salidas/.test(o.detail); })());
|
||||
ok("directo y a un salto dicen lo mismo", directo(p) === true && aUnSalto(p) === true);
|
||||
const env = E.analyzeTx(p, { papel: "envias" });
|
||||
ok("si la envías tú: «Pagas a muchos destinatarios a la vez», y no es exposición heredada", /^Pagas a muchos/.test(ch(env, "batch_payment").label) && env.exposicion.puntos === 0);
|
||||
}
|
||||
|
||||
console.log("\n=== 2. Un solo criterio ===\n");
|
||||
{
|
||||
const dist = (n, repetidos) => Array.from({ length: n }, (_, i) => OUT(repetidos ? 50000 + (i % 3) * 7 : 100000 + i * 31337, "bc1qdest" + i));
|
||||
const grande = n => [IN(n * 2000000, "bc1qexchange")];
|
||||
ok("9 salidas de importes distintos: lote (como antes)", directo(TX(grande(9), dist(9, false))));
|
||||
ok("4 salidas de importes distintos: no (hacen falta 5)", !directo(TX(grande(4), dist(4, false))));
|
||||
ok("19 direcciones distintas con importes repetidos: no", !directo(TX(grande(19), dist(19, true))));
|
||||
ok("20 direcciones distintas con importes repetidos: lote", directo(TX(grande(20), dist(20, true))));
|
||||
ok("20 salidas a la MISMA dirección con importes repetidos: no (no son 20 destinatarios)", !directo(TX(grande(20), Array.from({ length: 20 }, (_, i) => OUT(50000 + (i % 3) * 7, "bc1qmisma")))));
|
||||
const conDatos = TX(grande(20), [...dist(19, true), { value: 0, scriptpubkey_type: "op_return", scriptpubkey: "6a04deadbeef" }]);
|
||||
ok("19 direcciones y un OP_RETURN: no (los datos no son un destinatario)", !directo(conDatos));
|
||||
const sinDir = TX(grande(20), Array.from({ length: 20 }, (_, i) => ({ value: 50000 + (i % 3) * 7, scriptpubkey_type: "p2pk", scriptpubkey: "41" + (i + 10).toString(16).padStart(2, "0").repeat(65) + "ac" })));
|
||||
ok("20 salidas sin dirección (P2PK) a 20 claves distintas: lote (cuentan por su script)", directo(sinDir));
|
||||
ok("el porqué queda dicho: por importes, por destinos, o por los dos", (() => { const a = E.analyzeTx(TX(grande(9), dist(9, false))).lote, b = E.analyzeTx(TX(grande(20), dist(20, true))).lote, c = E.analyzeTx(TX(grande(25), dist(25, false))).lote; return a.porImportes && !a.porDestinos && !b.porImportes && b.porDestinos && c.porImportes && c.porDestinos; })());
|
||||
ok("formaDeLote nunca da lote si es una mezcla", E.formaDeLote(dist(30, false), true) === null && E.formaDeLote(dist(30, true), true) === null);
|
||||
}
|
||||
|
||||
console.log("\n=== 3. Una mezcla no es un lote, se mire desde donde se mire ===\n");
|
||||
{
|
||||
const ins = n => Array.from({ length: n }, (_, i) => IN(1100000, "bc1qpart" + i, (i + 16).toString(16).padStart(2, "0").repeat(32)));
|
||||
const iguales = TX(ins(25), Array.from({ length: 25 }, (_, i) => OUT(1000000, "bc1qmix" + i)), "c1".repeat(32));
|
||||
ok("25 entradas y 25 salidas iguales: es mezcla, no lote (directo)", !directo(iguales) && ch(E.analyzeTx(iguales), "coinjoin").pass === true);
|
||||
ok("…ni a un salto", !aUnSalto(iguales));
|
||||
// Forma de WabiSabi: muchas entradas, muchas salidas de importes variados, ninguna dominante.
|
||||
const wabi = TX(ins(30), Array.from({ length: 30 }, (_, i) => OUT(900000 + i * 12345, "bc1qw" + i)), "c2".repeat(32));
|
||||
ok("30 entradas y 30 salidas variadas: el analizador la da por mezcla, no por lote (directo)", !directo(wabi) && ch(E.analyzeTx(wabi), "coinjoin").pass === true);
|
||||
ok("…y a un salto ya tampoco (antes: «viene de un pago por lotes» por tener 20 salidas)", !aUnSalto(wabi));
|
||||
const wp = REALES.find(t => t.vin.length === 5 && t.vout.length === 5);
|
||||
ok("una mezcla real de Whirlpool: ni lote directo ni a un salto", !!wp && !directo(wp) && !aUnSalto(wp));
|
||||
}
|
||||
|
||||
console.log("\n=== 4. Directo y a un salto dicen lo mismo de todas las transacciones de prueba ===\n");
|
||||
{
|
||||
const dist = (n, repetidos) => Array.from({ length: n }, (_, i) => OUT(repetidos ? 50000 + (i % 3) * 7 : 100000 + i * 31337, "bc1qdest" + i));
|
||||
const manuales = [5, 6, 9, 19, 20, 21, 40].flatMap(n => [TX([IN(n * 2000000, "bc1qx")], dist(n, false), "d" + n.toString(16).padStart(63, "0")), TX([IN(n * 2000000, "bc1qx")], dist(n, true), "e" + n.toString(16).padStart(63, "0"))]);
|
||||
const todas = [...Object.values(T), ...Object.values(X), ...REALES, ...manuales].filter(t => t.vout.length && t.vout[0].value > 5000);
|
||||
const distintas = todas.filter(t => directo(t) !== aUnSalto(t));
|
||||
ok(`${todas.length} transacciones (reales y a mano): ninguna es lote por un lado y no por el otro`, distintas.length === 0, distintas.map(t => `${t.txid.slice(0, 10)} ${t.vin.length}→${t.vout.length} directo=${directo(t)}`));
|
||||
ok("…y entre ellas hay lotes y no lotes (la prueba no es hueca)", todas.some(directo) && todas.some(t => !directo(t)), { lotes: todas.filter(directo).length });
|
||||
ok("la comprobación «batch_payment» y el campo «lote» van siempre juntos", todas.every(t => esLoteCheck(t) === directo(t)));
|
||||
}
|
||||
|
||||
console.log("\n=== 5. Una sola definición en el código ===\n");
|
||||
{
|
||||
const an = fs.readFileSync(path.join(__dirname, "..", "src", "14-analizador.js"), "utf8");
|
||||
ok("el origen ya no decide por su cuenta con «vout.length >= 20»", !/vout\.length >= 20/.test(an));
|
||||
ok("el análisis directo ya no decide por su cuenta con el 80 % de importes", (an.match(/>= 0\.8/g) || []).length === 1 && /function formaDeLote/.test(an));
|
||||
ok("el origen pregunta al propio analizador", /const esLoteVec = p => \{ try \{ return !!analyzeTx\(p\)\.lote; \} catch \{ return false; \} \};/.test(an));
|
||||
const ay = fs.readFileSync(path.join(__dirname, "..", "src", "80-ayuda.jsx"), "utf8");
|
||||
ok("la Ayuda cuenta el criterio entero", /veinte direcciones distintas o más/.test(ay));
|
||||
}
|
||||
|
||||
console.log(`\n${pass} ✓ · ${fail} ✗`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
// v2.1.1 — X1: una xpub suelta no dice de qué tipo es la wallet. Salió al
|
||||
// probar la v2.1.0 con una wallet real: la xpub de una wallet Taproot se
|
||||
// carga como SegWit nativa (bc1q…) y hay que acertar el tipo a mano.
|
||||
//
|
||||
// 1. «Buscar el tipo en mi nodo»: se calculan las primeras direcciones de
|
||||
// los cuatro tipos y se pregunta en cuáles hay movimientos. Propone; no
|
||||
// decide. Lo que no se pudo preguntar no se da por vacío.
|
||||
// 2. Sin actividad no hay nota: ni ALTA, ni «0 reutilizadas», ni «ninguna
|
||||
// transacción une tus direcciones». Y si fallaron consultas, ni siquiera
|
||||
// «sin actividad».
|
||||
// 3. Cómo empiezan las direcciones, a la vista; el descriptor, recomendado.
|
||||
//
|
||||
// Solo datos públicos: las claves de cuenta de la semilla de prueba
|
||||
// «abandon … about» de los BIP 44, 84 y 86, con sus direcciones oficiales.
|
||||
// El nodo es de mentira.
|
||||
//
|
||||
// Uso: node tests/test53.js
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const X = require("./extraer-cripto.js");
|
||||
const { B32, TIPO_SCRIPT } = X;
|
||||
// La derivación de verdad, con memoria: cada juego de direcciones se calcula
|
||||
// una vez (en Node, sin ella, la prueba tardaba minuto y medio).
|
||||
const memo = new Map();
|
||||
const deriveAddresses = (xpub, n = 20, script = null, op = {}) => {
|
||||
const k = [xpub, n, script, JSON.stringify(op)].join("|");
|
||||
if (!memo.has(k)) memo.set(k, X.deriveAddresses(xpub, n, script, op));
|
||||
return memo.get(k).then(a => ({ ...a, receive: [...a.receive], change: [...a.change] }));
|
||||
};
|
||||
const lines = require("./fuente.js")().split("\n");
|
||||
const cut = (desde, hasta) => {
|
||||
const s = lines.findIndex(l => l.includes(desde));
|
||||
const e = lines.findIndex((l, i) => i > s && l.includes(hasta));
|
||||
if (s === -1 || e === -1) { console.error(`No se localiza «${desde}» en el código de la app`); process.exit(1); }
|
||||
return lines.slice(s, e).join("\n");
|
||||
};
|
||||
const T = new Function(`${cut("// ── Tipo de una xpub por su actividad", "// ── fin tipo por actividad")}
|
||||
return { TIPOS_XPUB, DETECCION_RECEPCION, DETECCION_CAMBIO, DETECCION_CONSULTAS, direccionConActividad, veredictoTipo, buscarTipoPorActividad, textoDeteccion, mensajeSinActividad, origenTipoWallet, prefijoDireccion };`)();
|
||||
const W = new Function(`const C = { green:"g", amber:"a", red:"r", t1:"t1", t2:"t2", blue:"b", purple:"p" };
|
||||
const ENTITY_INDEX = new Map(); const OFAC_SET = new Set();
|
||||
${cut("// ── FORMATO: lógica pura", "// ── fin formato")}
|
||||
${cut("// ── Informe de wallet completo", "// ── Tipo de una xpub por su actividad")}
|
||||
${cut("function detectWallets", "function analyzeAddress")}
|
||||
return { buildWalletReport };`)();
|
||||
|
||||
let pass = 0, fail = 0;
|
||||
const ok = (n, c, x) => { console.log(` ${c ? "✓" : "✗"} ${n}`); if (!c && x !== undefined) console.log(" " + (typeof x === "string" ? x : JSON.stringify(x))); c ? pass++ : fail++; };
|
||||
|
||||
// Vectores oficiales (semilla «abandon … about»).
|
||||
const XPUB86 = "xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ"; // BIP86, m/86'/0'/0'
|
||||
const BIP86_REC0 = "bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr", BIP86_CAM0 = "bc1p3qkhfews2uk44qtvauqyr2ttdsw7svhkl9nkm9s9c3x4ax5h60wqwruhk7";
|
||||
const XPUB44 = "xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj"; // BIP44, m/44'/0'/0'
|
||||
const BIP44_REC0 = "1LqBGSKuX5yYUonjxT5qGfpUsXKYYWeabA";
|
||||
const ZPUB84 = "zpub6rFR7y4Q2AijBEqTUquhVz398htDFrtymD9xYYfG1m4wAcvPhXNfE3EfH1r1ADqtfSdVCToUG868RvUUkgDKf31mGDtKsAYz2oz2AGutZYs"; // BIP84, m/84'/0'/0'
|
||||
const BIP84_REC0 = "bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu";
|
||||
|
||||
// Un nodo de mentira: direcciones con movimientos, direcciones que fallan, y la cuenta de lo preguntado.
|
||||
const nodo = ({ activas = [], pendientes = [], gastoPendiente = [], soloSaldo = [], fallan = () => false } = {}) => {
|
||||
const preguntadas = [];
|
||||
const consultar = async d => {
|
||||
preguntadas.push(d);
|
||||
if (fallan(d, preguntadas.length)) throw new Error("sin respuesta (timeout)");
|
||||
const vacio = { funded_txo_count: 0, funded_txo_sum: 0, spent_txo_count: 0, spent_txo_sum: 0, tx_count: 0 };
|
||||
return { address: d,
|
||||
chain_stats: activas.includes(d) ? { ...vacio, funded_txo_count: 1, funded_txo_sum: 50000, tx_count: 1 } : soloSaldo.includes(d) ? { ...vacio, funded_txo_sum: 70000 } : vacio,
|
||||
mempool_stats: pendientes.includes(d) ? { ...vacio, funded_txo_count: 1, funded_txo_sum: 1000, tx_count: 1 } : gastoPendiente.includes(d) ? { ...vacio, spent_txo_count: 1, spent_txo_sum: 1000, tx_count: 1 } : vacio };
|
||||
};
|
||||
return { consultar, preguntadas };
|
||||
};
|
||||
const buscar = (xpub, n, extra = {}) => T.buscarTipoPorActividad(xpub, { derivar: deriveAddresses, consultar: n.consultar, pausa: 0, ...extra });
|
||||
const tipo = (r, s) => r.tipos.find(t => t.script === s);
|
||||
|
||||
(async () => {
|
||||
// La zpub de BIP84 escrita como xpub: la misma clave con el prefijo que no dice nada.
|
||||
const raw = await B32.decodeBase58Check(ZPUB84);
|
||||
const XPUB84 = await B32.encodeBase58Check(Uint8Array.from([0x04, 0x88, 0xb2, 0x1e, ...raw.slice(4)]));
|
||||
|
||||
console.log("=== 0. Los datos de la prueba son los de los BIP ===\n");
|
||||
{
|
||||
const d86 = await deriveAddresses(XPUB86, 2, "p2tr"), d44 = await deriveAddresses(XPUB44, 1, "p2pkh"), d84 = await deriveAddresses(XPUB84, 1, "p2wpkh");
|
||||
ok("xpub de BIP86 + Taproot → bc1p5cyx… y cambio bc1p3qkh… (vector oficial)", d86.receive[0] === BIP86_REC0 && d86.change[0] === BIP86_CAM0);
|
||||
ok("xpub de BIP44 + antigua → 1LqBGSK… (vector oficial)", d44.receive[0] === BIP44_REC0);
|
||||
ok("la clave de BIP84 escrita como xpub + SegWit nativa → bc1qcr8te… (vector oficial)", XPUB84.startsWith("xpub") && d84.receive[0] === BIP84_REC0, XPUB84.slice(0, 12));
|
||||
const sup = await deriveAddresses(XPUB86, 1);
|
||||
ok("el problema: la xpub de una wallet Taproot se carga como SegWit nativa, «supuesto»", sup.script === "p2wpkh" && sup.scriptSupuesto === true && sup.receive[0].startsWith("bc1q") && sup.receive[0] !== BIP86_REC0);
|
||||
}
|
||||
|
||||
console.log("\n=== 1. Buscar el tipo por la actividad ===\n");
|
||||
{
|
||||
const n = nodo({ activas: [BIP86_REC0] });
|
||||
const r = await buscar(XPUB86, n);
|
||||
ok("actividad solo en la dirección oficial de BIP86 → propone Taproot", r.clase === "uno" && r.propuesto === "p2tr", r);
|
||||
ok("…una dirección con movimientos en Taproot y ninguna en los otros tres", tipo(r, "p2tr").conActividad === 1 && ["p2wpkh", "p2sh-p2wpkh", "p2pkh"].every(s => tipo(r, s).conActividad === 0));
|
||||
ok("se pregunta por 15 direcciones de cada tipo: 60 consultas, ni una más", n.preguntadas.length === 60 && T.DETECCION_CONSULTAS === 60 && r.consultas === 60 && r.tipos.every(t => t.total === 15 && t.miradas === 15));
|
||||
ok("…todas distintas (cuatro tipos, cuatro juegos de direcciones)", new Set(n.preguntadas).size === 60);
|
||||
ok("…10 de recepción y 5 de cambio por tipo", n.preguntadas.includes(BIP86_CAM0) && T.DETECCION_RECEPCION === 10 && T.DETECCION_CAMBIO === 5);
|
||||
ok("…y de los cuatro tipos: bc1q, bc1p, 3 y 1", ["bc1q", "bc1p", "3", "1"].every(p => n.preguntadas.filter(d => d.startsWith(p)).length === 15), [...new Set(n.preguntadas.map(d => T.prefijoDireccion(d)))]);
|
||||
const tx = T.textoDeteccion(r, "p2wpkh", TIPO_SCRIPT);
|
||||
ok("el texto propone y pregunta: «Actividad encontrada en Taproot (bc1p…)» … «¿Es esa tu wallet?»", tx.titulo === "Actividad encontrada en Taproot (bc1p…)" && /¿Es esa tu wallet\?/.test(tx.texto) && /1 de las 15 primeras direcciones/.test(tx.texto) && tx.tono === "aviso", tx);
|
||||
ok("…y dice que en el tipo cargado no hay nada", /en ninguna de SegWit nativa \(bc1q…\), el tipo cargado ahora/.test(tx.texto));
|
||||
const ya = T.textoDeteccion(r, "p2tr", TIPO_SCRIPT);
|
||||
ok("si el tipo cargado ya es ese: lo dice, y sigue pidiendo confirmar la recepción 0 («pista, no prueba»)", /el tipo que ya está cargado/.test(ya.titulo) && /pista, no una prueba/.test(ya.texto) && /recepción 0/.test(ya.texto) && ya.tono === "ok", ya);
|
||||
|
||||
// Los otros tres tipos, con la misma clave (calcular 60 direcciones por clave es lento en Node).
|
||||
const ant = (await deriveAddresses(XPUB86, 10, "p2pkh", { ramas: [0] })).receive[3];
|
||||
const r44 = await buscar(XPUB86, nodo({ activas: [ant] }));
|
||||
ok("actividad en una dirección antigua (1…) → propone antigua", ant.startsWith("1") && r44.clase === "uno" && r44.propuesto === "p2pkh");
|
||||
const nat = (await deriveAddresses(XPUB86, 10, "p2wpkh", { ramas: [0] })).receive[0];
|
||||
const r84 = await buscar(XPUB86, nodo({ activas: [nat] }));
|
||||
ok("actividad en una dirección SegWit nativa (bc1q…) → propone SegWit nativa", nat.startsWith("bc1q") && r84.clase === "uno" && r84.propuesto === "p2wpkh");
|
||||
const an = (await deriveAddresses(XPUB86, 10, "p2sh-p2wpkh", { ramas: [0] })).receive[7];
|
||||
const r49 = await buscar(XPUB86, nodo({ activas: [an] }));
|
||||
ok("actividad en la recepción 7 de SegWit anidada → propone anidada (3…)", an.startsWith("3") && r49.propuesto === "p2sh-p2wpkh");
|
||||
const rCam = await buscar(XPUB86, nodo({ activas: [BIP86_CAM0] }));
|
||||
ok("actividad solo en una dirección de cambio: también cuenta", rCam.propuesto === "p2tr");
|
||||
const rPend = await buscar(XPUB86, nodo({ pendientes: [BIP86_REC0] }));
|
||||
ok("un pago todavía sin confirmar (mempool): también cuenta", rPend.propuesto === "p2tr");
|
||||
const rGasto = await buscar(XPUB86, nodo({ gastoPendiente: [BIP86_REC0] }));
|
||||
ok("un gasto todavía sin confirmar (solo cuenta de transacciones en la mempool): también cuenta", rGasto.propuesto === "p2tr");
|
||||
const rSaldo = await buscar(XPUB86, nodo({ soloSaldo: [BIP86_REC0] }));
|
||||
ok("dirección con dinero recibido pero sin número de transacciones: no está «sin usar»", rSaldo.propuesto === "p2tr");
|
||||
{ const pedidas = []; await T.buscarTipoPorActividad(XPUB86, { derivar: (x, n, sc, op) => { pedidas.push(`${n}/${JSON.stringify(op)}`); return deriveAddresses(x, n, sc, op); }, consultar: nodo().consultar, pausa: 0 });
|
||||
ok("solo se calculan las direcciones que se preguntan: por cada tipo, 10 de la rama 0 y 5 de la rama 1", pedidas.length === 8 && pedidas.filter(x => x === '10/{"ramas":[0]}').length === 4 && pedidas.filter(x => x === '5/{"ramas":[1]}').length === 4, pedidas); }
|
||||
const lejos = (await deriveAddresses(XPUB86, 12, "p2tr", { ramas: [0] })).receive[11];
|
||||
const rLejos = await buscar(XPUB86, nodo({ activas: [lejos] }));
|
||||
ok("actividad solo en la recepción 11 (fuera de las 10 primeras): no se ve, y no se inventa", rLejos.clase === "ninguno" && rLejos.propuesto === null);
|
||||
}
|
||||
|
||||
console.log("\n=== 2. Lo que no se sabe no se afirma ===\n");
|
||||
{
|
||||
const r0 = await buscar(XPUB86, nodo());
|
||||
ok("ningún tipo con actividad y todas las consultas respondidas → «ninguno», sin propuesta", r0.clase === "ninguno" && r0.propuesto === null && r0.fallos === 0);
|
||||
const t0 = T.textoDeteccion(r0, "p2wpkh", TIPO_SCRIPT);
|
||||
ok("…no elige un tipo: «el tipo solo lo puedes decir tú»", /Sin actividad en ninguno de los cuatro tipos/.test(t0.titulo) && /solo lo puedes decir tú/.test(t0.texto) && t0.tono === "neutro" && /60 consultas/.test(t0.texto), t0);
|
||||
|
||||
const dos = await buscar(XPUB86, nodo({ activas: [BIP86_REC0, (await deriveAddresses(XPUB86, 10, "p2wpkh", { ramas: [0] })).receive[0]] }));
|
||||
ok("actividad en dos tipos → «varios»: no propone ninguno", dos.clase === "varios" && dos.propuesto === null && dos.conActividad.join() === "p2wpkh,p2tr", dos.conActividad);
|
||||
const t2 = T.textoDeteccion(dos, "p2wpkh", TIPO_SCRIPT);
|
||||
ok("…lo enseña con sus cuentas y deja elegir: «La app no puede saber cuál es tu wallet»", /más de un tipo/.test(t2.titulo) && /SegWit nativa \(bc1q…\): 1 de las 15/.test(t2.texto) && /Taproot \(bc1p…\): 1 de las 15/.test(t2.texto) && /no puede saber cuál es tu wallet/.test(t2.texto), t2);
|
||||
|
||||
const caido = await buscar(XPUB86, nodo({ fallan: () => true }));
|
||||
ok("el nodo no responde a nada → «sin_datos», no «ninguno»", caido.clase === "sin_datos" && caido.miradas === 0 && caido.fallos === 60);
|
||||
ok("…y el texto no dice que no haya actividad", (() => { const t = T.textoDeteccion(caido, "p2wpkh", TIPO_SCRIPT); return /No se pudo preguntar/.test(t.titulo) && !/Sin actividad/.test(t.titulo + t.texto); })());
|
||||
const medio = await buscar(XPUB86, nodo({ fallan: d => d.startsWith("bc1p") }));
|
||||
ok("fallan justo las de Taproot y en el resto no hay nada → «incompleto», no «ninguno»", medio.clase === "incompleto" && medio.fallos === 15 && tipo(medio, "p2tr").miradas === 0);
|
||||
const tm = T.textoDeteccion(medio, "p2wpkh", TIPO_SCRIPT);
|
||||
ok("…«de las demás no se sabe nada»", /quedó incompleta/.test(tm.titulo) && /15 de las 60 consultas/.test(tm.texto) && /no se sabe nada/.test(tm.texto), tm);
|
||||
const conFallo = await buscar(XPUB86, nodo({ activas: [BIP86_REC0], fallan: d => d.startsWith("3") }));
|
||||
ok("actividad en Taproot y fallos en otro tipo: propone, pero avisa de que puede haber más", conFallo.propuesto === "p2tr" && /15 consultas a tu nodo no respondieron: puede haber actividad que no se ha visto/.test(T.textoDeteccion(conFallo, "p2wpkh", TIPO_SCRIPT).texto));
|
||||
let vivo = true, n = 0; const nc = nodo();
|
||||
const cortada = await buscar(XPUB86, nc, { sigue: () => vivo, alAvanzar: () => { if (++n === 2) vivo = false; } });
|
||||
ok("si se cambia de wallet a mitad, la búsqueda se abandona sin resultado", cortada === null);
|
||||
ok("…y deja de preguntar al nodo en ese momento (10 consultas hechas, no 60)", nc.preguntadas.length === 10, nc.preguntadas.length);
|
||||
const av = []; await buscar(XPUB86, nodo(), { alAvanzar: (h, t) => av.push(`${h}/${t}`) });
|
||||
ok("va diciendo por dónde va (5/60 … 60/60)", av[0] === "5/60" && av[av.length - 1] === "60/60" && av.length === 12, av);
|
||||
ok("veredictoTipo no propone con dos tipos aunque uno tenga muchas más", T.veredictoTipo([{ script: "p2wpkh", total: 15, miradas: 15, conActividad: 9, fallos: 0 }, { script: "p2tr", total: 15, miradas: 15, conActividad: 1, fallos: 0 }]).propuesto === null);
|
||||
}
|
||||
|
||||
console.log("\n=== 3. Sin actividad no hay nota ===\n");
|
||||
{
|
||||
const rep = W.buildWalletReport([], [], new Set((await deriveAddresses(XPUB86, 10, "p2wpkh", { ramas: [0] })).receive));
|
||||
ok("hoy (v2.1.0) el informe sin actividad ya no daba ALTA: banda «SIN ACTIVIDAD» (se mantiene)", rep.health.band === "SIN ACTIVIDAD" && rep.totalTxs === 0 && rep.activeCount === 0, rep.health.band);
|
||||
const M = o => T.mensajeSinActividad({ tipo: "SegWit nativa (bc1q…)", clave: "xpub", direcciones: 40, fallos: 0, ...o });
|
||||
const sup = M({ origen: "supuesto" });
|
||||
ok("xpub con el tipo supuesto: «lo más probable es que el tipo de dirección no sea el correcto»", sup.banda === "SIN ACTIVIDAD" && /lo más probable es que el tipo de dirección no sea el correcto/.test(sup.msg) && /se ha supuesto SegWit nativa \(bc1q…\)/.test(sup.msg) && /buscar el tipo en tu nodo/.test(sup.msg), sup);
|
||||
const ele = M({ origen: "elegido", tipo: "Taproot (bc1p…)" });
|
||||
ok("xpub con el tipo elegido a mano: «puede que el tipo elegido (Taproot…) no sea el suyo»", /puede que el tipo elegido \(Taproot \(bc1p…\)\) no sea el suyo/.test(ele.msg), ele);
|
||||
const des = M({ origen: "descriptor", tipo: "Taproot (bc1p…)" });
|
||||
ok("descriptor: «Sin actividad todavía: no hay nada que medir», y no sugiere cambiar de tipo", des.titulo === "Sin actividad todavía: no hay nada que medir" && /lo dice el descriptor, así que no es eso/.test(des.msg) && !/buscar el tipo|elegir otro|no sea el correcto/.test(des.msg), des);
|
||||
const pre = M({ origen: "prefijo", clave: "zpub" });
|
||||
ok("zpub / ypub: lo mismo, «lo indica el prefijo zpub»", /lo indica el prefijo zpub, así que no es eso/.test(pre.msg) && pre.titulo === des.titulo);
|
||||
ok("ninguno de los cuatro habla de privacidad alta ni de «sin reutilización»", [sup, ele, des, pre].every(m => !/ALTA|alta|sin reutilización|ni vinculación|bien separadas/i.test(m.titulo + m.msg) && m.banda !== "ALTA"));
|
||||
ok("todos dicen cuántas direcciones se han mirado", [sup, ele, des, pre].every(m => /Ninguna de las 40 direcciones calculadas tiene movimientos/.test(m.msg)));
|
||||
const fa = M({ origen: "descriptor", fallos: 3 });
|
||||
ok("con consultas fallidas no se dice «sin actividad»: «No se sabe si hay actividad» (SIN DATOS)", fa.banda === "SIN DATOS" && fa.titulo === "No se sabe si hay actividad" && /3 consultas a tu nodo fallaron/.test(fa.msg) && /no se sabe nada/.test(fa.msg) && !/sin estrenar/.test(fa.msg), fa);
|
||||
ok("…con una sola, en singular", /^Una consulta a tu nodo falló/.test(M({ origen: "supuesto", fallos: 1 }).msg));
|
||||
const O = T.origenTipoWallet;
|
||||
ok("de dónde sale el tipo: descriptor, prefijo, elegido o supuesto", O({ descriptor: {}, tipo: "xpub" }) === "descriptor" && O({ tipo: "zpub", scriptSupuesto: false }) === "prefijo" && O({ tipo: "xpub", scriptSupuesto: false }) === "elegido" && O({ tipo: "tpub", scriptSupuesto: true }) === "supuesto" && O(null) === null);
|
||||
const real = await deriveAddresses(XPUB86, 1), elegida = await deriveAddresses(XPUB86, 1, "p2tr"), z = await deriveAddresses(ZPUB84, 1);
|
||||
ok("…con claves de verdad: xpub suelta = supuesto, xpub + Taproot = elegido, zpub = prefijo", O(real) === "supuesto" && O(elegida) === "elegido" && O(z) === "prefijo");
|
||||
}
|
||||
|
||||
console.log("\n=== 4. Cómo empiezan las direcciones ===\n");
|
||||
{
|
||||
const P = T.prefijoDireccion;
|
||||
ok("bc1p / bc1q / 3 / 1", P(BIP86_REC0) === "bc1p" && P(BIP84_REC0) === "bc1q" && P("37VucYSaXLCAsxYyAPfbSi9eh4iEcbShgf") === "3" && P(BIP44_REC0) === "1");
|
||||
ok("red de pruebas: tb1p / tb1q / 2 / m", P("tb1p8wpt9v4frpf3tkn0srd97pksgsxc5hs52lafxwru9kgeephvs7rqlqt9zj") === "tb1p" && P("tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx") === "tb1q" && P("2Mww8dCYPUpKHofjgcXcBCEGmniw9CoaiD2") === "2" && P("mkpZhYtJu2r87Js3pDiWJDmPte2NRZ8bJV") === "m");
|
||||
ok("vacío o nada: no revienta", P("") === "" && P(null) === "" && P(undefined) === "");
|
||||
const cuatro = await Promise.all(T.TIPOS_XPUB.map(s => deriveAddresses(XPUB86, 10, s, { ramas: [0] })));
|
||||
ok("los cuatro tipos de la misma xpub empiezan cada uno a su manera", cuatro.map(a => P(a.receive[0])).join() === "bc1q,bc1p,3,1", cuatro.map(a => P(a.receive[0])));
|
||||
}
|
||||
|
||||
console.log("\n=== 5. En pantalla ===\n");
|
||||
{
|
||||
const p = fs.readFileSync(path.join(__dirname, "..", "src", "50-pestana-auditoria.jsx"), "utf8");
|
||||
const carga = p.slice(p.indexOf("const loadWallet = async"), p.indexOf("const clearWallet"));
|
||||
ok("cargar la wallet sigue sin preguntar nada al nodo (la búsqueda la pide la persona)", !/getStrict|buscarTipoPorActividad|buscarTipo\(/.test(carga));
|
||||
ok("el botón «Buscar el tipo en mi nodo» solo sale con una xpub o tpub suelta", /const xpubSinTipo = !!walletAddrs && !walletAddrs\.descriptor && \(walletAddrs\.tipo==="xpub"\|\|walletAddrs\.tipo==="tpub"\);/.test(p) && /\{xpubSinTipo&&\(/.test(p));
|
||||
ok("…dice cuántas consultas hará antes de hacerlas", /\{DETECCION_CONSULTAS\} consultas/.test(p));
|
||||
ok("…y en modo signet dice que pregunta al servidor de signet", /RED\.signet\?"al servidor de signet":"a tu nodo"/.test(p));
|
||||
ok("la propuesta se carga con un botón («Cargar como …»), no sola", /Cargar como \{TIPO_SCRIPT\[t\]\}/.test(p) && !/setWalletAddrs\([^)]*propuesto/.test(p));
|
||||
ok("al cambiar de clave o quitar la wallet, lo buscado se olvida", /if \(tipoDet && tipoDet\.clave !== plan\.xpub\) olvidarTipo\(\);/.test(p) && /olvidarInforme\(\); olvidarTipo\(\); \};/.test(p));
|
||||
ok("sin actividad: el círculo es «—», y «Reutilizadas» y «Grupos vinculados» son «—», no 0", /walletReport\.sinNota\?"—":walletReport\.health\.band/.test(p) && /v:walletReport\.sinNota\?"—":walletReport\.reusedAddrs\.length/.test(p) && /v:walletReport\.sinNota\?"—":walletReport\.clusters\.length/.test(p));
|
||||
ok("…y no sale «✓ Ninguna transacción une tus direcciones»", /walletReport\.clusters\.length===0&&!walletReport\.sinNota&&\(/.test(p));
|
||||
ok("…ni en el informe descargado", /walletReport\.sinNota\?\[`Sin actividad en las direcciones calculadas: no hay nada que medir\.`\]/.test(p) && /sin medir \(no hay actividad\)/.test(p));
|
||||
ok("el informe usa mensajeSinActividad con los fallos del escaneo", /mensajeSinActividad\(\{ origen: origenTipoWallet\(walletAddrs\)[^}]*fallos: scanErrors\.length \}\)/.test(p));
|
||||
ok("las direcciones a comparar llevan el prefijo destacado, y se dice el tipo en palabras", /<strong style=\{\{color:C\.green,fontSize:"0\.7rem"\}\}>\{pre\}<\/strong>\{a\.slice\(pre\.length\)\}/.test(p) && /Empiezan por /.test(p) && /Si las de tu wallet empiezan de otra forma, el tipo no es este\./.test(p));
|
||||
ok("el descriptor es la opción recomendada", /Recomendado: el descriptor<\/strong>/.test(p) && /placeholder="descriptor de Sparrow o Core \(recomendado\)/.test(p) && /Cargar mi wallet \(descriptor o xpub\)/.test(p));
|
||||
const ay = fs.readFileSync(path.join(__dirname, "..", "src", "80-ayuda.jsx"), "utf8");
|
||||
ok("la Ayuda lo cuenta: descriptor, buscar el tipo (60 consultas) y sin nota sin actividad", /Buscar el tipo en mi nodo/.test(ay) && /60 consultas/.test(ay) && /sin actividad no hay nada que medir/.test(ay));
|
||||
}
|
||||
|
||||
console.log(`\n${pass} ✓ · ${fail} ✗`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
})().catch(e => { console.error(e); process.exit(1); });
|
||||
@@ -0,0 +1,90 @@
|
||||
// v2.1.1 — U5 de la auditoría del 10-nov-2026: con un nodo configurado que no
|
||||
// responde, bajo el aviso rojo seguían las cifras de ejemplo a todo color
|
||||
// («Sincronizado: Sí ✓»). Los datos de ejemplo son para el modo demostración
|
||||
// (sin nodo), y solo para él.
|
||||
//
|
||||
// La regla vive en un solo sitio: useApi.get ya no devuelve el ejemplo cuando
|
||||
// hay un nodo configurado. Devuelve null, la ruta queda marcada «sin datos» y
|
||||
// cada pantalla pone una raya (—).
|
||||
//
|
||||
// Uso: node tests/test54.js
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const lines = require("./fuente.js")().split("\n");
|
||||
const cut = (desde, hasta) => {
|
||||
const s = lines.findIndex(l => l.includes(desde));
|
||||
const e = lines.findIndex((l, i) => i > s && l.includes(hasta));
|
||||
if (s === -1 || e === -1) { console.error(`No se localiza «${desde}» en el código de la app`); process.exit(1); }
|
||||
return lines.slice(s, e).join("\n");
|
||||
};
|
||||
let pass = 0, fail = 0;
|
||||
const ok = (n, c, x) => { console.log(` ${c ? "✓" : "✗"} ${n}`); if (!c && x !== undefined) console.log(" " + (typeof x === "string" ? x : JSON.stringify(x))); c ? pass++ : fail++; };
|
||||
function capaDeRed(respuestas) {
|
||||
const fetchFalso = async (url) => {
|
||||
const r = respuestas(url);
|
||||
if (r instanceof Error) throw r;
|
||||
return { ok: r >= 200 && r < 300, status: r, json: async () => ({ real: true }), text: async () => "" };
|
||||
};
|
||||
const hooks = "const useState = v => [v, () => {}]; const useEffect = () => {}; const useCallback = f => f;";
|
||||
return new Function("fetch", `${hooks} const RED = { signet: false, urlMain: "" };
|
||||
${cut("// ── fetch con timeout", " const fmt = {")}
|
||||
return { RED, useApi, useNodeHealth };`)(fetchFalso);
|
||||
}
|
||||
const NODO = "https://nodo:4083", EJEMPLO = { ejemplo: true, synced: true };
|
||||
const leer = f => fs.readFileSync(path.join(__dirname, "..", "src", f), "utf8");
|
||||
|
||||
(async () => {
|
||||
console.log("=== 1. Con un nodo configurado, nunca llegan datos de ejemplo ===\n");
|
||||
{
|
||||
const R = capaDeRed(() => new Error("Failed to fetch"));
|
||||
const { get } = R.useApi(NODO);
|
||||
const d = await get("/system/bitcoin", EJEMPLO);
|
||||
ok("el nodo no responde → null, no el ejemplo (antes: el ejemplo)", d === null, d);
|
||||
const s = R.useNodeHealth(NODO);
|
||||
ok("…y la ruta queda marcada «sin datos»", s.sinDatos("/system/bitcoin") === true);
|
||||
ok("…una ruta por la que no se ha preguntado, no", s.sinDatos("/api/mempool") === false);
|
||||
for (const [codigo, ruta] of [[502, "/api/mempool"], [500, "/api/v1/fees/recommended"], [404, "/api/v1/difficulty-adjustment"], [403, "/system/info"]]) {
|
||||
const R2 = capaDeRed(() => codigo), g = R2.useApi(NODO).get;
|
||||
const r = await g(ruta, EJEMPLO);
|
||||
ok(`HTTP ${codigo} en ${ruta} → null y «sin datos»`, r === null && R2.useNodeHealth(NODO).sinDatos(ruta));
|
||||
}
|
||||
const R3 = capaDeRed(() => new Error("x")), g3 = R3.useApi(NODO).get;
|
||||
ok("lo que se pide sin ejemplo sigue igual: null → null, [] → []", (await g3("/api/tx/x", null)) === null && Array.isArray(await g3("/api/address/x/txs", [])));
|
||||
ok("…y una lista vacía no queda marcada como dato que falta", !R3.useNodeHealth(NODO).sustituidos.has("/api/address/x/txs"));
|
||||
}
|
||||
|
||||
console.log("\n=== 2. Lo demás no cambia ===\n");
|
||||
{
|
||||
const R = capaDeRed(() => 200);
|
||||
const d = await R.useApi(NODO).get("/api/mempool", EJEMPLO);
|
||||
ok("el nodo responde → sus datos, y nada marcado", d && d.real === true && !R.useNodeHealth(NODO).sinDatos("/api/mempool"));
|
||||
const D = capaDeRed(() => new Error("no debería preguntarse"));
|
||||
const dm = await D.useApi("").get("/api/mempool", EJEMPLO);
|
||||
ok("sin nodo (modo demostración) → el ejemplo, como siempre", dm === EJEMPLO);
|
||||
ok("…«sin datos» es solo para un nodo configurado: en demostración es falso (ahí manda «ejemplo»)", D.useNodeHealth("").sinDatos("/api/mempool") === false && D.useNodeHealth("").esEjemplo("/api/mempool") === true);
|
||||
const V = capaDeRed(u => /mempool/.test(u) ? 502 : 200), gv = V.useApi(NODO).get;
|
||||
await gv("/api/mempool", EJEMPLO); const antes = V.useNodeHealth(NODO).sinDatos("/api/mempool");
|
||||
const V2 = capaDeRed(() => 200); await V2.useApi(NODO).get("/api/mempool", EJEMPLO);
|
||||
ok("una ruta que falló deja de estar «sin datos» cuando vuelve a contestar", antes === true && V2.useNodeHealth(NODO).sinDatos("/api/mempool") === false);
|
||||
}
|
||||
|
||||
console.log("\n=== 3. Las pantallas ponen rayas, no ejemplos ===\n");
|
||||
{
|
||||
const nodo = leer("30-pestana-nodo.jsx"), red = leer("31-pestana-red.jsx"), exp = leer("32-explorador.jsx"), com = leer("21-interfaz-comun.jsx");
|
||||
const vista = nodo.slice(nodo.indexOf("function NodeOverview"), nodo.indexOf("function NodeSecurityChecklist"));
|
||||
ok("Mi nodo: los cinco datos de cabecera pasan por raya() y salen en gris si faltan", (vista.match(/value=\{raya\((height|mempool|fees|diff),/g) || []).length === 8 && /const raya = \(v, f\) => v == null \? "—" : f\(v\);/.test(vista), (vista.match(/value=\{raya\(/g) || []).length);
|
||||
ok("…ningún dato de la cadena se lee sin comprobar que ha llegado", !/[^a-z](height|mempool|fees|diff)\.[a-zA-Z]+[^a-zA-Z(]/.test(vista.replace(/=>[^)]*\)/g, "").replace(/diff&&diff\.difficultyChange/g, "")), (vista.replace(/=>[^)]*\)/g, "").match(/[^a-z](height|mempool|fees|diff)\.[a-zA-Z]+/g) || []).join(" "));
|
||||
ok("Bitcoin Core y Sistema: si el servicio de métricas no contesta, un texto y no la rejilla de ejemplo", (vista.match(/salud\.sinDatos\("\/system\/(bitcoin|info)"\)\) \? <SinMetricas/g) || []).length === 2);
|
||||
ok("…con la marca SIN DATOS (ya no «EJEMPLO»: no hay ejemplo que marcar)", (vista.match(/<Badge color=\{C\.amber\}>SIN DATOS<\/Badge>/g) || []).length === 2 && !/EJEMPLO · txoko-metrics/.test(nodo));
|
||||
ok("Red: el aviso dice SIN DATOS y «quedan vacías», no «datos de ejemplo»", /<Badge color=\{C\.amber\}>SIN DATOS<\/Badge>/.test(red) && /quedan <strong>vacías<\/strong>/.test(red) && !/son <strong>datos de ejemplo<\/strong>/.test(red));
|
||||
ok("…y sus tarjetas solo se pintan si el dato ha llegado", /\{fees&&\(/.test(red) && /\{mempool&&\(/.test(red) && /\{proyectados&&proyectados\.length>0&&\(/.test(red));
|
||||
ok("Explorador: las confirmaciones no se calculan con la altura de ejemplo", /get\("\/api\/blocks\/tip\/height",null\)/.test(exp) && !/get\("\/api\/blocks\/tip\/height",MOCK_HEIGHT\)/.test(exp) && /NO SE SABE CUÁNTAS CONFIRMACIONES/.test(exp));
|
||||
ok("el aviso rojo ya no dice «lo que ves es de ejemplo»", /TU NODO NO RESPONDE · NO HAY DATOS QUE ENSEÑAR/.test(com) && !/LO QUE VES ES DE EJEMPLO/.test(com) && /verás una raya \(—\)/.test(com));
|
||||
const todo = fs.readdirSync(path.join(__dirname, "..", "src")).filter(f => /\.jsx$/.test(f)).map(f => [f, leer(f)]);
|
||||
const conEjemplo = todo.flatMap(([f, s]) => (s.match(/[^a-zA-Z.]get\((`[^`]*`|"[^"]*"),\s*MOCK_[A-Z_]+\)/g) || []).map(m => f + ": " + m.trim()));
|
||||
ok("todas las peticiones con ejemplo de reserva están en pantallas que saben poner rayas (Mi nodo y Red)", conEjemplo.length === 10 && conEjemplo.every(x => /^3[01]-pestana-(nodo|red)\.jsx/.test(x)), conEjemplo);
|
||||
}
|
||||
|
||||
console.log(`\n${pass} ✓ · ${fail} ✗`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
})().catch(e => { console.error(e); process.exit(1); });
|
||||
@@ -0,0 +1,29 @@
|
||||
// v2.1.1 — U1 de la auditoría del 10-nov-2026: IBM Plex Mono no se usaba
|
||||
// nunca. Todos los temas llevaban mono:"monospace", así que el navegador solo
|
||||
// cargaba Plex Sans: los tres ficheros de Plex Mono viajaban para nada y en
|
||||
// un iPhone la letra de los datos era Courier.
|
||||
//
|
||||
// Uso: node tests/test55.js
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const lines = require("./fuente.js")().split("\n");
|
||||
const s = lines.findIndex(l => l.includes("const LETRA_MONO =")), e = lines.findIndex((l, i) => i > s && l.includes("const THEME_META"));
|
||||
if (s === -1 || e === -1) { console.error("No se localizan los temas en el código de la app"); process.exit(1); }
|
||||
const { THEMES, LETRA_MONO } = new Function(lines.slice(s, e).join("\n") + "\nreturn { THEMES, LETRA_MONO };")();
|
||||
let pass = 0, fail = 0;
|
||||
const ok = (n, c, x) => { console.log(` ${c ? "✓" : "✗"} ${n}`); if (!c && x !== undefined) console.log(" " + JSON.stringify(x)); c ? pass++ : fail++; };
|
||||
const primera = pila => pila.split(",")[0].replace(/['"]/g, "").trim();
|
||||
|
||||
console.log("=== U1. La letra de datos es IBM Plex Mono ===\n");
|
||||
ok("hay cuatro temas", Object.keys(THEMES).join() === "cypherpunk,amber,piedra,archivo");
|
||||
for (const t of ["cypherpunk", "amber", "piedra"]) ok(`${t}: la letra de datos empieza por IBM Plex Mono`, primera(THEMES[t].mono) === "IBM Plex Mono", THEMES[t].mono);
|
||||
ok("ámbar («todo en terminal»): también el texto corrido", primera(THEMES.amber.sans) === "IBM Plex Mono");
|
||||
ok("archivo conserva su Courier Prime", primera(THEMES.archivo.mono) === "Courier Prime");
|
||||
ok("ningún tema se queda en «monospace» a secas", Object.values(THEMES).every(t => t.mono !== "monospace" && t.sans !== "monospace"));
|
||||
ok("todas las pilas acaban en una letra del sistema, por si la del nodo no está", Object.values(THEMES).every(t => /monospace$/.test(t.mono)) && /monospace$/.test(LETRA_MONO));
|
||||
const raiz = path.join(__dirname, "..");
|
||||
ok("la página enlaza las letras servidas por el nodo", /<link href="vendor\/fonts\/ibm-plex\.css" rel="stylesheet">/.test(fs.readFileSync(path.join(raiz, "plantilla.html"), "utf8")));
|
||||
ok("instalar-fuentes.sh sigue trayendo los tres pesos de Plex Mono", ["IBMPlexMono-Regular", "IBMPlexMono-SemiBold", "IBMPlexMono-Bold"].every(f => fs.readFileSync(path.join(raiz, "instalar-fuentes.sh"), "utf8").includes(f)));
|
||||
|
||||
console.log(`\n${pass} ✓ · ${fail} ✗`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
@@ -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);
|
||||
@@ -0,0 +1,40 @@
|
||||
// v2.1.1 — U6 de la auditoría del 10-nov-2026: en el móvil, la fila del txid
|
||||
// no encogía. Al campo le faltaba minWidth:0, así que el botón ANALIZAR
|
||||
// acababa fuera de su tarjeta y, en un móvil de 320 px, la página entera se
|
||||
// ensanchaba. Además el simulador de gasto, que sin wallet no puede hacer
|
||||
// nada, ocupaba media pantalla por delante del campo.
|
||||
//
|
||||
// Lo que manda es la comprobación en el navegador (320, 390 y 1280 px, los
|
||||
// cuatro temas, ocho pantallas: sin desplazamiento lateral). Esta prueba
|
||||
// vigila que las piezas del arreglo sigan en su sitio.
|
||||
//
|
||||
// Uso: node tests/test57.js
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const leer = f => fs.readFileSync(path.join(__dirname, "..", "src", f), "utf8");
|
||||
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, 500)); c ? pass++ : fail++; };
|
||||
|
||||
console.log("=== U6. Las filas «campo + QR + botón» caben en un móvil ===\n");
|
||||
// Cada campo de texto que comparte fila con botones: el campo encoge y la fila salta de línea.
|
||||
const filas = [["50-pestana-auditoria.jsx", "txid de la transacción (64 letras y números)"], ["32-explorador.jsx", "txid · dirección · altura · hash de bloque"], ["32-explorador.jsx", "Pega aquí tu txid para verificar"],
|
||||
["32-explorador.jsx", "Dirección Bitcoin (bc1q..., bc1p..., 1..., 3...)"], ["70-herramientas.jsx", "Pega una dirección para comprobarla"], ["70-herramientas.jsx", "txid de una transacción"], ["45-seguimiento.jsx", null]];
|
||||
for (const [f, marcador] of filas) {
|
||||
const s = leer(f);
|
||||
if (!marcador) { ok(`${f}: su campo ya encogía (minWidth:0), y sigue`, /flex:"3 1 220px",minWidth:0/.test(s)); continue; }
|
||||
const i = s.indexOf(`placeholder="${marcador}"`);
|
||||
const antes = s.slice(s.lastIndexOf("style={{display:\"flex\"", i), i), despues = s.slice(i, i + 200);
|
||||
ok(`${f} · «${marcador.slice(0, 28)}…»: el campo encoge y la fila salta de línea`, i > 0 && /flexWrap:"wrap"/.test(antes.split("\n")[0]) && /style=\{\{flex:"1 1 150px",minWidth:0,/.test(despues), antes.split("\n")[0]);
|
||||
}
|
||||
const sim = leer("49-simulador-gasto.jsx");
|
||||
ok("el simulador se queda en una línea mientras no haya wallet cargada", /if \(!walletAddrs\) return \(\s*<div data-simulador="plegado"/.test(sim) && sim.indexOf('data-simulador="plegado"') < sim.indexOf("<Card glow={C.amber}>"));
|
||||
ok("…y esa línea dice qué le falta", /Necesita una wallet cargada \(arriba\)\./.test(sim));
|
||||
const inf = leer("22-informe-privacidad.jsx");
|
||||
ok("la cabecera del informe (JSON · MD · TARJETA) salta de línea", /alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:14,paddingTop:14/.test(inf));
|
||||
const aud = leer("50-pestana-auditoria.jsx");
|
||||
ok("las cuatro cifras del informe de wallet saltan de línea, y su columna encoge", /display:"flex",gap:16,rowGap:8,flexWrap:"wrap",marginTop:8/.test(aud) && /<div style=\{\{flex:1,minWidth:0\}\}>\s*<div style=\{\{fontSize:"0\.72rem",color:walletReport\.health\.color/.test(aud));
|
||||
const todos = fs.readdirSync(path.join(__dirname, "..", "src")).filter(f => /\.jsx$/.test(f)).flatMap(f => (leer(f).match(/<input [^>]*?style=\{\{flex:1,[^}]*\}\}/gs) || []).map(() => f));
|
||||
ok("no queda ningún campo de texto con flex:1 y sin minWidth:0 en una fila con botones (salvo el conversor, que va con etiqueta fija)", todos.every(f => f === "70-herramientas.jsx") && todos.length <= 1, todos);
|
||||
|
||||
console.log(`\n${pass} ✓ · ${fail} ✗`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
@@ -0,0 +1,33 @@
|
||||
// v2.1.1 — U3 de la auditoría del 10-nov-2026: el gris tenue (t3) no se leía.
|
||||
// Entre el 4 y el 7 % del texto visible quedaba por debajo de 4,5:1 (el
|
||||
// mínimo de WCAG AA para texto normal), con contrastes de 2,1 a 3,1:1. Y lo
|
||||
// llevaba, entre otros, «Tu papel: no se sabe…», que es información.
|
||||
//
|
||||
// Se aclara t3 (se oscurece en el tema claro) lo justo para llegar a 4,5:1
|
||||
// sobre los tres fondos de cada tema, sin alcanzar a t2: sigue siendo el
|
||||
// texto más discreto.
|
||||
//
|
||||
// Uso: node tests/test58.js
|
||||
const lines = require("./fuente.js")().split("\n");
|
||||
const s = lines.findIndex(l => l.includes("const LETRA_MONO =")), e = lines.findIndex((l, i) => i > s && l.includes("const THEME_META"));
|
||||
if (s === -1 || e === -1) { console.error("No se localizan los temas en el código de la app"); process.exit(1); }
|
||||
const { THEMES } = new Function(lines.slice(s, e).join("\n") + "\nreturn { THEMES };")();
|
||||
let pass = 0, fail = 0;
|
||||
const ok = (n, c, x) => { console.log(` ${c ? "✓" : "✗"} ${n}`); if (!c && x !== undefined) console.log(" " + JSON.stringify(x)); c ? pass++ : fail++; };
|
||||
// Contraste de WCAG 2.x entre dos colores #rrggbb.
|
||||
const lum = h => { const c = [1, 3, 5].map(i => parseInt(h.slice(i, i + 2), 16) / 255).map(v => v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4)); return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; };
|
||||
const contraste = (a, b) => { const x = lum(a), y = lum(b); return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05); };
|
||||
|
||||
console.log("=== U3. El texto gris se lee: 4,5:1 como mínimo ===\n");
|
||||
ok("la fórmula es la de WCAG: negro sobre blanco = 21:1, y #767676 sobre blanco ≈ 4,54:1", Math.abs(contraste("#000000", "#ffffff") - 21) < 1e-9 && Math.abs(contraste("#767676", "#ffffff") - 4.54) < 0.01);
|
||||
const ANTES = { cypherpunk: "#3a4d63", amber: "#6e5226", piedra: "#6c6157", archivo: "#9b9282" };
|
||||
for (const [n, t] of Object.entries(THEMES)) {
|
||||
const fondos = [t.bg, t.bgCard, t.bgHover];
|
||||
const m3 = Math.min(...fondos.map(f => contraste(t.t3, f))), m2 = Math.min(...fondos.map(f => contraste(t.t2, f))), m1 = Math.min(...fondos.map(f => contraste(t.t1, f)));
|
||||
ok(`${n}: el gris tenue (t3 ${t.t3}) llega a 4,5:1 sobre sus tres fondos (antes ${Math.min(...fondos.map(f => contraste(ANTES[n], f))).toFixed(1)}:1, ahora ${m3.toFixed(2)}:1)`, m3 >= 4.5 && Math.min(...fondos.map(f => contraste(ANTES[n], f))) < 3.2, m3);
|
||||
ok(`${n}: el texto secundario (t2) y el principal (t1) también`, m2 >= 4.5 && m1 >= 7, { m2, m1 });
|
||||
ok(`${n}: la jerarquía se mantiene: t3 es más discreto que t2, y t2 que t1`, m3 < m2 && m2 < m1 && t.t3 !== t.t2, { m3, m2, m1 });
|
||||
}
|
||||
|
||||
console.log(`\n${pass} ✓ · ${fail} ✗`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
Reference in New Issue
Block a user