Types¶
Address¶
-
class
Address
(address: str, network: pystratis.core.networks.basenetwork.BaseNetwork)¶ A address model. Address is validated by the network.
Money¶
-
class
Money
(value: Union[pystratis.core.types.money.Money, float, decimal.Decimal, int, str])¶ Represents Money.
In Stratis Platform, the money is represented by STRAX coin. A satoshi is the smallest unit of a STRAX. One STRAX is equivalent to 100 millionth of a satoshis (just like in Bitcoin).
Parameters: value (Money, float, Decimal, int, str) – An amount of money. The value interpreted as a count of the STRAX coins. Raises: ValueError
– Attempt to create Money with unsupported value type. Attempt to create Money with negative value.-
classmethod
from_satoshi_units
(value: int) → pystratis.core.types.money.Money¶ Convert satoshis to Money object. 1 STRAX is equivalent to 100 millionth of a satoshis.
Parameters: value (int) – Amount of satoshis. Returns: The Money object. Return type: Money
-
to_coin_unit
() → str¶ Represent Money object as a string.
Returns: The string contains float representation of STRAX amount. For example, 1 STRAX will be represented as ‘1.00000000’. Return type: str
-
value
¶ The amount of money, represented by fixed-point STRAX amount.
Returns: The amount of money. Return type: Decimal
-
classmethod