|
| 1 | +/// Stream block headers only. The `transactions` field is always empty. |
| 2 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 3 | +#[derive(Clone, PartialEq, ::prost::Message)] |
| 4 | +pub struct BlockHeaderOnly {} |
| 5 | +/// Stream every single block, but each block will only contain transactions that match with `event_filters`. |
| 6 | +/// A TransactionEventFilter message with an empty `event_filters` is invalid. Do not send any filter instead |
| 7 | +/// if you wish to receive full blocks. |
| 8 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 9 | +#[derive(Clone, PartialEq, ::prost::Message)] |
| 10 | +pub struct TransactionEventFilter { |
| 11 | + #[prost(message, repeated, tag = "1")] |
| 12 | + pub event_filters: ::prost::alloc::vec::Vec<ContractEventFilter>, |
| 13 | +} |
| 14 | +/// Only include transactions which emit at least one event that *BOTH* |
| 15 | +/// * is emitted by `contract_address` |
| 16 | +/// * matches with at least one topic in `topics` |
| 17 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 18 | +#[derive(Clone, PartialEq, ::prost::Message)] |
| 19 | +pub struct ContractEventFilter { |
| 20 | + #[prost(bytes = "vec", tag = "1")] |
| 21 | + pub contract_address: ::prost::alloc::vec::Vec<u8>, |
| 22 | + #[prost(message, repeated, tag = "2")] |
| 23 | + pub topics: ::prost::alloc::vec::Vec<TopicWithRanges>, |
| 24 | +} |
| 25 | +/// Matches events whose `keys\[0\]` equals `topic`, *AND* in any of the `block_ranges`. |
| 26 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 27 | +#[derive(Clone, PartialEq, ::prost::Message)] |
| 28 | +pub struct TopicWithRanges { |
| 29 | + #[prost(bytes = "vec", tag = "1")] |
| 30 | + pub topic: ::prost::alloc::vec::Vec<u8>, |
| 31 | + #[prost(message, repeated, tag = "2")] |
| 32 | + pub block_ranges: ::prost::alloc::vec::Vec<BlockRange>, |
| 33 | +} |
| 34 | +/// A range of blocks. Both `start_block` and `end_block` are inclusive. When `end_block` is `0`, it means that any |
| 35 | +/// block height >= `start_block` is matched. |
| 36 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 37 | +#[derive(Clone, PartialEq, ::prost::Message)] |
| 38 | +pub struct BlockRange { |
| 39 | + #[prost(uint64, tag = "1")] |
| 40 | + pub start_block: u64, |
| 41 | + #[prost(uint64, tag = "2")] |
| 42 | + pub end_block: u64, |
| 43 | +} |
0 commit comments