interface Query {
    blocks?: BlockSelection[];
    fieldSelection: FieldSelection;
    fromBlock: number;
    includeAllBlocks?: boolean;
    joinMode?: JoinMode;
    logs?: LogSelection[];
    maxNumBlocks?: number;
    maxNumLogs?: number;
    maxNumTraces?: number;
    maxNumTransactions?: number;
    toBlock?: number;
    traces?: TraceSelection[];
    transactions?: TransactionSelection[];
}

Properties

blocks?: BlockSelection[]

List of block selections, the query will return blocks that match any of these selections

fieldSelection: 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.

fromBlock: number

The block to start the query from

includeAllBlocks?: boolean

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).

joinMode?: JoinMode

Selects join mode for the query, Default: join in this order logs -> transactions -> traces -> blocks JoinAll: join everything to everything. For example if logSelection matches log0, we get the associated transaction of log0 and then we get associated logs of that transaction as well. Applites similarly to blocks, traces. JoinNothing: join nothing.

logs?: LogSelection[]

List of log selections, these have an or relationship between them, so the query will return logs that match any of these selections.

maxNumBlocks?: number

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.

maxNumLogs?: number

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.

maxNumTraces?: number

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.

maxNumTransactions?: number

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.

toBlock?: number

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.

traces?: 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.

transactions?: 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.