Types

Address

class Address(address: str, network: pystratis.core.networks.basenetwork.BaseNetwork)

A address model. Address is validated by the network.

hexstr

class hexstr

Represents an hex string.

int32

class int32(value)

Represents an int32.

int64

class int64(value)

Represents an int64.

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

uint128

class uint128(value)

Represents an uint128.

uint160

class uint160(value)

Represents an uint160.

uint256

class uint256(value)

Represents an uint256.

uint32

class uint32(value)

Represents an uint32.

uint64

class uint64(value)

Represents an uint64.