diff --git a/.gitignore b/.gitignore index 0994d83a..6b8d93bf 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,6 @@ playwright/ # generated from index.html by scripts/gen-index.ts src/apps/officer-web/index.gen.html + +# scratch scripts — never commit these +*.tmp.ts diff --git a/check2.tmp.ts b/check2.tmp.ts deleted file mode 100644 index f7c962d5..00000000 --- a/check2.tmp.ts +++ /dev/null @@ -1,20 +0,0 @@ -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);