Skip to main content

eth_newFilter

Install a log filter in the server, allowing for later polling. Registers client interest in logs matching the filter, and returns an identifier.

Parameters (by position)

Filter object or object required


Show Option 1 Filter by block range object

Filter by block range fields

Filter object required

Filter by block range


Show Filter object

Filter fields

  • fromBlock string

    from block

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • toBlock string

    to block

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • address null or string or array<string>


    Show Option 1 Any Address null

    Any Address fields

    address null

    Any Address


    Show Option 2 Address string

    Address fields

    address string

    Address

    Match pattern: ^0x[0-9a-fA-F]{40}$


    Show Option 3 Addresses array

    Addresses fields

    address array<string>

    hex encoded address

    Match pattern: ^0x[0-9a-fA-F]{40}$


  • topics null or array<unknown>


    Show Option 1 Any Topic Match null

    Any Topic Match fields

    topics null

    Any Topic Match


    Show Option 2 Specified Filter Topics array

    Specified Filter Topics fields

    topics string or array<string>


    Show Option 1 Single Topic Match string

    Single Topic Match fields

    topics array<string>

    Single Topic Match

    Match pattern: ^0x[0-9a-f]{64}$


    Show Option 2 Multiple Topic Match array

    Multiple Topic Match fields

    topics array<string>

    32 hex encoded bytes

    Match pattern: ^0x[0-9a-f]{64}$


  • additionalProperties true


Show Option 2 Filter by block hash object

Filter by block hash fields

Filter object required

Filter by block hash


Show Filter object

Filter fields

  • blockHash string required

    block hash

    Match pattern: ^0x[0-9a-f]{64}$


  • address null or string or array<string>


    Show Option 1 Any Address null

    Any Address fields

    address null

    Any Address


    Show Option 2 Address string

    Address fields

    address string

    Address

    Match pattern: ^0x[0-9a-fA-F]{40}$


    Show Option 3 Addresses array

    Addresses fields

    address array<string>

    hex encoded address

    Match pattern: ^0x[0-9a-fA-F]{40}$


  • topics null or array<unknown>


    Show Option 1 Any Topic Match null

    Any Topic Match fields

    topics null

    Any Topic Match


    Show Option 2 Specified Filter Topics array

    Specified Filter Topics fields

    topics string or array<string>


    Show Option 1 Single Topic Match string

    Single Topic Match fields

    topics array<string>

    Single Topic Match

    Match pattern: ^0x[0-9a-f]{64}$


    Show Option 2 Multiple Topic Match array

    Multiple Topic Match fields

    topics array<string>

    32 hex encoded bytes

    Match pattern: ^0x[0-9a-f]{64}$


  • additionalProperties true


Result

Filter identifier string

hex encoded unsigned integer

Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


Examples

eth_newFilter example

Request

{
"params": [
{
"fromBlock": "0x137d3c2",
"toBlock": "0x137d3c3",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"topics": []
}
]
}

Response

"0x01"