pyswitcheo.datatypes package¶
Submodules¶
pyswitcheo.datatypes.fixed8 module¶
Implementation for custom datatypes to interact with the blockchain.
-
class
pyswitcheo.datatypes.fixed8.
Fixed8
(value)[source]¶ Bases:
object
Fixed point representation of a given input number.
-
static
num_to_fixed_8
(number, size=8)[source]¶ Convert a given number to Fixed8 representation.
- Parameters
number (float/int) – Input which needs to be converted to a Fixed8 representation.
- Returns
Given number in Fixed8 representation.
- Raises
TypeError in case size param is not an integer –
-
property
value
¶ Return the underlying value of fixed 8.
-
static
pyswitcheo.datatypes.transaction_types module¶
Implementation for custom datatypes to interact with the blockchain.
-
class
pyswitcheo.datatypes.transaction_types.
TransactionAttribute
(usage, data)¶ Bases:
tuple
-
property
data
¶ Alias for field number 1
-
property
usage
¶ Alias for field number 0
-
property
-
class
pyswitcheo.datatypes.transaction_types.
TransactionInput
(prevHash, prevIndex)¶ Bases:
tuple
-
property
prevHash
¶ Alias for field number 0
-
property
prevIndex
¶ Alias for field number 1
-
property