import { CheckStateEnum } from '@cashu/cashu-ts';
const ac = new AbortController();
(async () => {
for await (const u of wallet.on.proofStatesStream(proofs, { signal: ac.signal })) {
if (u.state === CheckStateEnum.SPENT) {
console.log('Spent proof', u.proof.id);
}
}
})();
// later
ac.abort();