Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
-
data
TxInfo
=
TxInfo
{
- txInfoInputs :: [ TxInInfo ]
- txInfoOutputs :: [ TxOut ]
- txInfoFee :: Value
- txInfoMint :: Value
- txInfoDCert :: [ DCert ]
- txInfoWdrl :: [( StakingCredential , Integer )]
- txInfoValidRange :: POSIXTimeRange
- txInfoSignatories :: [ PubKeyHash ]
- txInfoData :: [( DatumHash , Datum )]
- txInfoId :: TxId
- data ScriptContext = ScriptContext { }
- data ScriptPurpose
- newtype TxId = TxId { }
- data TxOut = TxOut { }
-
data
TxOutRef
=
TxOutRef
{
- txOutRefId :: TxId
- txOutRefIdx :: Integer
- data TxInInfo = TxInInfo { }
- findOwnInput :: ScriptContext -> Maybe TxInInfo
- findDatum :: DatumHash -> TxInfo -> Maybe Datum
- findDatumHash :: Datum -> TxInfo -> Maybe DatumHash
- findTxInByTxOutRef :: TxOutRef -> TxInfo -> Maybe TxInInfo
- findContinuingOutputs :: ScriptContext -> [ Integer ]
- getContinuingOutputs :: ScriptContext -> [ TxOut ]
- pubKeyOutput :: TxOut -> Maybe PubKeyHash
- scriptOutputsAt :: ValidatorHash -> TxInfo -> [( DatumHash , Value )]
- pubKeyOutputsAt :: PubKeyHash -> TxInfo -> [ Value ]
- valueLockedBy :: TxInfo -> ValidatorHash -> Value
- valuePaidTo :: TxInfo -> PubKeyHash -> Value
- spendsOutput :: TxInfo -> TxId -> Integer -> Bool
- txSignedBy :: TxInfo -> PubKeyHash -> Bool
- valueSpent :: TxInfo -> Value
- valueProduced :: TxInfo -> Value
- ownCurrencySymbol :: ScriptContext -> CurrencySymbol
- ownHashes :: ScriptContext -> ( ValidatorHash , DatumHash )
- ownHash :: ScriptContext -> ValidatorHash
- fromSymbol :: CurrencySymbol -> ValidatorHash
Pending transactions and related types
A pending transaction. This is the view as seen by validator scripts, so some details are stripped out.
TxInfo | |
|
Instances
data ScriptContext Source #
Instances
data ScriptPurpose Source #
Purpose of the script that is currently running
Instances
A transaction ID, using a SHA256 hash as the transaction id.
Instances
A transaction output, consisting of a target address, a value, and optionally a datum hash.
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.
TxOutRef | |
|
Instances
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 -> [ Integer ] Source #
Finds all the outputs that pay to the same script address that we are currently spending from, if any.
getContinuingOutputs :: ScriptContext -> [ TxOut ] Source #
Validator functions
pubKeyOutput :: TxOut -> Maybe PubKeyHash Source #
Get the public key hash that locks the transaction output, if any.
scriptOutputsAt :: ValidatorHash -> TxInfo -> [( DatumHash , Value )] Source #
Get the list of
TxOut
outputs of the pending transaction at
a given script address.
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.
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.
ownHashes :: ScriptContext -> ( ValidatorHash , DatumHash ) Source #
Get the validator and datum hashes of the output that is curently being validated
ownHash :: ScriptContext -> ValidatorHash Source #
Get the hash of the validator script that is currently being validated.
fromSymbol :: CurrencySymbol -> ValidatorHash Source #
Convert a
CurrencySymbol
to a
ValidatorHash