Skip to main content

PScriptPurpose

It is the second field of the PScriptContext structure.

It tells us what the script is used for based on the constructor and it passes some useful information that would be hard to access otherwise.

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

currencySym

type: PCurrencySymbol.type

Spending

utxoRef

type: PTxOutRef.type

Rewarding

stakeCredential

type: PCredential.type

Certifying

cert

type: PCertificate.type

Voting

voter

type: PVoter.type

Proposing

proposal

type: PProposalProcedure.type