Skip to main content

eth_newFilter

Creates a filter object, based on filter options, to notify when the state changes (logs).

Params

(1)

1. Filter (required)

fromBlock
string
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
toBlock
string
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
address
topics

Result

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

Example

Request

await window.ethereum.request({
"method": "eth_newFilter",
"params": [
{
"fromBlock": "0x137d3c2",
"toBlock": "0x137d3c3",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"topics": []
}
]
});

Result

"0x01"

Params

Filter


Request

await window.ethereum.request({
"method": "eth_newFilter",
"params": [
null
]
});