| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PlutusLedgerApi.V2.Data.Contexts
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
- matchTxInfo :: TxInfo -> (List TxInInfo -> List TxInInfo -> List TxOut -> Value -> Value -> List DCert -> Map StakingCredential Integer -> POSIXTimeRange -> List PubKeyHash -> Map ScriptPurpose Redeemer -> Map DatumHash Datum -> TxId -> r) -> r
- 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
- matchScriptContext :: ScriptContext -> (TxInfo -> ScriptPurpose -> r) -> r
- 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
- matchTxInInfo :: TxInInfo -> (TxOutRef -> TxOut -> r) -> r
- 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
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 #
matchTxInfo :: TxInfo -> (List TxInInfo -> List TxInInfo -> List TxOut -> Value -> Value -> List DCert -> Map StakingCredential Integer -> POSIXTimeRange -> List PubKeyHash -> Map ScriptPurpose Redeemer -> Map DatumHash Datum -> TxId -> r) -> r Source #
txInfoInputs :: TxInfo -> List TxInInfo Source #
txInfoReferenceInputs :: TxInfo -> List TxInInfo Source #
txInfoOutputs :: TxInfo -> List TxOut Source #
txInfoMint :: TxInfo -> Value Source #
txInfoDCert :: TxInfo -> List DCert Source #
txInfoSignatories :: TxInfo -> List PubKeyHash Source #
data ScriptContext Source #
The context that the currently-executing script can access.
Instances
| Generic ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Associated Types
Methods from :: ScriptContext -> Rep ScriptContext x Source # to :: Rep ScriptContext x -> ScriptContext Source # | |||||
| Show ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts | |||||
| FromData ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Methods | |||||
| ToData ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Methods | |||||
| UnsafeFromData ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Methods | |||||
| Pretty ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts | |||||
| Lift DefaultUni ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Methods lift :: ScriptContext -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) | |||||
| Typeable DefaultUni ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Methods typeRep :: Proxy ScriptContext -> RTCompile DefaultUni fun (Type TyName DefaultUni ()) | |||||
| type Rep ScriptContext Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts type Rep ScriptContext = D1 ('MetaData "ScriptContext" "PlutusLedgerApi.V2.Data.Contexts" "plutus-ledger-api-1.60.0.0-G1HmqwHNllaA7AnJNjAfhP" 'True) (C1 ('MetaCons "ScriptContext_6989586621680200472" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData))) | |||||
pattern ScriptContext :: TxInfo -> ScriptPurpose -> ScriptContext Source #
matchScriptContext :: ScriptContext -> (TxInfo -> ScriptPurpose -> r) -> r Source #
data ScriptPurpose Source #
Purpose of the script that is currently running
Instances
| Generic ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts Associated Types
Methods from :: ScriptPurpose -> Rep ScriptPurpose x Source # to :: Rep ScriptPurpose x -> ScriptPurpose Source # | |||||
| Show ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts | |||||
| Eq ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts Methods (==) :: ScriptPurpose -> ScriptPurpose -> Bool Source # (/=) :: ScriptPurpose -> ScriptPurpose -> Bool Source # | |||||
| Eq ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts Methods (==) :: ScriptPurpose -> ScriptPurpose -> Bool | |||||
| FromData ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts Methods | |||||
| ToData ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts Methods | |||||
| UnsafeFromData ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts Methods | |||||
| Pretty ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts | |||||
| Lift DefaultUni ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts Methods lift :: ScriptPurpose -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ()) | |||||
| Typeable DefaultUni ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts Methods typeRep :: Proxy ScriptPurpose -> RTCompile DefaultUni fun (Type TyName DefaultUni ()) | |||||
| type Rep ScriptPurpose Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Contexts type Rep ScriptPurpose = D1 ('MetaData "ScriptPurpose" "PlutusLedgerApi.V1.Data.Contexts" "plutus-ledger-api-1.60.0.0-G1HmqwHNllaA7AnJNjAfhP" 'True) (C1 ('MetaCons "ScriptPurpose_6989586621680163311" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData))) | |||||
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
Constructors
| TxId | |
Fields | |
Instances
| IsString TxId Source # | from hex encoding | ||||
Defined in PlutusLedgerApi.V1.Data.Tx Methods fromString :: String -> TxId Source # | |||||
| Generic TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx Associated Types
| |||||
| Show TxId Source # | using hex encoding | ||||
| NFData TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| Eq TxId Source # | |||||
| Ord TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| Eq TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| FromData TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx Methods fromBuiltinData :: BuiltinData -> Maybe TxId # | |||||
| ToData TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx Methods toBuiltinData :: TxId -> BuiltinData # | |||||
| UnsafeFromData TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx Methods | |||||
| Ord TxId Source # | |||||
| Pretty TxId Source # | using hex encoding | ||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| Lift DefaultUni TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| Typeable DefaultUni TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| type Rep TxId Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx type Rep TxId = D1 ('MetaData "TxId" "PlutusLedgerApi.V1.Data.Tx" "plutus-ledger-api-1.60.0.0-G1HmqwHNllaA7AnJNjAfhP" 'True) (C1 ('MetaCons "TxId" 'PrefixI 'True) (S1 ('MetaSel ('Just "getTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinByteString))) | |||||
A transaction output, consisting of a target address, a value, optionally a datum/datum hash, and optionally a reference script.
Instances
| Generic TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx Associated Types
| |||||
| Show TxOut Source # | |||||
| Eq TxOut Source # | |||||
| Eq TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx | |||||
| FromData TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx Methods fromBuiltinData :: BuiltinData -> Maybe TxOut # | |||||
| ToData TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx Methods toBuiltinData :: TxOut -> BuiltinData # | |||||
| UnsafeFromData TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx Methods | |||||
| Pretty TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx | |||||
| Lift DefaultUni TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx | |||||
| Typeable DefaultUni TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx | |||||
| type Rep TxOut Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Tx type Rep TxOut = D1 ('MetaData "TxOut" "PlutusLedgerApi.V2.Data.Tx" "plutus-ledger-api-1.60.0.0-G1HmqwHNllaA7AnJNjAfhP" 'True) (C1 ('MetaCons "TxOut_6989586621680147101" '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 #
txOutDatum :: TxOut -> OutputDatum 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
| Generic TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx Associated Types
| |||||
| Show TxOutRef Source # | |||||
| NFData TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| Eq TxOutRef Source # | |||||
| Ord TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| Eq TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| FromData TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx Methods fromBuiltinData :: BuiltinData -> Maybe TxOutRef # | |||||
| ToData TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx Methods toBuiltinData :: TxOutRef -> BuiltinData # | |||||
| UnsafeFromData TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx Methods | |||||
| Pretty TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| Lift DefaultUni TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| Typeable DefaultUni TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx | |||||
| type Rep TxOutRef Source # | |||||
Defined in PlutusLedgerApi.V1.Data.Tx type Rep TxOutRef = D1 ('MetaData "TxOutRef" "PlutusLedgerApi.V1.Data.Tx" "plutus-ledger-api-1.60.0.0-G1HmqwHNllaA7AnJNjAfhP" 'True) (C1 ('MetaCons "TxOutRef_6989586621680121377" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData))) | |||||
txOutRefId :: TxOutRef -> TxId Source #
txOutRefIdx :: TxOutRef -> Integer Source #
An input of a pending transaction.
Instances
| Generic TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Associated Types
| |||||
| Show TxInInfo Source # | |||||
| Eq TxInInfo Source # | |||||
| Eq TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts | |||||
| FromData TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Methods fromBuiltinData :: BuiltinData -> Maybe TxInInfo # | |||||
| ToData TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Methods toBuiltinData :: TxInInfo -> BuiltinData # | |||||
| UnsafeFromData TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts Methods | |||||
| Pretty TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts | |||||
| Lift DefaultUni TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts | |||||
| Typeable DefaultUni TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts | |||||
| type Rep TxInInfo Source # | |||||
Defined in PlutusLedgerApi.V2.Data.Contexts type Rep TxInInfo = D1 ('MetaData "TxInInfo" "PlutusLedgerApi.V2.Data.Contexts" "plutus-ledger-api-1.60.0.0-G1HmqwHNllaA7AnJNjAfhP" 'True) (C1 ('MetaCons "TxInInfo_6989586621680197677" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinData))) | |||||
txInInfoOutRef :: TxInInfo -> TxOutRef Source #
txInInfoResolved :: TxInInfo -> TxOut Source #
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.