This example demonstrates how to subscribe to a stream of events from the Sui blockchain using gRPC and parse them in Rust. It specifically shows how to handle and parse the OrderFilled event from the DeepBook V3 protocol.
- Connects to a Sui gRPC endpoint
- Subscribes to real-time checkpoints
- Parses incoming events, with a focus on the
OrderFilledevent from DeepBook V3 - Shows how to deserialize event data into Rust structs for further processing
- Clone this repository.
- Ensure you have Rust installed (
cargoandrustc). - Build and run the example:
cargo run
The code includes a parser for the OrderFilled event from DeepBook V3. When such an event is received, it is deserialized into a strongly-typed Rust struct, making it easy to work with the event data in your application.
You can extend the event parsing logic to handle other event types by adding new variants and deserialization logic in the parse_event.rs file.
This project is licensed under the MIT License. See the LICENSE file for details.