LogResult
Documentation for eth_defi.event_reader.logresult.LogResult Python class.
- class LogResult[source]
One emitted Solidity event.
Type mappings for a raw Python
dict
objectDesigned for high performance at the cost of readability and usability
The values are untranslated hex strings to maximize the reading speed of events
See
decode_event()
how to turn to ABI converted dataSee
eth_defi.event_reader.reader
for more information
Example data (PancakeSwap swap):
{ 'address': '0xc91cd2b9c9aafe494cf3ccc8bee7795deb17231a', 'blockHash': '0x3bc60abea8fca30516f48b0374542b9c8fa554061c8802d7bcd4211fffbf6caf', 'blockNumber': 30237147, 'chunk_id': 30237147, 'context': None, 'data': '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de90d34e1f2e65c0000000000000000000000000000000000000000000018e627902bfb974416f90000000000000000000000000000000000000000000000000000000000000000', 'event': <class 'web3._utils.datatypes.Swap'>, 'logIndex': '0x3', 'removed': False, 'timestamp': 1690184818, 'topics': ['0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822', '0x00000000000000000000000064c425b6fa04873ea460cda049b340d79cf859d7', '0x000000000000000000000000ad1fedfb04377c4b849cef6ef9627bca41955fa0'], 'transactionHash': '0xf2287653559f01d8afba9ae00386d453b731699b784851f7a8504d41dee7503b', 'transactionIndex': '0x1' }
Attributes summary
User passed context for the event reader
Contract event matches for this raw log
Smart contract address
Block where the event was
Block number as hex string
UNIX timestamp of the block number.
Transaction where the event occred
Log index as a hex number
Topics in this receipt.
Block reorg helper
Data related to the event
Methods summary
__init__
(*args, **kwargs)clear
()copy
()fromkeys
([value])Create a new dictionary with keys from iterable and values set to value.
get
(key[, default])Return the value for key if key is in the dictionary, else default.
items
()keys
()pop
(k[,d])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem
()Remove and return a (key, value) pair as a 2-tuple.
setdefault
(key[, default])Insert key with a value of default if key is not in the dictionary.
update
([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values
()- context: eth_defi.event_reader.logresult.LogContext
User passed context for the event reader
- event: web3.contract.contract.ContractEvent
Contract event matches for this raw log
- timestamp: Optional[int]
UNIX timestamp of the block number. Synthesized by block reader code, not present in the receipt. May be None if timestamp fetching is disabled for the speed reasons.