Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data TxInfo
- pattern TxInfo ∷ List TxInInfo → List TxInInfo → List TxOut → Value → Value → List DCert → Map StakingCredential Integer → POSIXTimeRange → List PubKeyHash → Map ScriptPurpose Redeemer → Map DatumHash Datum → TxId → TxInfo
- txInfoInputs ∷ TxInfo → List TxInInfo
- txInfoReferenceInputs ∷ TxInfo → List TxInInfo
- txInfoOutputs ∷ TxInfo → List TxOut
- txInfoFee ∷ TxInfo → Value
- txInfoMint ∷ TxInfo → Value
- txInfoDCert ∷ TxInfo → List DCert
- txInfoWdrl ∷ TxInfo → Map StakingCredential Integer
- txInfoValidRange ∷ TxInfo → POSIXTimeRange
- txInfoSignatories ∷ TxInfo → List PubKeyHash
- txInfoRedeemers ∷ TxInfo → Map ScriptPurpose Redeemer
- txInfoData ∷ TxInfo → Map DatumHash Datum
- txInfoId ∷ TxInfo → TxId
- data ScriptContext
- pattern ScriptContext ∷ TxInfo → ScriptPurpose → ScriptContext
- scriptContextTxInfo ∷ ScriptContext → TxInfo
- scriptContextPurpose ∷ ScriptContext → ScriptPurpose
- data ScriptPurpose
- pattern Minting ∷ CurrencySymbol → ScriptPurpose
- pattern Spending ∷ TxOutRef → ScriptPurpose
- pattern Rewarding ∷ StakingCredential → ScriptPurpose
- pattern Certifying ∷ DCert → ScriptPurpose
- newtype TxId = TxId {}
- data TxOut
- pattern TxOut ∷ Address → Value → OutputDatum → Maybe ScriptHash → TxOut
- txOutAddress ∷ TxOut → Address
- txOutValue ∷ TxOut → Value
- txOutDatum ∷ TxOut → OutputDatum
- txOutReferenceScript ∷ TxOut → Maybe ScriptHash
- data TxOutRef
- pattern TxOutRef ∷ TxId → Integer → TxOutRef
- txOutRefId ∷ TxOutRef → TxId
- txOutRefIdx ∷ TxOutRef → Integer
- data TxInInfo
- pattern TxInInfo ∷ TxOutRef → TxOut → TxInInfo
- txInInfoOutRef ∷ TxInInfo → TxOutRef
- txInInfoResolved ∷ TxInInfo → TxOut
- findOwnInput ∷ ScriptContext → Maybe TxInInfo
- findDatum ∷ DatumHash → TxInfo → Maybe Datum
- findDatumHash ∷ Datum → TxInfo → Maybe DatumHash
- findTxInByTxOutRef ∷ TxOutRef → TxInfo → Maybe TxInInfo
- findContinuingOutputs ∷ ScriptContext → List Integer
- getContinuingOutputs ∷ ScriptContext → List TxOut
- pubKeyOutputsAt ∷ PubKeyHash → TxInfo → List Value
- valuePaidTo ∷ TxInfo → PubKeyHash → Value
- spendsOutput ∷ TxInfo → TxId → Integer → Bool
- txSignedBy ∷ TxInfo → PubKeyHash → Bool
- valueSpent ∷ TxInfo → Value
- valueProduced ∷ TxInfo → Value
- ownCurrencySymbol ∷ ScriptContext → CurrencySymbol
Pending transactions and related types
A pending transaction. This is the view as seen by validator scripts, so some details are stripped out.
Instances
Generic TxInfo Source # | |
Show TxInfo Source # | |
FromData TxInfo Source # | |
Defined in PlutusLedgerApi.V2.Data.Contexts | |
ToData TxInfo Source # | |
Defined in PlutusLedgerApi.V2.Data.Contexts | |
UnsafeFromData TxInfo Source # | |
Defined in PlutusLedgerApi.V2.Data.Contexts | |
Pretty TxInfo Source # | |
Lift DefaultUni TxInfo Source # | |
Defined in PlutusLedgerApi.V2.Data.Contexts lift ∷ TxInfo → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source # | |
Typeable DefaultUni TxInfo Source # | |
Defined in PlutusLedgerApi.V2.Data.Contexts typeRep ∷ Proxy TxInfo → RTCompile DefaultUni fun (Type TyName DefaultUni ()) Source # | |
type Rep TxInfo Source # | |
Defined in PlutusLedgerApi.V2.Data.Contexts type Rep TxInfo = D1 ('MetaData "TxInfo" "PlutusLedgerApi.V2.Data.Contexts" "plutus-ledger-api-1.39.0.0-inplace" 'True) (C1 ('MetaCons "TxInfo_6989586621680817915" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData))) |
pattern TxInfo ∷ List TxInInfo → List TxInInfo → List TxOut → Value → Value → List DCert → Map StakingCredential Integer → POSIXTimeRange → List PubKeyHash → Map ScriptPurpose Redeemer → Map DatumHash Datum → TxId → TxInfo Source #
txInfoMint ∷ TxInfo → Value Source #
data ScriptContext Source #
The context that the currently-executing script can access.
Instances
pattern ScriptContext ∷ TxInfo → ScriptPurpose → ScriptContext Source #
data ScriptPurpose Source #
Purpose of the script that is currently running
Instances
pattern Minting ∷ CurrencySymbol → ScriptPurpose Source #
pattern Spending ∷ TxOutRef → ScriptPurpose Source #
pattern Rewarding ∷ StakingCredential → ScriptPurpose Source #
pattern Certifying ∷ DCert → ScriptPurpose Source #
A transaction ID, i.e. the hash of a transaction. Hashed with BLAKE2b-256. 32 byte.
This is a simple type without any validation, use with caution. You may want to add checks for its invariants. See the Shelley ledger specification. -- editorconfig-checker-disable-file
Instances
A transaction output, consisting of a target address, a value, optionally a datum/datum hash, and optionally a reference script.
Instances
Generic TxOut Source # | |
Show TxOut Source # | |
Eq TxOut Source # | |
Eq TxOut Source # | |
FromData TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx | |
ToData TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx | |
UnsafeFromData TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx | |
Pretty TxOut Source # | |
Lift DefaultUni TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx lift ∷ TxOut → RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) Source # | |
Typeable DefaultUni TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx typeRep ∷ Proxy TxOut → RTCompile DefaultUni fun (Type TyName DefaultUni ()) Source # | |
type Rep TxOut Source # | |
Defined in PlutusLedgerApi.V2.Data.Tx type Rep TxOut = D1 ('MetaData "TxOut" "PlutusLedgerApi.V2.Data.Tx" "plutus-ledger-api-1.39.0.0-inplace" 'True) (C1 ('MetaCons "TxOut_6989586621680768021" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData))) |
pattern TxOut ∷ Address → Value → OutputDatum → Maybe ScriptHash → TxOut Source #
txOutAddress ∷ TxOut → Address Source #
txOutValue ∷ TxOut → Value Source #
A reference to a transaction output. This is a
pair of a transaction ID (TxId
), and an index indicating which of the outputs
of that transaction we are referring to.
Instances
txOutRefId ∷ TxOutRef → TxId Source #
An input of a pending transaction.
Instances
findOwnInput ∷ ScriptContext → Maybe TxInInfo Source #
Find the input currently being validated.
findDatum ∷ DatumHash → TxInfo → Maybe Datum Source #
Find the data corresponding to a data hash, if there is one
findDatumHash ∷ Datum → TxInfo → Maybe DatumHash Source #
Find the hash of a datum, if it is part of the pending transaction's hashes
findContinuingOutputs ∷ ScriptContext → List Integer Source #
Find the indices of all the outputs that pay to the same script address we are currently spending from, if any.
getContinuingOutputs ∷ ScriptContext → List TxOut Source #
Get all the outputs that pay to the same script address we are currently spending from, if any.
Validator functions
pubKeyOutputsAt ∷ PubKeyHash → TxInfo → List Value Source #
Get the values paid to a public key address by a pending transaction.
valuePaidTo ∷ TxInfo → PubKeyHash → Value Source #
Get the total value paid to a public key address by a pending transaction.
spendsOutput ∷ TxInfo → TxId → Integer → Bool Source #
Check if the pending transaction spends a specific transaction output (identified by the hash of a transaction and an index into that transactions' outputs)
txSignedBy ∷ TxInfo → PubKeyHash → Bool Source #
Check if a transaction was signed by the given public key.
valueSpent ∷ TxInfo → Value Source #
Get the total value of inputs spent by this transaction.
valueProduced ∷ TxInfo → Value Source #
Get the total value of outputs produced by this transaction.
ownCurrencySymbol ∷ ScriptContext → CurrencySymbol Source #
The CurrencySymbol
of the current validator script.