Skip to content

Commit 4da7ef6

Browse files
committed
Add more documentation on txinfo
1 parent 4ea5925 commit 4da7ef6

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

opshin/ledger/api_v3.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -714,28 +714,39 @@ class Proposing(PlutusData):
714714
ScriptPurpose = Union[Minting, Spending, Withdrawing, Publishing, Voting, Proposing]
715715

716716

717-
@dataclass(unsafe_hash=True)
717+
@dataclass()
718718
class TxInfo(PlutusData):
719719
"""
720720
A complex agglomeration of everything that could be of interest to the executed script, regarding the transaction
721721
that invoked the script
722722
"""
723723

724-
CONSTR_ID = 0
724+
# The input UTXOs of the transaction.
725725
inputs: List[TxInInfo]
726+
# The reference UTXOs of the transaction.
726727
reference_inputs: List[TxInInfo]
728+
# The output UTXOs created by the transaction.
727729
outputs: List[TxOut]
728-
fee: Lovelace
730+
# Transaction fee to be payed for the transaction.
731+
fee: Value
732+
# The value minted in the transaction.
729733
mint: Value
730-
certificates: List[Certificate]
734+
certificates: List[DCert]
735+
# Withdrawals from specific stake keys
731736
# NOTE: Withdrawals are ordered by ascending Credential. Yet, note that `Script` credentials are treated as **lower values** than `VerificationKey` credentials.
732737
withdrawals: Dict[StakingCredential, int]
738+
# The range of time in which this transaction is valid
733739
validity_range: POSIXTimeRange
734-
# NOTE: Redeemers are ordered by ascending ScriptPurpose.
740+
# The signatures for the transaction.
735741
signatories: List[PubKeyHash]
742+
# All redeemers passed to all script invocations
743+
# NOTE: Redeemers are ordered by ascending ScriptPurpose.
736744
redeemers: Dict[ScriptPurpose, Redeemer]
737-
datums: Dict[DatumHash, Datum]
745+
# All datums present in any inputs
746+
data: Dict[DatumHash, Datum]
747+
# The ID of the transaction.
738748
id: TxId
749+
# metadata for governance actions
739750
# NOTE: Votes are ordered by ascending Voter and GovernanceActionId. First constructor variants in a type are treated as lower indices; except for Credential where `Script` credentials are treated as **lower values** than `VerificationKey` credentials.
740751
votes: Dict[Voter, Dict[GovernanceActionId, Vote]]
741752
proposal_procedures: List[ProposalProcedure]

0 commit comments

Comments
 (0)