| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Plutus.Script.Utils.V2.Contexts
Synopsis
- spendsOutput :: TxInfo -> TxId -> Integer -> Bool
- ownCurrencySymbol :: ScriptContext -> CurrencySymbol
- valueProduced :: TxInfo -> Value
- valueSpent :: TxInfo -> Value
- pubKeyOutputsAt :: PubKeyHash -> TxInfo -> [Value]
- valueLockedBy :: TxInfo -> ValidatorHash -> Value
- scriptOutputsAt :: ValidatorHash -> TxInfo -> [(OutputDatum, Value)]
- ownHash :: ScriptContext -> ValidatorHash
- ownHashes :: ScriptContext -> (ValidatorHash, OutputDatum)
- txSignedBy :: TxInfo -> PubKeyHash -> Bool
- getContinuingOutputs :: ScriptContext -> [TxOut]
- findContinuingOutputs :: ScriptContext -> [Integer]
- findDatumHash :: Datum -> TxInfo -> Maybe DatumHash
- findDatum :: DatumHash -> TxInfo -> Maybe Datum
- findOwnInput :: ScriptContext -> Maybe TxInInfo
- data TxInInfo = TxInInfo {}
- data TxInfo = TxInfo {
- txInfoInputs :: [TxInInfo]
- txInfoReferenceInputs :: [TxInInfo]
- txInfoOutputs :: [TxOut]
- txInfoFee :: Value
- txInfoMint :: Value
- txInfoDCert :: [DCert]
- txInfoWdrl :: Map StakingCredential Integer
- txInfoValidRange :: POSIXTimeRange
- txInfoSignatories :: [PubKeyHash]
- txInfoRedeemers :: Map ScriptPurpose Redeemer
- txInfoData :: Map DatumHash Datum
- txInfoId :: TxId
- data ScriptContext = ScriptContext {}
- fromSymbol :: CurrencySymbol -> ValidatorHash
- pubKeyOutput :: TxOut -> Maybe PubKeyHash
- data ScriptPurpose
- data TxOut = TxOut {}
- data TxOutRef = TxOutRef {
- txOutRefId :: TxId
- txOutRefIdx :: Integer
- findTxInByTxOutRef :: TxOutRef -> TxInfo -> Maybe TxInInfo
- findTxRefInByTxOutRef :: TxOutRef -> TxInfo -> Maybe TxInInfo
- outputsAt :: Address -> TxInfo -> [Value]
- valuePaidTo :: TxInfo -> Address -> Value
Documentation
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)
ownCurrencySymbol :: ScriptContext -> CurrencySymbol Source #
The CurrencySymbol of the current validator script.
valueProduced :: TxInfo -> Value Source #
Get the total value of outputs produced by this transaction.
valueSpent :: TxInfo -> Value Source #
Get the total value of inputs spent by this transaction.
pubKeyOutputsAt :: PubKeyHash -> TxInfo -> [Value] Source #
Get the values paid to a public key address by a pending transaction.
valueLockedBy :: TxInfo -> ValidatorHash -> Value Source #
Get the total value locked by the given validator in this transaction.
scriptOutputsAt :: ValidatorHash -> TxInfo -> [(OutputDatum, Value)] Source #
Get the list of TxOut outputs of the pending transaction at
a given script address.
ownHash :: ScriptContext -> ValidatorHash Source #
Get the hash of the validator script that is currently being validated.
ownHashes :: ScriptContext -> (ValidatorHash, OutputDatum) Source #
Get the validator and datum hashes of the output that is curently being validated
txSignedBy :: TxInfo -> PubKeyHash -> Bool Source #
Check if a transaction was signed by the given public key.
getContinuingOutputs :: ScriptContext -> [TxOut] Source #
Get all the outputs that pay to the same script address we are currently spending from, if any.
findContinuingOutputs :: ScriptContext -> [Integer] Source #
Find the indices of all the outputs that pay to the same script address we are currently spending from, if any.
findDatumHash :: Datum -> TxInfo -> Maybe DatumHash Source #
Find the hash of a datum, if it is part of the pending transaction's hashes
findDatum :: DatumHash -> TxInfo -> Maybe Datum Source #
Find the data corresponding to a data hash, if there is one
findOwnInput :: ScriptContext -> Maybe TxInInfo Source #
Find the input currently being validated.
An input of a pending transaction.
Constructors
| TxInInfo | |
Fields | |
Instances
A pending transaction. This is the view as seen by validator scripts, so some details are stripped out.
Constructors
| TxInfo | |
Fields
| |
Instances
data ScriptContext Source #
Constructors
| ScriptContext | |
Fields | |
Instances
fromSymbol :: CurrencySymbol -> ValidatorHash Source #
Convert a CurrencySymbol to a ValidatorHash
pubKeyOutput :: TxOut -> Maybe PubKeyHash Source #
Get the public key hash that locks the transaction output, if any.
data ScriptPurpose Source #
Purpose of the script that is currently running
Instances
A transaction output, consisting of a target address, a value, optionally a datum/datum hash, and optionally a reference script.
Constructors
| TxOut | |
Fields | |
Instances
A reference to a transaction output. This is a pair of a transaction reference, and an index indicating which of the outputs of that transaction we are referring to.
Constructors
| TxOutRef | |
Fields
| |