rosetta_types/events_blocks_request.rs
1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// EventsBlocksRequest : EventsBlocksRequest is utilized to fetch a sequence of BlockEvents indicating which blocks were added and removed from storage to reach the current state.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct EventsBlocksRequest {
15 #[serde(rename = "network_identifier")]
16 pub network_identifier: crate::NetworkIdentifier,
17 /// offset is the offset into the event stream to sync events from. If this field is not populated, we return the limit events backwards from tip. If this is set to 0, we start from the beginning.
18 #[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
19 pub offset: Option<u64>,
20 /// limit is the maximum number of events to fetch in one call. The implementation may return <= limit events.
21 #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
22 pub limit: Option<u64>,
23}
24
25impl EventsBlocksRequest {
26 /// EventsBlocksRequest is utilized to fetch a sequence of BlockEvents indicating which blocks were added and removed from storage to reach the current state.
27 pub fn new(network_identifier: crate::NetworkIdentifier) -> EventsBlocksRequest {
28 EventsBlocksRequest {
29 network_identifier,
30 offset: None,
31 limit: None,
32 }
33 }
34}