pub struct Query {
pub from_block: u64,
pub to_block: Option<u64>,
pub logs: Vec<LogSelection>,
pub transactions: Vec<TransactionSelection>,
pub traces: Vec<TraceSelection>,
pub include_all_blocks: bool,
pub field_selection: FieldSelection,
pub max_num_blocks: Option<usize>,
pub max_num_transactions: Option<usize>,
pub max_num_logs: Option<usize>,
pub max_num_traces: Option<usize>,
}
Fields§
§from_block: u64
The block to start the query from
to_block: Option<u64>
The block to end the query at. If not specified, the query will go until the end of data. Exclusive, the returned range will be [from_block..to_block).
The query will return before it reaches this target block if it hits the time limit configured on the server. The user should continue their query by putting the next_block field in the response into from_block field of their next query. This implements pagination.
logs: Vec<LogSelection>
List of log selections, these have an OR relationship between them, so the query will return logs that match any of these selections.
transactions: Vec<TransactionSelection>
List of transaction selections, the query will return transactions that match any of these selections and it will return transactions that are related to the returned logs.
traces: Vec<TraceSelection>
List of trace selections, the query will return traces that match any of these selections and it will re turn traces that are related to the returned logs.
include_all_blocks: bool
Weather to include all blocks regardless of if they are related to a returned transaction or log. Normally the server will return only the blocks that are related to the transaction or logs in the response. But if this is set to true, the server will return data for all blocks in the requested range [from_block, to_block).
field_selection: FieldSelection
Field selection. The user can select which fields they are interested in, requesting less fields will improve query execution time and reduce the payload size so the user should always use a minimal number of fields.
max_num_blocks: Option<usize>
Maximum number of blocks that should be returned, the server might return more blocks than this number but it won’t overshoot by too much.
max_num_transactions: Option<usize>
Maximum number of transactions that should be returned, the server might return more transactions than this number but it won’t overshoot by too much.
max_num_logs: Option<usize>
Maximum number of logs that should be returned, the server might return more logs than this number but it won’t overshoot by too much.
max_num_traces: Option<usize>
Maximum number of traces that should be returned, the server might return more traces than this number but it won’t overshoot by too much.