TransactionOutput (Class)¶
A transaction output defining a payment destination.
Outputs specify an amount and a locking script (script_public_key) that defines the conditions for spending.
script_public_key
property
writable
¶
script_public_key: ScriptPublicKey
The locking script that defines spending conditions.
__new__
¶
__new__(value: int, script_public_key: ScriptPublicKey) -> TransactionOutput
Create a new transaction output.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
Amount in sompi (1 KAS = 100,000,000 sompi).
TYPE:
|
script_public_key
|
The locking script.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TransactionOutput
|
A new TransactionOutput instance.
TYPE:
|
from_dict
classmethod
¶
from_dict(dict: dict) -> TransactionOutput
Create a TransactionOutput from a dictionary.
| PARAMETER | DESCRIPTION |
|---|---|
dict
|
Dictionary containing transaction output fields with keys: - 'value' (int): The output value in sompi - 'scriptPublicKey' (dict): Dict with 'version' (int) and 'script' (str) keys
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TransactionOutput
|
A new TransactionOutput instance.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If required keys are missing. |
ValueError
|
If values are invalid. |
to_dict
¶
Get a dictionary representation of the TransactionOutput. Note that this creates a second separate object on the Python heap.
| RETURNS | DESCRIPTION |
|---|---|
dict
|
the TransactionOutput in dictionary form.
TYPE:
|