Saltar al contenido principal

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
string
Match pattern:
^0x[0-9,a-f,A-F]{40}$
blockHash
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$
blockNumber
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
data
string
Match pattern:
^0x[0-9a-f]*$
logIndex
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
removed
boolean
topics
array[string]
transactionHash
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$
transactionIndex
string
Match 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)"
}

Endpoint

Params

filter

topics

Request

curl -X POST --data \
'{
"method": "eth_getLogs",
"params": [
null
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
https://evmtestnet.confluxrpc.com