Skip to content

Implement comprehensive event indexing schema with structured topics and versioning#200

Open
AugistineCreates wants to merge 3 commits into
BCPathway:mainfrom
AugistineCreates:event-indexing-schema
Open

Implement comprehensive event indexing schema with structured topics and versioning#200
AugistineCreates wants to merge 3 commits into
BCPathway:mainfrom
AugistineCreates:event-indexing-schema

Conversation

@AugistineCreates
Copy link
Copy Markdown

This pr closes #167

This pull request redesigns the smart contract event emission system and implements a corresponding versioned event indexing and decoding framework within the SDK. The redesign replaces basic, ad-hoc event logs with structured, multi-topic payloads containing critical block and transaction metadata, ensuring robust off-chain event tracking.

Key Changes

Smart Contract (Rust)

  • Centralized event names inside a new EventName enum with explicit conversion to symbols.
  • Implemented a versioned emit_event schema helper in contracts/token/src/events.rs.
  • Structured event topics to always emit: (ContractSymbol, EventName, Version, LedgerSeq, Timestamp, TxHash).
  • Updated contracts/token/src/lib.rs and all emission entry points to use the new standardized structure.

SDK (TypeScript)

  • Defined the versioned schema interfaces EventHeader and DecodedEvent matching the contract topics.
  • Added version-aware decodeEvent and decodeDiagnosticEvent methods to deserialize RPC and transaction simulation events.
  • Added a subscribeEvents handler supporting real-time event polling and client notifications.
  • Created mock unit tests verifying decoding accuracy of the versioned schema parameters.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@AugistineCreates Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement comprehensive event indexing schema with structured topics and versioning

1 participant