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
to_hex()[source]
to_reverse_hex()[source]

Get a reverse hex representation of a given Fixed8.

value

Return the underlying value of fixed 8.

pyswitcheo.datatypes.transaction_types module

Implementation for custom datatypes to interact with the blockchain.

class pyswitcheo.datatypes.transaction_types.TransactionAttribute(usage, data)

Bases: tuple

data

Alias for field number 1

usage

Alias for field number 0

class pyswitcheo.datatypes.transaction_types.TransactionInput(prevHash, prevIndex)

Bases: tuple

prevHash

Alias for field number 0

prevIndex

Alias for field number 1

class pyswitcheo.datatypes.transaction_types.TransactionOutput(assetId, value, scriptHash)

Bases: tuple

assetId

Alias for field number 0

scriptHash

Alias for field number 2

value

Alias for field number 1

class pyswitcheo.datatypes.transaction_types.Witness(invocationScript, verificationScript)

Bases: tuple

invocationScript

Alias for field number 0

verificationScript

Alias for field number 1

Module contents