Skip to main content

PScriptContext

info

The modifications in PScriptContext from V1 version are highlighted.

Type that provides the context of a script execution. This includes details about the transaction and the purpose of the script within that transaction.

The Script Context is probably the most important piece of data your script receives. That is because this data is passed directly by the cardano node during the contract evaluation; hence it can always be trusted.

Definition:

export const PScriptContext = pstruct({
PScriptContext: {
tx: PTxInfo.type,
purpose: V1.PScriptPurpose.type
}
});

tx

type: PTxInfo

purpose

type: V1.PScriptPurpose