v1.24.2: Satoshi→Hal y las pizzas — P2PK, comisión 0, tarifa, importes redondos, frase de la banda; MB con coma, ₿ en SVG; test11.js
This commit is contained in:
+95
-41
@@ -86,6 +86,23 @@
|
||||
// Lo que escribe la persona en un campo de BTC: acepta coma o punto decimal.
|
||||
const leerBtc = txt => { const v = parseFloat(String(txt || "").replace(/\s|\u202F/g, "").replace(",", ".")); return isFinite(v) ? Math.round(v * 1e8) : 0; };
|
||||
const fmtMoneda = v => Number(v).toLocaleString("es-ES", { minimumFractionDigits:2, maximumFractionDigits:2 });
|
||||
// Números con decimales (MB, GB, sat/vB…): coma decimal, sin agrupar miles con punto.
|
||||
const fmtDec = (v, d) => { const n = Number(v); return isFinite(n) ? n.toLocaleString("es-ES", { minimumFractionDigits:d, maximumFractionDigits:d, useGrouping:false }) : String(v ?? "—"); };
|
||||
// Comisión, tamaño y tarifa de una tx. Un 0 es un dato, no un hueco: las
|
||||
// primeras transacciones solían no pagar comisión. Mempool/Esplora no
|
||||
// devuelve «feerate», así que la tarifa se calcula: fee / (weight / 4).
|
||||
function comisionDe(tx) {
|
||||
let fee = (typeof tx?.fee === "number" && isFinite(tx.fee)) ? tx.fee : null;
|
||||
if (fee == null && (tx?.vin || []).length && (tx.vin || []).every(v => typeof v.prevout?.value === "number")) {
|
||||
const tin = tx.vin.reduce((s, v) => s + v.prevout.value, 0), tout = (tx.vout || []).reduce((s, o) => s + (o.value || 0), 0);
|
||||
if (tin >= tout) fee = tin - tout;
|
||||
}
|
||||
const vsize = tx?.weight ? Math.ceil(tx.weight / 4) : (typeof tx?.vsize === "number" ? tx.vsize : (typeof tx?.size === "number" ? tx.size : null));
|
||||
const tasa = (fee != null && vsize) ? fee / vsize : (tx?.feerate != null && isFinite(Number(tx.feerate)) ? Number(tx.feerate) : null);
|
||||
return { fee, vsize, tasa };
|
||||
}
|
||||
const fmtFee = c => c.fee == null ? "—" : `${Number(c.fee).toLocaleString("es-ES")} sat`;
|
||||
const fmtTasa = c => c.tasa == null ? "—" : `${fmtDec(c.tasa, c.tasa >= 100 ? 1 : 2)} sat/vB`;
|
||||
// ── fin formato ─────────────────────────────────────────────────────────
|
||||
|
||||
// ── ALMACÉN: lógica pura (probada en tests/test10.js) ──────────────────
|
||||
@@ -1801,10 +1818,17 @@
|
||||
v0_p2wsh: "SegWit de script, p. ej. multifirma (bc1q…)",
|
||||
v1_p2tr: "Taproot (bc1p…)", p2tr: "Taproot (bc1p…)",
|
||||
p2pkh: "antiguo (1…)", p2sh: "de script antiguo (3…)",
|
||||
p2pk: "pago directo a clave pública (P2PK, sin dirección)", multisig: "multifirma desnuda (sin dirección)",
|
||||
op_return: "datos (OP_RETURN)",
|
||||
};
|
||||
const formatoDir = t => FORMATO_DIR[t] || (t ? `otro formato (${t})` : "desconocido");
|
||||
|
||||
// Identidad de una salida: su dirección o, si no tiene (pago directo a una
|
||||
// clave pública, P2PK; multifirma desnuda), su script. Comparar solo por
|
||||
// dirección hacía invisible que el cambio volviera a la misma clave.
|
||||
const idSalida = o => o ? (o.scriptpubkey_address || (o.scriptpubkey ? "script:" + o.scriptpubkey : null)) : null;
|
||||
const idEntrada = v => idSalida(v?.prevout);
|
||||
const etiquetaSinDir = o => !o ? "—" : o.scriptpubkey_type === "p2pk" ? "clave pública (P2PK, sin dirección)" : o.scriptpubkey_type === "multisig" ? "multifirma desnuda (sin dirección)" : o.scriptpubkey_type === "op_return" ? "datos (OP_RETURN)" : "sin dirección";
|
||||
// Una salida OP_RETURN no es una moneda: es un dato escrito en la cadena.
|
||||
const esSalidaDeDatos = v => v.scriptpubkey_type === "op_return" || (v.scriptpubkey || "").startsWith("6a");
|
||||
|
||||
@@ -1854,10 +1878,10 @@
|
||||
// devuelven el cambio a un tipo distinto del que gastan.
|
||||
if (tx.vout.length > 2) {
|
||||
const reusaIdx = tx.vout.findIndex(v =>
|
||||
v.scriptpubkey_address && tx.vin.some(i => i.prevout?.scriptpubkey_address === v.scriptpubkey_address));
|
||||
idSalida(v) && tx.vin.some(i => idEntrada(i) === idSalida(v)));
|
||||
if (reusaIdx !== -1) {
|
||||
return { identifiable: true, index: reusaIdx, signals: 2, bonus: 10, certainty: "PROBABLE",
|
||||
details: [`de ${tx.vout.length} salidas, una vuelve a una dirección de las entradas — cambio casi seguro`] };
|
||||
return { identifiable: true, index: reusaIdx, signals: 2, bonus: 10, certainty: "CERTEZA",
|
||||
details: [`de ${tx.vout.length} salidas, una vuelve a la misma dirección o clave que gasta: es el cambio`] };
|
||||
}
|
||||
if (!dominantInType) return SIN_CAMBIO;
|
||||
const coinciden = tx.vout.filter(comparteFormato);
|
||||
@@ -1882,7 +1906,7 @@
|
||||
});
|
||||
const isBip69 = isBip69Inputs && isBip69Outputs;
|
||||
const roundOutputs = tx.vout.filter(v => roundness(v.value) >= ROUND_MIN);
|
||||
const inputAddrs = tx.vin.map(v=>v.prevout?.scriptpubkey_address).filter(Boolean);
|
||||
const inputAddrs = tx.vin.map(idEntrada).filter(Boolean);
|
||||
const inputAddrSet = new Set(inputAddrs);
|
||||
const totalIn = tx.vin.reduce((s,v)=>s+(v.prevout?v.prevout.value:0),0);
|
||||
|
||||
@@ -1942,11 +1966,11 @@
|
||||
|
||||
// ── Señal D: un output vuelve a una dirección de las entradas.
|
||||
// La más fuerte de todas: el cambio es esa, sin ambigüedad.
|
||||
const knownAddrIdx = tx.vout.findIndex(v=>v.scriptpubkey_address && inputAddrSet.has(v.scriptpubkey_address));
|
||||
const knownAddrIdx = tx.vout.findIndex(v=>idSalida(v) && inputAddrSet.has(idSalida(v)));
|
||||
const outputToKnownAddr = knownAddrIdx !== -1;
|
||||
if (outputToKnownAddr) {
|
||||
signals += 2; bonus += 10;
|
||||
details.push("una salida reutiliza una dirección de las entradas — cambio casi seguro");
|
||||
details.push("una salida vuelve a la misma dirección o clave que gasta: es el cambio");
|
||||
}
|
||||
|
||||
// ── Señal E: posición fija del cambio, solo si la señal A no dijo ya
|
||||
@@ -1964,7 +1988,9 @@
|
||||
if (signals >= 3) bonus += 5;
|
||||
|
||||
const identifiable = signals >= 2;
|
||||
const certainty = bonus >= 10 ? "PROBABLE" : signals >= 2 ? "PROBABLE" : "POSIBLE";
|
||||
// Pagar a la misma dirección o clave que se está gastando no deja duda
|
||||
// de cuál es el cambio: CERTEZA. Lo demás son indicios combinados.
|
||||
const certainty = outputToKnownAddr ? "CERTEZA" : signals >= 2 ? "PROBABLE" : "POSIBLE";
|
||||
|
||||
// Índice del cambio, por orden de fuerza. Solo señalan las que de verdad
|
||||
// apuntan a un output; si ninguna lo hace, el índice queda en null y se
|
||||
@@ -2022,7 +2048,8 @@
|
||||
|
||||
const totalIn = tx.vin.reduce((s,v)=>s+(v.prevout?v.prevout.value:0),0);
|
||||
const totalOut = tx.vout.reduce((s,v)=>s+v.value,0);
|
||||
const fee = tx.fee || (totalIn > totalOut ? totalIn - totalOut : 0);
|
||||
const comision = comisionDe(tx);
|
||||
const fee = comision.fee ?? 0;
|
||||
const outputValues = tx.vout.map(v=>v.value);
|
||||
// Outputs gastables: excluimos OP_RETURN (no son monedas, son datos).
|
||||
// Whirlpool puede llevar un OP_RETURN además de las salidas mezcladas,
|
||||
@@ -2105,7 +2132,7 @@
|
||||
&& tx.vout.length >= 2;
|
||||
|
||||
// ── 1. Reutilización de direcciones en inputs ─────────────────────
|
||||
const inputAddrs = tx.vin.map(v=>v.prevout?.scriptpubkey_address).filter(Boolean);
|
||||
const inputAddrs = tx.vin.map(idEntrada).filter(Boolean); // dirección, o script si no hay
|
||||
const uniqueInputAddrs = new Set(inputAddrs);
|
||||
const hasInputReuse = uniqueInputAddrs.size < inputAddrs.length;
|
||||
checks.push({
|
||||
@@ -2225,16 +2252,21 @@
|
||||
// 0,5 BTC clavados delata mucho más que pagar 0,0123 BTC. El peso va
|
||||
// del 60% al 100% del máximo según el nivel devuelto por roundness().
|
||||
const roundOutputs = tx.vout.filter(v => roundness(v.value) >= ROUND_MIN);
|
||||
const hasRound = roundOutputs.length > 0 && tx.vout.length === 2 && !likelyCJ;
|
||||
// Si TODAS las salidas gastables son redondas, la cifra no señala cuál
|
||||
// es el pago: no cuenta en contra, se informa.
|
||||
const todasRedondas = spendableOuts.length >= 2 && spendableOuts.every(v => roundness(v.value) >= ROUND_MIN);
|
||||
const hasRound = roundOutputs.length > 0 && tx.vout.length === 2 && !likelyCJ && !todasRedondas;
|
||||
const roundLevel = hasRound ? Math.max(...roundOutputs.map(v => roundness(v.value))) : 0;
|
||||
const roundNames = { 2: "múltiplo de 0,0001 BTC", 3: "múltiplo de 0,001 BTC", 4: "múltiplo de 0,1 BTC" };
|
||||
const pesoRedondo = Math.round(weights.round_numbers * (roundLevel >= 4 ? 1 : roundLevel === 3 ? 0.8 : 0.6));
|
||||
checks.push({
|
||||
id:"round_numbers", label: hasRound ? "Salida de importe redondo" : "Ninguna salida de importe redondo", certainty:"PROBABLE", pass:!hasRound,
|
||||
id:"round_numbers", label: hasRound ? "Salida de importe redondo" : todasRedondas ? "Todas las salidas son redondas (no distingue el pago)" : "Ninguna salida de importe redondo", certainty:"PROBABLE", pass:!hasRound,
|
||||
actionability: "evitable",
|
||||
detail: hasRound
|
||||
? `Hecho (certeza): una de las dos salidas vale exactamente ${fmtBtc(roundOutputs[0].value)} — ${roundNames[roundLevel] || "una cifra redonda"}. Interpretación (probable): las personas pagan cantidades redondas y el cambio sale de la resta, así que ese suele ser el pago y el otro el cambio. No siempre: una consolidación o un pago calculado al céntimo rompen la regla. Consecuencia: si acierta, queda señalada la dirección de cambio del emisor — y con ella, por dónde seguir sus gastos futuros.`
|
||||
: (tx.vout.length === 2 && !likelyCJ
|
||||
: (todasRedondas && !likelyCJ
|
||||
? "Todas las salidas tienen importes redondos, así que la cifra no distingue cuál es el pago y cuál el cambio."
|
||||
: tx.vout.length === 2 && !likelyCJ
|
||||
? "Ninguna de las dos salidas tiene un importe redondo."
|
||||
: "Esta comprobación solo se aplica a transacciones corrientes de dos salidas."),
|
||||
didactic: "Las personas pagan cantidades redondas (0,001, 0,01, 0,1 BTC) y el cambio es lo que sobra, con todos sus decimales. De ahí la regla: en una transacción de dos salidas, la redonda suele ser el pago y la irregular el cambio. Cuanto más redonda la cifra, más fuerte la señal. Suele, no siempre — hay consolidaciones y pagos calculados al céntimo que la desmienten. Y hay un punto ciego que conviene conocer: si pagas una cantidad redonda en euros o dólares, en BTC sale un número con todos sus decimales y esta heurística no ve nada.",
|
||||
@@ -2265,9 +2297,7 @@
|
||||
const maxOut = Math.max(...outputValues);
|
||||
// Tarifa real de la tx en sat/vB (misma fuente que se muestra en pantalla):
|
||||
// fee/vsize donde vsize ≈ weight/4. Fallbacks: feerate declarado, o 10 sat/vB.
|
||||
const vsize = tx.weight ? Math.ceil(tx.weight / 4) : null;
|
||||
const feeRate = (tx.fee && vsize) ? (tx.fee / vsize)
|
||||
: (tx.feerate ? Number(tx.feerate) : 10);
|
||||
const feeRate = comision.tasa ?? 10;
|
||||
const singleInputCovers = tx.vin.some(v => {
|
||||
const val = v.prevout?.value || 0;
|
||||
const type = v.prevout?.scriptpubkey_type || "";
|
||||
@@ -2424,9 +2454,9 @@
|
||||
});
|
||||
const entradasNormalesL = tx.vin.filter(v => !esAncla(v) && !entradasPolvo.includes(v));
|
||||
const entradasNormales = entradasNormalesL.length;
|
||||
const dirsNormales = new Set(entradasNormalesL.map(v=>v.prevout?.scriptpubkey_address).filter(Boolean));
|
||||
const dirsNormales = new Set(entradasNormalesL.map(idEntrada).filter(Boolean));
|
||||
const polvoQueVincula = entradasPolvo.filter(v => {
|
||||
const a = v.prevout?.scriptpubkey_address;
|
||||
const a = idEntrada(v);
|
||||
return !a || !dirsNormales.has(a);
|
||||
});
|
||||
const polvoGastadoJunto = !likelyCJ && polvoQueVincula.length > 0 && entradasNormales > 0;
|
||||
@@ -2648,8 +2678,8 @@
|
||||
// es débil y castigarla empujaría a elegir comisiones peores para
|
||||
// esconderla. Mal negocio, y esta herramienta no está para eso.
|
||||
const vsizeReal = tx.weight ? Math.ceil(tx.weight / 4) : null;
|
||||
const tarifaReal = (tx.fee && vsizeReal) ? tx.fee / vsizeReal : null;
|
||||
const comisionRedonda = tx.fee ? roundness(tx.fee) >= 2 : false;
|
||||
const tarifaReal = comision.tasa;
|
||||
const comisionRedonda = comision.fee ? roundness(comision.fee) >= 2 : false;
|
||||
const tarifaEntera = tarifaReal !== null
|
||||
&& Math.abs(tarifaReal - Math.round(tarifaReal)) < 0.03
|
||||
&& Math.round(tarifaReal) >= 2;
|
||||
@@ -2672,12 +2702,14 @@
|
||||
// Inputs en formato legacy (P2PKH = 1..., P2SH = 3...) revelan UTXOs antiguos
|
||||
// o wallets que no han migrado a SegWit/Taproot. Mayor huella on-chain y
|
||||
// menor anonimato en el conjunto de usuarios modernos.
|
||||
const legacyTypes = ["p2pkh", "p2sh"];
|
||||
// P2PK (pago directo a una clave pública, sin dirección) y la
|
||||
// multifirma desnuda también son formatos antiguos.
|
||||
const legacyTypes = ["p2pkh", "p2sh", "p2pk", "multisig"];
|
||||
const allInputScriptTypes = [...new Set(tx.vin.map(v=>v.prevout?.scriptpubkey_type).filter(Boolean))];
|
||||
const hasLegacyInputs = allInputScriptTypes.some(t => legacyTypes.includes(t));
|
||||
const legacyInputTypes = allInputScriptTypes.filter(t => legacyTypes.includes(t));
|
||||
checks.push({
|
||||
id:"legacy_type", label: hasLegacyInputs ? "Entradas en formato antiguo (direcciones 1… o 3…)" : "Entradas en formato moderno (SegWit o Taproot)", certainty:"CERTEZA",
|
||||
id:"legacy_type", label: hasLegacyInputs ? "Entradas en formato antiguo (1…, 3… o pago directo a clave pública)" : "Entradas en formato moderno (SegWit o Taproot)", certainty:"CERTEZA",
|
||||
pass: !hasLegacyInputs,
|
||||
actionability: "wallet",
|
||||
detail: hasLegacyInputs
|
||||
@@ -2809,6 +2841,17 @@
|
||||
};
|
||||
}
|
||||
|
||||
// La frase bajo la nota de una transacción. Si falla algo con CERTEZA, no
|
||||
// puede decir «ninguno decisivo por sí solo».
|
||||
function fraseBanda(analysis) {
|
||||
const seguro = (analysis.checks || []).some(c => !c.pass && !c.informational && !c.heredado && c.certainty === "CERTEZA");
|
||||
return analysis.band === "ALTA"
|
||||
? (seguro ? "Pocos rasgos que faciliten rastrearla, aunque alguno es seguro (CERTEZA)." : "No se ve en esta transacción ningún fallo propio que facilite rastrearla.")
|
||||
: analysis.band === "MEDIA"
|
||||
? (seguro ? "Tiene rasgos que dan pistas a quien la analice, y alguno es seguro (CERTEZA)." : "Hay rasgos que dan pistas a quien la analice, aunque ninguno decisivo por sí solo.")
|
||||
: "Esta transacción tiene rasgos que facilitan su rastreo.";
|
||||
}
|
||||
|
||||
function analyzeAddress(addr) {
|
||||
const checks = []; let score = 100;
|
||||
const txCount = addr.chain_stats ? addr.chain_stats.tx_count : 0;
|
||||
@@ -2987,9 +3030,17 @@
|
||||
sbtc: s => fmtBtc(s),
|
||||
sats: s => fmtBtc(s),
|
||||
num: n => Number(n).toLocaleString("es-ES"),
|
||||
mb: b => `${(b/1e6).toFixed(2)} MB`,
|
||||
mb: b => `${fmtDec(b/1e6, 2)} MB`,
|
||||
};
|
||||
|
||||
// El símbolo ₿ (U+20BF) no está en todas las letras y salía como un
|
||||
// cuadrado: se dibuja.
|
||||
const IconoBtc = ({size}) => (
|
||||
<svg width={size||12} height={size||12} viewBox="0 0 24 24" aria-label="Bitcoin" style={{flexShrink:0,verticalAlign:"middle"}}>
|
||||
<circle cx="12" cy="12" r="11" fill={C.amber}/>
|
||||
<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 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;
|
||||
@@ -3396,7 +3447,7 @@
|
||||
{analysis.unused
|
||||
? "Esta dirección no se ha usado todavía. No tiene historial en la cadena que analizar."
|
||||
: tx
|
||||
? (analysis.band==="ALTA"?"No se ve en esta transacción ningún fallo propio que facilite rastrearla.":analysis.band==="MEDIA"?"Hay rasgos que dan pistas a quien la analice, aunque ninguno decisivo por sí solo.":"Esta transacción tiene rasgos que facilitan su rastreo.")
|
||||
? fraseBanda(analysis)
|
||||
: (analysis.band==="ALTA"?"No se ve en esta dirección nada que facilite rastrearla.":analysis.band==="MEDIA"?"Hay rasgos que dan pistas a quien la analice, aunque ninguno decisivo por sí solo.":"Esta dirección tiene rasgos que facilitan su rastreo.")}
|
||||
</div>
|
||||
{wallets&&wallets.length>0&&(
|
||||
@@ -3629,7 +3680,7 @@
|
||||
{/* 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}}>
|
||||
<span>₿</span> Bitcoin Core {base&&salud.esEjemplo("/system/bitcoin")&&<Badge color={C.amber}>EJEMPLO · no contesta</Badge>}
|
||||
<IconoBtc/> Bitcoin Core {base&&salud.esEjemplo("/system/bitcoin")&&<Badge color={C.amber}>EJEMPLO · no contesta</Badge>}
|
||||
<div style={{flex:1,height:1,background:`linear-gradient(to right,${C.amber}40,transparent)`}}/>
|
||||
</div>
|
||||
{!btcData ? <Spinner/> : (
|
||||
@@ -3640,7 +3691,7 @@
|
||||
<Tag label="Entrantes" value={btcData.inbound} color={C.t1}/>
|
||||
<Tag label="Salientes" value={btcData.outbound} color={C.t1}/>
|
||||
<Tag label="Sincronizado" value={btcData.synced?"Sí ✓":"No (" + btcData.progress + "%)"} color={btcData.synced?C.green:C.amber}/>
|
||||
<Tag label="Blockchain" value={`${btcData.size_gb} GB`} color={C.t1}/>
|
||||
<Tag label="Blockchain" value={`${fmtDec(btcData.size_gb, 1)} GB`} color={C.t1}/>
|
||||
<Tag label="Uptime" value={btcData.uptime_sec ? `${Math.floor(btcData.uptime_sec/86400)}d ${Math.floor((btcData.uptime_sec%86400)/3600)}h` : "—"} color={C.t1}/>
|
||||
</div>
|
||||
)}
|
||||
@@ -3689,7 +3740,7 @@
|
||||
<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}}>{sysData.ram.used_gb} / {sysData.ram.total_gb} GB</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>
|
||||
<div>
|
||||
@@ -3700,7 +3751,7 @@
|
||||
<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}}>{sysData.ram.swap_used_gb||0} / {sysData.ram.swap_total_gb||0} GB</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>
|
||||
</div>
|
||||
|
||||
@@ -4469,9 +4520,10 @@
|
||||
</div>
|
||||
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(120px,1fr))",gap:10}}>
|
||||
<Tag label="Estado" value={result.confs===0?"Pendiente":"Confirmada"} color={statusColor}/>
|
||||
<Tag label="Bloque" value={result.tx.status?.block_height?`#${fmt.num(result.tx.status.block_height)}`:"mempool"} color={C.purple}/>
|
||||
<Tag label="Fee pagado" value={result.tx.fee?`${fmt.num(result.tx.fee)} sat`:"-"} color={C.amber}/>
|
||||
<Tag label="Tasa fee" value={result.tx.fee&&result.tx.weight?`${(result.tx.fee/Math.ceil(result.tx.weight/4)).toFixed(1)} sat/vB`:result.tx.feerate?`${Number(result.tx.feerate).toFixed(1)} sat/vB`:"-"} color={C.amber}/>
|
||||
<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}}>Comisión 0: no es un dato que falte. Las primeras transacciones de Bitcoin solían no pagar comisión.</div>}
|
||||
<Tag label="Confirmado" value={result.tx.status?.block_time?fmt.date(result.tx.status.block_time):"-"} color={C.t1}/>
|
||||
<Tag label="vSize" value={result.tx.weight?`${Math.ceil(result.tx.weight/4)} vB`:"-"} color={C.t1}/>
|
||||
</div>
|
||||
@@ -5925,7 +5977,7 @@
|
||||
// Parada de una salida concreta.
|
||||
function paradaSalida(tx, i, gasto) {
|
||||
const o = tx?.vout?.[i];
|
||||
if (!o?.scriptpubkey_address) return { motivo:"datos", titulo:"Sin dirección", texto:"Esta salida no tiene dirección (datos u otro script): no se puede seguir." };
|
||||
if (!o?.scriptpubkey_address) return { motivo:"datos", titulo:"Sin dirección", texto:"Esta salida no tiene dirección (datos, pago directo a una clave pública u otro script). Su historial no se puede consultar por dirección, así que no se puede seguir desde aquí." };
|
||||
const e = entidadDe(o.scriptpubkey_address);
|
||||
if (e?.cat === "exchange") return { motivo:"exchange", certeza:certezaExchange(e.src), entidad:e.name,
|
||||
titulo:`Parada: depósito en ${e.name}`,
|
||||
@@ -6268,7 +6320,7 @@
|
||||
<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>
|
||||
<span style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>Entrada {i+1} · {abrevDir(v.prevout?.scriptpubkey_address)}</span>
|
||||
<span style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>Entrada {i+1} · {v.prevout?.scriptpubkey_address?abrevDir(v.prevout.scriptpubkey_address):etiquetaSinDir(v.prevout)}</span>
|
||||
</div>
|
||||
{sePuede&&<span style={{fontFamily:C.mono,color:C.purple,fontSize:"0.78rem",whiteSpace:"nowrap"}}>{isMobile?"seguir ›":"›"}</span>}
|
||||
</div>
|
||||
@@ -6664,7 +6716,7 @@
|
||||
<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>
|
||||
<span style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>Salida {i+1} (vout {i}) · {abrevDir(o.scriptpubkey_address)}</span>
|
||||
<span style={{fontFamily:C.mono,fontSize:"0.64rem",color:C.t2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}>Salida {i+1} (vout {i}) · {o.scriptpubkey_address?abrevDir(o.scriptpubkey_address):etiquetaSinDir(o)}</span>
|
||||
</div>
|
||||
{seguible&&<span style={{fontFamily:C.mono,color:C.red,fontSize:"0.78rem",whiteSpace:"nowrap"}}>{isMobile?"seguir ›":"›"}</span>}
|
||||
</div>
|
||||
@@ -7587,8 +7639,9 @@
|
||||
{tx.status?.confirmed?<Badge color={C.green}>#{fmt.num(tx.status.block_height)}</Badge>:<Badge color={C.amber}>MEMPOOL</Badge>}
|
||||
</div>
|
||||
<div style={{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(120px,1fr))",gap:10,paddingTop:10,borderTop:`1px solid ${C.border}`}}>
|
||||
<Tag label="Fee" value={tx.fee?`${fmt.num(tx.fee)} sat`:"-"} color={C.amber}/>
|
||||
<Tag label="Tasa fee" value={tx.feerate?`${Number(tx.feerate).toFixed(1)} sat/vB`:"-"} color={C.amber}/>
|
||||
<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}}>Comisión 0: no es un dato que falte. Las primeras transacciones de Bitcoin solían no pagar comisión.</div>}
|
||||
<Tag label="vSize" 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}/>
|
||||
@@ -8055,9 +8108,10 @@
|
||||
{tx.status&&tx.status.confirmed?<Badge color={C.green}>#{fmt.num(tx.status.block_height)} conf</Badge>:<Badge color={C.amber}>PENDIENTE</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?`#${fmt.num(tx.status.block_height)}`:"mempool"} color={C.purple}/>
|
||||
<Tag label="Fee" value={tx.fee?`${fmt.num(tx.fee)} sat`:"-"} color={C.amber}/>
|
||||
<Tag label="Tasa fee" value={tx.feerate?`${Number(tx.feerate).toFixed(1)} sat/vB`:"-"} color={C.amber}/>
|
||||
<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}}>Comisión 0: no es un dato que falte. Las primeras transacciones de Bitcoin solían no pagar comisión.</div>}
|
||||
<Tag label="vSize" value={tx.weight?`${Math.ceil(tx.weight/4)} vB`:"-"}/>
|
||||
<Tag label="Tamaño" value={tx.size?`${tx.size} B`:"-"}/>
|
||||
<Tag label="Fecha" value={tx.status&&tx.status.block_time?fmt.date(tx.status.block_time):"-"}/>
|
||||
@@ -8069,9 +8123,9 @@
|
||||
</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,5).map((inp,i)=><div key={i} style={{paddingBottom:8,marginBottom:8,borderBottom:i<Math.min(tx.vin.length,5)-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"}}>{fmt.hash(inp.prevout&&inp.prevout.scriptpubkey_address)}</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>)}</Card>
|
||||
<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,5).map((inp,i)=><div key={i} style={{paddingBottom:8,marginBottom:8,borderBottom:i<Math.min(tx.vin.length,5)-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?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>)}</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,5).map((out,i)=><div key={i} style={{paddingBottom:8,marginBottom:8,borderBottom:i<Math.min(tx.vout.length,5)-1?`1px solid ${C.border}`:"none"}}><div style={{fontSize:"0.62rem",fontFamily:C.mono,color:C.blue,marginBottom:3,wordBreak:"break-all"}}>{fmt.hash(out.scriptpubkey_address)}</div><div style={{fontSize:"0.68rem",color:C.green,fontFamily:C.mono}}>{fmt.btc(out.value)}</div></div>)}</Card>
|
||||
<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,5).map((out,i)=><div key={i} style={{paddingBottom:8,marginBottom:8,borderBottom:i<Math.min(tx.vout.length,5)-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?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>)}</Card>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -9351,7 +9405,7 @@
|
||||
<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 · v1.24.1</span>
|
||||
<span style={{fontFamily:C.mono,fontSize:"0.62rem",color:C.t2,letterSpacing:"0.05em"}}>· tu nodo, tus reglas · v1.24.2</span>
|
||||
</footer>
|
||||
{showConfig&&<ConfigModal config={config} themeId={themeId} onTheme={switchTheme} onSave={cfg=>{setConfig(cfg);setShowConfig(false);}} onClose={()=>setShowConfig(false)}/>}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user