forked from graphprotocol/graph-node
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea636c5
commit e10098e
Showing
6 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
syntax = "proto3"; | ||
|
||
package zklend.starknet.transform.v1; | ||
|
||
option go_package = "github.com/starknet-graph/firehose-starknet/types/pb/zklend/starknet/type/v1;pbtransform"; | ||
|
||
// Stream block headers only. The `transactions` field is always empty. | ||
message BlockHeaderOnly {} | ||
|
||
// Stream every single block, but each block will only contain transactions that match with `event_filters`. | ||
// A TransactionEventFilter message with an empty `event_filters` is invalid. Do not send any filter instead | ||
// if you wish to receive full blocks. | ||
message TransactionEventFilter { | ||
repeated ContractEventFilter event_filters = 1; | ||
} | ||
|
||
// Only include transactions which emit at least one event that *BOTH* | ||
// * is emitted by `contract_address` | ||
// * matches with at least one topic in `topics` | ||
message ContractEventFilter { | ||
bytes contract_address = 1; | ||
repeated TopicWithRanges topics = 2; | ||
} | ||
|
||
// Matches events whose `keys[0]` equals `topic`, *AND* in any of the `block_ranges`. | ||
message TopicWithRanges { | ||
bytes topic = 1; | ||
repeated BlockRange block_ranges = 2; | ||
} | ||
|
||
// A range of blocks. Both `start_block` and `end_block` are inclusive. When `end_block` is `0`, it means that any | ||
// block height >= `start_block` is matched. | ||
message BlockRange { | ||
uint64 start_block = 1; | ||
uint64 end_block = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/// Stream block headers only. The `transactions` field is always empty. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct BlockHeaderOnly {} | ||
/// Stream every single block, but each block will only contain transactions that match with `event_filters`. | ||
/// A TransactionEventFilter message with an empty `event_filters` is invalid. Do not send any filter instead | ||
/// if you wish to receive full blocks. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct TransactionEventFilter { | ||
#[prost(message, repeated, tag = "1")] | ||
pub event_filters: ::prost::alloc::vec::Vec<ContractEventFilter>, | ||
} | ||
/// Only include transactions which emit at least one event that *BOTH* | ||
/// * is emitted by `contract_address` | ||
/// * matches with at least one topic in `topics` | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct ContractEventFilter { | ||
#[prost(bytes = "vec", tag = "1")] | ||
pub contract_address: ::prost::alloc::vec::Vec<u8>, | ||
#[prost(message, repeated, tag = "2")] | ||
pub topics: ::prost::alloc::vec::Vec<TopicWithRanges>, | ||
} | ||
/// Matches events whose `keys\[0\]` equals `topic`, *AND* in any of the `block_ranges`. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct TopicWithRanges { | ||
#[prost(bytes = "vec", tag = "1")] | ||
pub topic: ::prost::alloc::vec::Vec<u8>, | ||
#[prost(message, repeated, tag = "2")] | ||
pub block_ranges: ::prost::alloc::vec::Vec<BlockRange>, | ||
} | ||
/// A range of blocks. Both `start_block` and `end_block` are inclusive. When `end_block` is `0`, it means that any | ||
/// block height >= `start_block` is matched. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct BlockRange { | ||
#[prost(uint64, tag = "1")] | ||
pub start_block: u64, | ||
#[prost(uint64, tag = "2")] | ||
pub end_block: u64, | ||
} |