eth_getLogs - Ethereum
eth_getLogs on Ethereum: returns the event logs that match a filter. Parameters, response and request example for the RPC Fast endpoint.
Returns the event logs that match a filter.
Parameters
filter(object) — Log filterfromBlock(string) — Optional. First block, block number as hex, or a tag:latest,earliest,pending,safe,finalizedtoBlock(string) — Optional. Last block, same format asfromBlockaddress(address | array) — Optional. Contract address or list of addressestopics(array) — Optional. Topic filters by position;nullmatches anything, a nested array matches any of its valuesblockHash(hash) — Optional. Restricts the result to one block; cannot be combined withfromBlock/toBlock
Returns
Array of logs: address, topics, data, blockNumber, blockHash, transactionHash, transactionIndex, logIndex and removed.
Example
Request
curl https://eth-mainnet.rpcfast.com/?api_key=<API_KEY> \
-X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getLogs","params":[{"fromBlock":"0x192a337","toBlock":"0x192a337","address":"0xdac17f238db9863dae526eb0dc935e7cf9fcec54"}]}'Response
See Compute Units for the price of this method on Ethereum.
Last updated