跳到主要内容

eth_getLogs

Returns an array of all logs matching a given filter object.

Filter Addresspub type FilterAddress = VariadicValue<H160>; Topicpub type Topic = VariadicValue<H256>; Filter

topics

curl --request POST \
--url https://evm.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": [{}],
"method": "eth_getLogs"
}'

Params

filter required

Filter Addresspub type FilterAddress = VariadicValue<H160>; Topicpub type Topic = VariadicValue<H256>; Filter
type : object
  • address address
    oneOf
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{40}$
  • blockHash blockHash
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • fromBlock fromBlock
    oneOf
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$
  • toBlock toBlock
    oneOf
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$
  • topics topics
    type : array
    • items[x] Topic
      oneOf
      type : string
      Pattern : ^0x[0-9,a-f,A-F]{64}$

Result

Schema
type : array
  • items[x] Log
    type : object
    • address address
      type : string
      Pattern : ^0x[0-9,a-f,A-F]{40}$
    • blockHash blockHash
      type : string
      Pattern : ^0x[0-9,a-f,A-F]{64}$
    • blockNumber blockNumber
      type : string
      Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
    • data data
      type : string
      Pattern : ^0x[0-9a-f]*$
    • logIndex logIndex
      type : string
      Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
    • removed removed
      type : boolean
    • topics topics
      type : array
      • items[x] H256
        type : string
        Pattern : ^0x[0-9,a-f,A-F]{64}$
    • transactionHash transactionHash
      type : string
      Pattern : ^0x[0-9,a-f,A-F]{64}$
    • transactionIndex transactionIndex
      type : string
      Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
    • transactionLogIndex transactionLogIndex
      type : string
      Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$

Examples

Request

curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getLogs",
"params": [
{}
]
}' \
-H "Content-Type: application/json" \
localhost:12539

Response

{
"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)"
}