PScriptPurpose
The modifications in PScriptPurpose
from V1 version are highlighted.
It tells us what specific role or purpose the script is used for based on the constructor. Definition:
export const PScriptPurpose = pstruct({
Minting: { currencySym: PCurrencySymbol.type },
Spending: { utxoRef: PTxOutRef.type },
Rewarding: { stakeCredential: PCredential.type },
Certifying: {
index: int,
cert: PCertificate.type
},
Voting: {
voter: PVoter.type
},
Proposing: {
index: int,
proposal: PProposalProcedure.type
}
});
Minting
Purpose for minting new assets
currencySym
The currency symbol associated with the asset being minted
type: PCurrencySymbol.type
Spending
Purpose for spending a specific UTXO
utxoRef
A reference to the UTXO that is being spent
type: PTxOutRef.type
Rewarding
Purpose for rewarding a stakeholder
stakeCredential
Credential of the stakeholder receiving the reward.
type: PCredential.type
Certifying
Purpose for certifying actions or events
index
Index of certification event
type: TermInt
cert
Certificate associated with the event
type: PCertificate.type
Voting
Purpose for casting a vote in a governance process
voter
type: PVoter.type
Proposing
Purpose for proposing new procedures or actions
index
Index of proposal
type: TermInt
proposal
Proposal being submitted for consideration
type: PProposalProcedure.type