Types Module
ValueType
dataclass
¶
Bases: Serializable
Value Type
A ValueType specifies the data structure of value
included in
the TellorX.Oracle.submitValue()
used in response to
tip request.
The type is specified per eth-abi grammar, i.e.
- https://eth-abi.readthedocs.io/en/latest/grammar.html
Source code in telliot_feeds/dtypes/value_type.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
encode(value)
¶
Encode a value using the ABI Type string.
Source code in telliot_feeds/dtypes/value_type.py
32 33 34 35 36 37 |
|
decode(bytes_val)
¶
Decode bytes into a value using abi type string.
Source code in telliot_feeds/dtypes/value_type.py
39 40 41 |
|
UnsignedFloatType
dataclass
¶
Bases: ValueType
Unsigned Float Type
This class specifies the a floating point value using an ABI data type. It also provides encoding/decoding to/from floating point values.
Source code in telliot_feeds/dtypes/float_type.py
11 12 13 14 15 16 17 18 19 20 21 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 |
|
decimals: int
property
¶
Get precision from abi type
nbits: int
property
¶
Get number of bits from abi type
encode(value)
¶
An encoder for float values
This encoder converts a float value to the SpotPrice ABI data type.
Source code in telliot_feeds/dtypes/float_type.py
38 39 40 41 42 43 44 45 46 47 |
|
decode(bytes_val)
¶
A decoder for float values
This decoder converts from the SpotPrice ABI data type to a floating point value.
Source code in telliot_feeds/dtypes/float_type.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|