Each redemption in a transaction has a
ScriptPurpose with the following 4 variants:
ScriptPurpose::Certifying are identical to
StakingPurpose::Certifying respectively, but the use cases are different.
StakingPurpose is used for switching between rewarding and certifying within a given staking script.
ScriptPurpose is used to see what other scripts are being used in the same transaction (see
ScriptPurpose::from_data(data: Data) -> ScriptPurpose
ScriptPurpose::new_minting(mph: MintingPolicyHash) -> ScriptPurpose::Minting
ScriptPurpose::new_spending(output_id: TxOutputId) -> ScriptPurpose::Spending
ScriptPurpose::new_rewarding(staking_credential: StakingCredential) -> ScriptPurpose::Rewarding
ScriptPurpose::new_certifying(dcert: DCert) -> ScriptPurpose::Certifying
MintingPolicyHash of the UTxO whose minting or burning is being validated.
minting_script_purpose.policy_hash -> MintingPolicyHash
TxOutputId of the UTxO whose spending is being validated.
spending_script_purpose.output_id -> TxOutputId
StakingCredential for which rewards are being withdrawn.
rewarding_script_purpose.credential -> StakingCredential
Returns the current stake certifying action as a
certifying_script_purpose.dcert -> DCert
ScriptPurpose == ScriptPurpose -> Bool
ScriptPurpose != ScriptPurpose -> Bool
script_purpose.serialize() -> ByteArray