MCPcopy Create free account
hub / github.com/enviodev/hypersync-client-python / preset_query_logs

Function preset_query_logs

hypersync/__init__.py:1016–1030  ·  view source on GitHub ↗

Returns a query object for all Logs within the block range (from_block, to_block] from the given address. If to_block is None then query runs to the head of the chain. Note: this is only for quickstart purposes. For the best performance, create a custom query that only includes th

(
    address: str, from_block: int, to_block: Optional[int] = None
)

Source from the content-addressed store, hash-verified

1014
1015
1016def preset_query_logs(
1017 address: str, from_block: int, to_block: Optional[int] = None
1018) -> Query:
1019 """
1020 Returns a query object for all Logs within the block range (from_block, to_block] from
1021 the given address. If to_block is None then query runs to the head of the chain.
1022 Note: this is only for quickstart purposes. For the best performance, create a custom query
1023 that only includes the fields you'll use in `field_selection`.
1024 """
1025 return Query(
1026 from_block=from_block,
1027 to_block=to_block,
1028 logs=[LogSelection(address=[address])],
1029 field_selection=FieldSelection(log=[e.value for e in LogField]),
1030 )
1031
1032
1033def preset_query_logs_of_event(

Callers

nothing calls this directly

Calls 3

QueryClass · 0.70
LogSelectionClass · 0.70
FieldSelectionClass · 0.70

Tested by

no test coverage detected