Skip to main content

PScriptPurpose

It is the second field of the PScriptContex structure.

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

definition:

export const PScriptPurpose = pstruct({
Minting: { currencySym: PCurrencySymbol.type },
Spending: { utxoRef: PTxOutRef.type },
Rewarding: { stakeCredential: PStakingCredentials.type },
Certifying: { dCert: PDCert.type }
});

Minting

currencySym

type: PCurrencySymbol.type

Spending

utxoRef

type: PTxOutRef.type

Rewarding

stakeCredential

type: PStakingCredentials.type

Certifying

dCert

type: PDCert.type