Skip to content

Commit 3c429f5

Browse files
authored
eth: improve filter API spec (#633)
- Filters do not register for notifications - filter IDs are required for many methods - the log filter object is required for the newFilter method
1 parent a94db45 commit 3c429f5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/eth/filter.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
- name: eth_newFilter
2-
summary: Creates a filter object, based on filter options, to notify when the state changes (logs).
2+
summary: Install a log filter in the server, allowing for later polling. Registers client interest in logs matching the filter, and returns an identifier.
33
params:
44
- name: Filter
55
schema:
66
$ref: '#/components/schemas/Filter'
7+
required: true
78
result:
89
name: Filter identifier
910
schema:
@@ -21,7 +22,7 @@
2122
name: Filter identifier
2223
value: '0x01'
2324
- name: eth_newBlockFilter
24-
summary: Creates a filter in the node, to notify when a new block arrives.
25+
summary: Creates a filter in the node, allowing for later polling. Registers client interest in new blocks, and returns an identifier.
2526
params: []
2627
result:
2728
name: Filter identifier
@@ -34,7 +35,7 @@
3435
name: Filter identifier
3536
value: '0x01'
3637
- name: eth_newPendingTransactionFilter
37-
summary: Creates a filter in the node, to notify when new pending transactions arrive.
38+
summary: Creates a filter in the node, allowing for later polling. Registers client interest in new transactions, and returns an identifier.
3839
params: []
3940
result:
4041
name: Filter identifier
@@ -52,6 +53,7 @@
5253
- name: Filter identifier
5354
schema:
5455
$ref: '#/components/schemas/uint'
56+
required: true
5557
result:
5658
name: Success
5759
schema:
@@ -65,11 +67,12 @@
6567
name: Success
6668
value: true
6769
- name: eth_getFilterChanges
68-
summary: Polling method for the filter with the given ID (created using `eth_newFilter`). Returns an array of logs which occurred since last poll.
70+
summary: Polling method for the filter with the given ID (created using `eth_newFilter`). Returns an array of logs, block hashes, or transaction hashes since last poll, depending on the installed filter.
6971
params:
7072
- name: Filter identifier
7173
schema:
7274
$ref: '#/components/schemas/uint'
75+
required: true
7376
result:
7477
name: Log objects
7578
schema:
@@ -110,6 +113,7 @@
110113
- name: Filter identifier
111114
schema:
112115
$ref: '#/components/schemas/uint'
116+
required: true
113117
result:
114118
name: Log objects
115119
schema:
@@ -150,6 +154,7 @@
150154
- name: Filter
151155
schema:
152156
$ref: '#/components/schemas/Filter'
157+
required: true
153158
result:
154159
name: Log objects
155160
schema:

0 commit comments

Comments
 (0)