const lines = (await Bun.file('/tmp/addrs2.tsv').text()).trim().split('\n'); let hits = 0, totalBal = 0; for (const line of lines) { const [type, path, addr] = line.split('\t'); const proc = Bun.spawn(['curl', '-4', '-s', '--max-time', '12', `https://mempool.space/api/address/${addr}`], { stdout: 'pipe', stderr: 'ignore' }); const body = await new Response(proc.stdout).text(); await proc.exited; try { const j = JSON.parse(body); const c = j.chain_stats, m = j.mempool_stats; const tx = (c?.tx_count ?? 0) + (m?.tx_count ?? 0); if (tx > 0) { const bal = (c.funded_txo_sum - c.spent_txo_sum) + (m.funded_txo_sum - m.spent_txo_sum); totalBal += bal; hits++; console.log(`${type} ${path} ${addr} txs=${tx} balance=${bal}`); } } catch {} await Bun.sleep(70); } console.log(`\nindices20-59: addressesWithHistory=${hits} unspentTotal=${totalBal} sats`); process.exit(0);