feat: adding package events to receive contract events #80
feat: adding package events to receive contract events #80ReinhardHatko wants to merge 5 commits intomainfrom
events to receive contract events #80Conversation
… or either best block
|
Can you update the PR description with a sample of how a consumer would use this? I would like to see how this integrates with the existing flows/packages from an end-user's perspective. If possible it would be great to show a sample without this package and then one with this package, so that the value of this is clear. |
|
All that is contained in detail in the readme. Short example: If no descriptors are available, there is also a |
|
@ReinhardHatko , can you add this to the contracts package? Events should live there, no? |
|
Hey Utkarsh, The events package should remain separate from contracts. While the current implementation is scoped to contract events, this is a pragmatic constraint, not a design choice. The reason it's contract-only today is a limitation in how chain-client exposes papi's API: papi's typed .watch() only supports finalized blocks, so best-block subscriptions require the unsafeApi via getClient(descriptor).getUnsafeApi(). This ties the implementation to specific chain descriptors (asset hub), making a generic event watcher impractical without changes upstream. To remove that limitation, we should do:
Integrating it into contracts now would hide reusable subscription infrastructure inside a domain-specific package, making it harder to extract later. |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds package
eventsfor watching contract events using the chain-client underneath.Also supports watching events from
bestorfinalizedblocks.Closes #81