eth_newFilter
Method
- JSON-RPC method name:
eth_newFilter - JSON-RPC version:
2.0
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Filter | object | yes |
Parameter schema
{
"Filter": {
"required": true,
"schema": {
"title": "filter",
"type": "object",
"oneOf": [
{
"title": "Filter by block range",
"type": "object",
"properties": {
"fromBlock": {
"title": "from block",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
},
"toBlock": {
"title": "to block",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
},
"address": {
"title": "Address(es)",
"oneOf": [
{
"title": "Any Address",
"type": "null"
},
{
"title": "Address",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
},
{
"title": "Addresses",
"type": "array",
"items": {
"title": "hex encoded address",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
}
}
]
},
"topics": {
"title": "Topics",
"oneOf": [
{
"title": "Any Topic Match",
"type": "null"
},
{
"title": "Specified Filter Topics",
"type": "array",
"items": {
"title": "Filter Topic List Entry",
"oneOf": [
{
"title": "Single Topic Match",
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
{
"title": "Multiple Topic Match",
"type": "array",
"items": {
"title": "32 hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
}
}
]
}
}
]
}
}
},
{
"title": "Filter by block hash",
"type": "object",
"properties": {
"blockHash": {
"title": "block hash",
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"address": {
"title": "Address(es)",
"oneOf": [
{
"title": "Any Address",
"type": "null"
},
{
"title": "Address",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
},
{
"title": "Addresses",
"type": "array",
"items": {
"title": "hex encoded address",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
}
}
]
},
"topics": {
"title": "Topics",
"oneOf": [
{
"title": "Any Topic Match",
"type": "null"
},
{
"title": "Specified Filter Topics",
"type": "array",
"items": {
"title": "Filter Topic List Entry",
"oneOf": [
{
"title": "Single Topic Match",
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
{
"title": "Multiple Topic Match",
"type": "array",
"items": {
"title": "32 hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
}
}
]
}
}
]
}
},
"required": [
"blockHash"
]
}
],
"additionalProperties": false
}
}
}
Result
- Name:
Filter identifier - Type:
string
Result schema
{
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
}
Positional parameters
Parameter order:
Filter
Errors
This method may return JSON-RPC standard errors (e.g. -32600, -32601, -32602, -32603) as well as application-specific errors.
TODO: Document method-specific error codes and conditions.