Skip to main content

PTxOut

info

Modified entirely from V1 version. The changes are highlighted.

Type that represents a transaction output.

Definition:

import { pstruct } from "../../../PTypes/PStruct/pstruct";
import { PMaybe } from "../../../lib/std/PMaybe/PMaybe";
import { V1 } from "../../V1";
import { POutputDatum } from "./POutputDatum";

export const PTxOut = pstruct({
PTxOut: {
address: V1.PAddress.type,
value: V1.PValue.type,
datum: POutputDatum.type,
refScrpt: PMaybe( V1.PScriptHash.type ).type
}
});

address

Destination address (recipient) to which the value is sent

type: V1.PAddress.type

value

Amount of value being transferred in the transaction output. This includes the currency and the amount.

type: V1.PValue.type

datum

Defines the datum attached to the transaction output.

type: POutputDatum.type

'refScrpt'

(Optional) Reference to script hash, if applicable. This allows a transaction to refer to an existing on-chain script without having to include the full script in the transaction.

type: PMaybe( V1.PScriptHash.type ).type