��# Issue 14: Add Event Filtering Helpers in TypeScript Service
Problem
TypeScript service can't efficiently filter contract events by type or ballot ID. Requires manual iteration.
Solution
- Add
SorobanEventFilter interface: eventType, ballotIdHash, startTime, endTime
- Implement
sorobanFilterEvents() helper to query and filter events
- Add
SorobanEventData interface with parsed event fields
- Makes audit trail queries efficient for core services
Implementation Tasks
Note for Contributors
This is a TypeScript service layer feature independent of contract changes. Implement efficient event filtering to support audit queries from AnonVote/core. Query events from the Soroban RPC endpoint using the contract ID and event types. Parse event data into structured SorobanEventData objects. Support multiple filters: event type (e.g., "ballot_created", "token_issued"), ballot ID hash, and time ranges. Filtering is client-side after RPC query; optimize by querying only relevant events from RPC. Consider pagination for large event streams. Use consistent event naming with the contract's emitted events (see Issues #1, #4).
��# Issue 14: Add Event Filtering Helpers in TypeScript Service
Problem
TypeScript service can't efficiently filter contract events by type or ballot ID. Requires manual iteration.
Solution
SorobanEventFilterinterface:eventType,ballotIdHash,startTime,endTimesorobanFilterEvents()helper to query and filter eventsSorobanEventDatainterface with parsed event fieldsImplementation Tasks
SorobanEventFilterandSorobanEventDatainterfacessorobanFilterEvents(config, filter)helperNote for Contributors
This is a TypeScript service layer feature independent of contract changes. Implement efficient event filtering to support audit queries from AnonVote/core. Query events from the Soroban RPC endpoint using the contract ID and event types. Parse event data into structured SorobanEventData objects. Support multiple filters: event type (e.g., "ballot_created", "token_issued"), ballot ID hash, and time ranges. Filtering is client-side after RPC query; optimize by querying only relevant events from RPC. Consider pagination for large event streams. Use consistent event naming with the contract's emitted events (see Issues #1, #4).