Context
src/indexer.ts only console.logs events. The DB is never updated, so API responses are stale.
Acceptance criteria
- On
request_created: upsert a PaymentRequest row (status='Open').
- On
request_paid: set that row's status='Paid' and store payer.
- On
request_cancelled: set status='Cancelled'.
- Idempotent: re-processing the same ledger window does not duplicate rows.
Technical notes
- Parse event topics/payload per the contract's emitted shape (see contracts issue on structured events).
- Key rows on
(contract, requestId).
- Update
Cursor after each successful window.
Testing
- Unit-test the mapping function with a fixture event object asserting the resulting DB write.
Context
src/indexer.tsonlyconsole.logs events. The DB is never updated, so API responses are stale.Acceptance criteria
request_created: upsert aPaymentRequestrow (status='Open').request_paid: set that row'sstatus='Paid'and storepayer.request_cancelled: setstatus='Cancelled'.Technical notes
(contract, requestId).Cursorafter each successful window.Testing