addLog(options)
Get event logs emitted by some or all contracts in the network. options has the following structure:
address: the set of addresses of contracts emitting the logs. Omit to subscribe to events from all contracts in the network.topicN: the set of values of topicN.range: the range of blocks to consider.
transaction = true: the processor will retrieve all parent transactions and add them to thetransactionsiterable within the block data. Additionally it will expose them via the.transactionfield of each log item.transactionLogs = true: the processor will retrieve all “sibling” logs, that is, all logs emitted by transactions that emitted at least one matching log. The logs will be exposed through the regularlogsblock data iterable and via.transaction.logsfor matching logs.transactionTraces = true: the processor will retrieve the traces for all transactions that emitted at least one matching log. The traces will be exposed through the regulartracesblock data iterable and via.transaction.traces.
addTransaction() and addTrace() method as related data.
Selection of the exact data to be retrieved for each log and its optional parent transaction is done with the setFields() method documented on the Field selection page. Some examples are available below.
Examples
- Fetch
NewGravatar(uint256,address,string,string)andUpdateGravatar(uint256,address,string,string)event logs emitted by0x2E645469f354BB4F5c8a05B3b30A929361cf77eC. For each log, fetch topic set, log data. Fetch parent transactions with their inputs.
- Fetch every
Transfer(address,address,uint256)event on Ethereum mainnet where topic2 is set to the destination address (a common but non-standard practice) and the destination isvitalik.etha.k.a.0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045. For each log, fetch transaction hash.
