Types
Address
hexstr
int32
int64
Money
- class Money(value: Union[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.
- property value: decimal.Decimal
The amount of money, represented by fixed-point STRAX amount.
- Returns
The amount of money.
- Return type
Decimal
- classmethod from_satoshi_units(value: int) 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
- 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