Data Feed Module
DataSource
dataclass
¶
Bases: Generic[T]
, Base
Base Class for a DataSource
A DataSource provides an input to a DataFeed
It also contains a store for all previously fetched data points.
All subclasses must implement DataSource.fetch_new_datapoint()
Source code in telliot_feeds/datasource.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
latest: OptionalDataPoint[T]
property
¶
Returns the most recent datapoint or none if history is empty
store_datapoint(datapoint)
¶
Store a datapoint
Source code in telliot_feeds/datasource.py
49 50 51 52 53 |
|
get_all_datapoints()
¶
Get a list of all available data points
Source code in telliot_feeds/datasource.py
55 56 57 |
|
fetch_new_datapoint()
async
¶
Fetch new value and store it for later retrieval
Source code in telliot_feeds/datasource.py
59 60 61 |
|
DataFeed
dataclass
¶
Bases: Generic[T]
, Base
Data feed providing query response
A data feed contains a DataSource to fetch values in response to an OracleQuery
.
Attributes:
Name | Type | Description |
---|---|---|
query |
OracleQuery
|
The Query that this feed responds to |
source |
DataSource[T]
|
Data source for feed |
Source code in telliot_feeds/datafeed.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|