Skip to content

Add Event Filtering Helpers in TypeScript Service #32

@Just-Bamford

Description

@Just-Bamford

��# 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

  • Define SorobanEventFilter and SorobanEventData interfaces
  • Implement sorobanFilterEvents(config, filter) helper
  • Add event type parsing and filtering logic
  • Handle time range queries (startTime, endTime)
  • Unit tests: events filtered by type
  • Unit tests: events filtered by ballot ID and time range

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).

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions