Returns an array of all logs matching the filter with the given id. The filter object should be obtained using newFilter.
Note that filter ids returned by other filter creation functions, such as newBlockFilter or newPendingTransactionFilter, cannot be used with this function.
Creates a filter in the node, to receive the information about new pending transactions arrival. To check if the state has changed, call getFilterChanges.
Removes the filter with the given id. It is strongly recommended to immediately remove the filter if monitoring is no longer needed. A filter will be removed if the filter has not been invoked through getFilterChanges for more than the timeout value set in the node. The default configuration is 5 minutes.
Parameters
Return Value
Promise returns Boolean - true if the filter was successfully uninstalled, otherwise false.
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Name
Type
Description
address
20-byte DATA
Address from which this log originated.
topics
Array of DATA
Array of 0 to 4 32-byte DATA of indexed log arguments. (In Solidity: The first topic is the hash of the signature of the event (e.g., Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.).
data
DATA
Contains the non-indexed arguments of the log.
blockNumber
QUANTITY
The block number where this log was in. null when pending.
transactionHash
32-byte DATA
Hash of the transaction that this log was created from. null when pending, an edge case when the transaction has been executed, but the block has not been confirmed.
transactionIndex
QUANTITY
Integer. The index of the transaction that this log was created from. null when pending.
blockHash
32-byte DATA
Hash of the block where this log was in. null when pending.
logIndex
QUANTITY
Integer of the log index position in the block. null when it is a pending log.
id
String
A log identifier. It is made by concatenating "log_" string with keccak256(blockHash + transactionHash + logIndex).substr(0, 8)
Name
Type
Description
filterId
String
The filter id.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Name
Type
Description
options
Object
The filter options.
options.fromBlock
Number | String
(optional) The number of the earliest block to get the logs. ("latest" means the most recent block.) The default value is "latest".
options.toBlock
Number | String
(optional) The number of the last block to get the logs. ("latest" means the most recent block.). The default value is "latest".
options.address
String | Array
(optional) An address or a list of addresses. Only the logs related to the particular account(s) will be returned.
options.topics
Array
(optional) An array of values that must appear in the log entries. The order is important. If you want to leave topics out, use null, e.g., [null, '0x12...']. You can also pass an array for each topic with options for that topic, e.g.,[null, ['option1', 'option2']].
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.