código partido en src/: la app no cambia ni un byte

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YA7U5k2DMU8ZdD6MztyVYS
This commit is contained in:
2026-10-20 04:49:54 +02:00
co-authored by Claude Opus 5.5
parent 104d83087b
commit b486f04427
58 changed files with 11525 additions and 11421 deletions
+58
View File
@@ -0,0 +1,58 @@
const MOCK_FEES = { fastestFee:42, halfHourFee:28, hourFee:18, economyFee:8, minimumFee:3 };
const MOCK_MEMPOOL = { count:14821, vsize:28400000, total_fee:310000000 };
const MOCK_HEIGHT = 847293;
const MOCK_DIFF = { difficultyChange:3.42, timeAvg:596000, remainingBlocks:1204 };
const MOCK_BLOCKS = Array.from({length:10}, (_,i) => ({
// Un hash distinto por bloque (antes todos se parecían demasiado).
id: "0000000000000000000" + ((0x2a7c9e1 * (i + 3)).toString(16) + "f3b8d61c94e0a57b2d8c13f6e9a04b75c2d9e81f" + (i * 7919).toString(16)).slice(0, 45),
height: 847293 - i, timestamp: Math.floor(Date.now()/1000) - i*600,
tx_count: 1500 + i*200, size: 1400000 - i*50000, weight: 3900000,
extras: { totalFees: 2000000 - i*100000, medianFee: 35 - i*2, pool: { name: ["Foundry USA","AntPool","F2Pool","ViaBTC","Binance Pool"][i%5] } }
}));
const MOCK_MEMPOOLBLOCKS = [
{nTx:2841, blockVSize:998000, feeRange:[38,45]},
{nTx:2210, blockVSize:985000, feeRange:[25,38]},
{nTx:1890, blockVSize:972000, feeRange:[16,25]},
{nTx:1420, blockVSize:910000, feeRange:[8,16]},
];
const MOCK_TX = {
txid: "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
fee: 4200, feerate: 16.8, size: 374, weight: 996,
status: { confirmed:true, block_height:840811, block_time: Math.floor(Date.now()/1000) - 3891200 },
vin: [
{ sequence: 0xffffffff, txid:"d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5", vout:0, prevout: { value:5000000, scriptpubkey_address:"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", scriptpubkey_type:"v0_p2wpkh" } },
{ sequence: 0xffffffff, txid:"f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1", vout:1, prevout: { value:3000000, scriptpubkey_address:"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", scriptpubkey_type:"v0_p2wpkh" } },
],
vout: [
{ value:7000000, scriptpubkey_address:"bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h", scriptpubkey_type:"v0_p2wpkh" },
{ value:995800, scriptpubkey_address:"bc1qhkfq3zahaqkkzx5mjnamwjsfpq2jk7z09z4832", scriptpubkey_type:"v0_p2wpkh" },
],
};
// Dirección de ejemplo coherente: 4 cobros y 2 gastos (6 transacciones),
// las dos monedas sin gastar salen de dos de los cobros y el saldo
// cuadra con ellas (0,1 + 0,04 = 0,14 BTC).
const MOCK_ADDRESS = (() => {
const ahora = Math.floor(Date.now()/1000), dia = 86400;
const t = (h, alt, d, valor) => ({ txid: h.repeat(16), vout: [{ value: valor, scriptpubkey_address: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh" }],
status: { confirmed: true, block_height: alt, block_time: ahora - d * dia } });
const txs = [
t("7a1e", 902410, 3, 4000000), // cobro → moneda sin gastar
t("6b2f", 901820, 7, 3000000), // gasto
t("5c30", 900950, 13, 3000000), // cobro (gastado después)
t("4d41", 899700, 22, 5000000), // gasto
t("3e52", 898300, 31, 5000000), // cobro (gastado después)
t("2f63", 896500, 44, 10000000), // cobro → moneda sin gastar
];
return {
address: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
chain_stats: { funded_txo_count: 4, funded_txo_sum: 22000000, spent_txo_count: 2, spent_txo_sum: 8000000, tx_count: 6 },
mempool_stats: { funded_txo_count: 0, funded_txo_sum: 0, spent_txo_count: 0, spent_txo_sum: 0, tx_count: 0 },
utxos: [
{ txid: txs[5].txid, vout: 0, value: 10000000, status: { confirmed: true, block_height: 896500 } },
{ txid: txs[0].txid, vout: 0, value: 4000000, status: { confirmed: true, block_height: 902410 } },
],
txs,
};
})();