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.

property 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

property data

Alias for field number 1

property usage

Alias for field number 0

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

Bases: tuple

property prevHash

Alias for field number 0

property prevIndex

Alias for field number 1

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

Bases: tuple

property assetId

Alias for field number 0

property scriptHash

Alias for field number 2

property value

Alias for field number 1

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

Bases: tuple

property invocationScript

Alias for field number 0

property verificationScript

Alias for field number 1

Module contents