Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starknet_subscribeEvents #2216

Open
sistemd opened this issue Sep 4, 2024 · 0 comments
Open

starknet_subscribeEvents #2216

sistemd opened this issue Sep 4, 2024 · 0 comments
Assignees

Comments

@sistemd
Copy link
Contributor

sistemd commented Sep 4, 2024

The starknet_subscribeEvents websocket endpoint accepts from_address and keys filter arguments (these correspond roughly to the EventFilterParams type in our legacy websocket interface), as well as a block argument which serves as the block ID (pathfinder_common::BlockId) to start streaming from. It returns a stream of emitted events (pathfinder_storage::EmittedEvent).

The filtering code should remain the same as what we have right now in our legacy websocket interface.

In case of a reorg, this endpoint will stream a reorg message of the following format:

{
  "starting_block_hash": "the block hash from which the reorg starts",
  "starting_block_number": "the block number from which the reorg starts",
  "ending_block_hash": "the block hash at which the reorg ends",
  "ending_block_number": "the block number at which the reorg ends"
}
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

No branches or pull requests

1 participant