Skip to main content

PTxInfo

It is the first field of the PScriptContext structure.

It includes all the information regarding the transaction in which the script is included.

definition:

export const PTxInfo = pstruct({
PTxInfo: {
inputs: list( PTxInInfo.type ),
refInputs: list( PTxInInfo.type ),
outputs: list( PTxOut.type ),
fee: int, // lovelaces
mint: PValue.type,
certificates: list( PCertificate.type ),
withdrawals: map( PCredential.type, int ),
interval: PPOSIXTimeRange.type,
signatories: list( PPubKeyHash.type ),
redeemers: map( PScriptPurpose.type, data ),
datums: map( PDatumHash.type, data ),
id: PTxId.type,
votes: map( PVoter.type, map( PTxOutRef.type, PVote.type ) ),
proposalProcedures: list( PProposalProcedure.type ),
currentTreasury: PMaybe( int ).type,
treasuryDonation: PMaybe( int ).type,
}
});

inputs

type: list( PTxInInfo.type )

elements's type: PTxInInfo

The value implements all the properties defined on the TermList utility term.

refInputs

type: list( PTxInInfo.type )

elements's type: PTxInInfo

The value implements all the properties defined on the TermList utility term.

outputs

type: list( PTxOut.type )

elements's type: PTxOut

The value implements all the properties defined on the TermList utility term.

fee

type: PValue.type

despite being only a value it always includes a single entry which represents the lovelaces paid as fees.

mint

type: PValue.type

includes all tokens minted/burned in the transaction.

ADA entry

being a value directly constructed by the node it always includes an entry for lovelaces

since lovelaces can't be minted/burned the quantity will always be 0

certificates

type: list( PCertificate.type )

elements's type: PCertificate

The value implements all the properties defined on the TermList utility term.

withdrawals

type: map( PCredential.type, int )

elements's types:

The value implements all the properties defined on the TermList utility term.

interval

type: PPOSIXTimeRange.type

signatories

type: list( PPubKeyHash.type )

elements's type: PPubKeyHash

The value implements all the properties defined on the TermList utility term.

redeemers

type: list( pair( PScriptPurpose.type, data ) )

elements's types:

The value implements all the properties defined on the TermList utility term.

datums

type: list( pair( PDatumHash.type, data ) )

elements's types:

The value implements all the properties defined on the TermList utility term.

id

type: PTxId.type

votes

type: map( PVoter.type, map( PTxOutRef.type, PVote.type ) )

elements's types:

proposalProcedures

type: list( PProposalProcedure.type )

elements's types:

  • PProposalProcedure

currentTreasury

type: PMaybe( int ).type

elements's types:

  • PMaybe

treasuryDonation

type: PMaybe( int ).type

elements's types:

  • PMaybe