eth_getLogs
Returns an array of all the logs matching the given filter object. See also the below Constraints section.
Parameters
A filter object containing the following:
address
: [optional] Contract address (20 bytes) or a list of addresses from which logs should originate.fromBlock
: [optional, default is "latest"] A hexadecimal block number, or one of the string tagslatest
,earliest
,pending
,safe
, orfinalized
. See the default block parameter.toBlock
: [optional, default is "latest"] A hexadecimal block number, or one of the string tagslatest
,earliest
,pending
,safe
, orfinalized
. See the default block parameter.topics
: [optional] Array of 32 bytes DATA topics. Topics are order-dependent.blockhash
: [optional] Restricts the logs returned to the single block referenced in the 32-byte hashblockHash
. UsingblockHash
is equivalent to settingfromBlock
andtoBlock
to the block number referenced in theblockHash
. IfblockHash
is present in the filter criteria, then neitherfromBlock
nortoBlock
are allowed.
Returns
log objects
: An array of log objects, or an empty array if nothing has changed since last poll. Log objects contain the following keys and their values:
removed
: (boolean)true
when the log was removed, due to a chain reorganization.false
if it's a valid log.logIndex
: Hexadecimal of the log index position in the block.Null
when it is a pending log.transactionIndex
: Hexadecimal of the transactions index position from which the log created.Null
when it is a pending log.transactionHash
: 32 bytes. Hash of the transactions from which this log was created.Null
when it is a pending log.blockHash
: 32 bytes. Hash of the block where this log was in.Null
when it is a pending log.blockNumber
: Block number where this log was in.Null
when it is a pending log.address
: 20 bytes. Address from which this log originated.data
: Contains one or more 32-bytes non-indexed arguments of the log.topics
: An array of 0 to 4 indexed log arguments, each 32 bytes. In solidity the first topic is the hash of the signature of the event (for example,Deposit(address,bytes32,uint256)
), except when you declared the event with the anonymous specifier.