eth_getLogs
Returns an array of all logs matching a given filter object.
Params
(1)1. filter (required)
address
blockHash
string or null
Match pattern:
^0x[0-9,a-f,A-F]{64}$
fromBlock
toBlock
topics
Result
(eth_getLogs_result)array of:
address
stringMatch pattern:
^0x[0-9,a-f,A-F]{40}$
blockHash
stringMatch pattern:
^0x[0-9,a-f,A-F]{64}$
blockNumber
stringMatch pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
data
stringMatch pattern:
^0x[0-9a-f]*$
logIndex
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
removed
booleantopics
array[string]transactionHash
stringMatch pattern:
^0x[0-9,a-f,A-F]{64}$
transactionIndex
stringMatch pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
transactionLogIndex
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
Examples
Request
curl -X POST --data \
'{
"method": "eth_getLogs",
"params": [
{}
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
localhost:12539
Result
{
"code": -32016,
"message": "Error processing request: Filter error: The gap between from_epoch and to_epoch is larger than max_gap (from: 71160000, to: 71252840, max_gap: 1000)"
}