Skip to content

Commit c57400c

Browse files
committed
Added documentation on reverse ordering
1 parent bfa842e commit c57400c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ stream = contract.stream_events(
8080
)
8181
```
8282

83+
You may also specify descending order to stream in the reverse direction. For example, to stream two batches of 10 events in reverse order from the latest block:
84+
85+
```python
86+
stream = contract.stream_events(order='desc')
87+
stream.next(10)
88+
stream.next(10)
89+
```
90+
8391
#### Live Streaming
8492

8593
In order to stream live data, you can specify the `live_stream` parameter. If you use this parameter with a stream iterator, it will continously stream new events as they are added to the blockchain (with a ~3s delay from nodes):
@@ -186,6 +194,14 @@ stream = contract.stream_calls(
186194
)
187195
```
188196

197+
You may also specify descending order to stream in the reverse direction. For example, to stream two batches of 10 calls in reverse order from the latest block:
198+
199+
```python
200+
stream = contract.stream_calls(order='desc')
201+
stream.next(10)
202+
stream.next(10)
203+
```
204+
189205
#### Call Format
190206

191207
Each call from the stream will be returned as a dictionary with the same structure, containing `target`, `context`, `call_data`, `input_data`, and `output_data` fields. The `target` field contains information about the contract and function that was decoded, while the `context` field contains information about the block, transaction, and trace that the call was made in. The `call_data` field contains the decoded call data, while the `input_data` and `output_data` fields contain the decoded input and output data, respectively.

0 commit comments

Comments
 (0)