deviant/scripts/_check-escrow.mjs
Local Dev ced2eda48d @
chore: checkpoint in-flight work across domains

Sweep of accumulated uncommitted work on design/dex-p2p-architecture into
one checkpoint (multiple sessions share this tree). Main areas:

- anthemus: covenant-wiring follow-ups (engine, ExchangePanel), AgoraScreen seam
- spv: ServerPool + p2p header transport (pool.ts, core/spv/*), wallet.ts wiring
- walletconnect: responder/useConnect updates + connect-responder-compat test
- wallet: send-tier-a rework + swap.ts, plus send-tier-a unit tests
- asm: chipnet throughput/stress harness (scripts/chipnet-asm-*) + ASM_Native docs
- app UI: screens/* and shell.css touch-ups; sat -> bits copy migration
- docs: new snapshots (INDEX regenerated), Parameters (WalletConnect/SSH/ASM),
  KnowledgeBase, WALLET-COORDINATION changelog

Checkpoint only; not a release. Secrets (Keys/, .chipnet-keys*, .env) remain
gitignored and were verified absent from the staged set.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@
2026-08-14 02:00:43 +02:00

15 lines
987 B
JavaScript

import { ElectrumNetworkProvider } from 'cashscript';
const prov = new ElectrumNetworkProvider('chipnet');
const CONTRACT = 'bchtest:rdj5sng0p30q983sjmc8ds7xujh828j62cztchetqdxka5vf3y84jd5qk94mu';
const D = 'bchtest:qzjqnzgjz7w9tdflpz6ufx0rnrnfu4hsps9rznw4dl';
const ASM = '09af8a5b2fc2c9a2449045a8d5a6aa60db493989682eca257a57fa8d75d67231';
const TX = 'e9b0d666180270935b70769dc61f91c95643fd587f29f18bb85a36d06a40a148';
const covUtxos = await prov.getUtxos(CONTRACT);
const fromMyTx = covUtxos.filter(u => u.txid === TX);
console.log(`Contract UTXOs from tx ${TX.slice(0, 12)}…: ${fromMyTx.length}`);
for (const u of fromMyTx) console.log(` vout ${u.vout} · ${u.satoshis} sats · token ${u.token?.amount} of ${u.token?.category?.slice(0, 10)}…`);
const dUtxos = await prov.getUtxos(D);
const dAsm = dUtxos.filter(u => u.token?.category === ASM).reduce((s, u) => s + BigInt(u.token.amount), 0n);
console.log(`Wallet D remaining ASM: ${dAsm} (was 1000, escrowed 10, expect 990)`);