| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Plutus.ChainIndex.Tx
Contents
Description
The chain index' version of a transaction
Synopsis
- data ChainIndexTx = ChainIndexTx {}
- data ChainIndexTxOutputs
- data ChainIndexTxOut = ChainIndexTxOut {}
- data ReferenceScript
- data Address = Address {}
- data OutputDatum
- newtype Value = Value {}
- fromOnChainTx :: OnChainTx -> ChainIndexTx
- txOuts :: ChainIndexTx -> [ChainIndexTxOut]
- txOutRefs :: ChainIndexTx -> [TxOutRef]
- txOutsWithRef :: ChainIndexTx -> [(ChainIndexTxOut, TxOutRef)]
- txOutRefMap :: ChainIndexTx -> Map TxOutRef (ChainIndexTxOut, ChainIndexTx)
- txOutRefMapForAddr :: CardanoAddress -> ChainIndexTx -> Map TxOutRef (ChainIndexTxOut, ChainIndexTx)
- txRedeemersWithHash :: ChainIndexTx -> Map RedeemerHash Redeemer
- validityFromChainIndex :: ChainIndexTx -> TxValidity
- citxTxId :: Lens' ChainIndexTx TxId
- citxInputs :: Lens' ChainIndexTx [TxIn]
- citxOutputs :: Lens' ChainIndexTx ChainIndexTxOutputs
- citxValidRange :: Lens' ChainIndexTx SlotRange
- citxData :: Lens' ChainIndexTx (Map DatumHash Datum)
- citxRedeemers :: Lens' ChainIndexTx Redeemers
- citxScripts :: Lens' ChainIndexTx (Map ScriptHash (Versioned Script))
- citxCardanoTx :: Lens' ChainIndexTx (Maybe SomeCardanoApiTx)
- _InvalidTx :: Prism' ChainIndexTxOutputs (Maybe ChainIndexTxOut)
- _ValidTx :: Prism' ChainIndexTxOutputs [ChainIndexTxOut]
Documentation
data ChainIndexTx Source #
Constructors
| ChainIndexTx | |
Fields
| |
Instances
data ChainIndexTxOutputs Source #
List of outputs of a transaction. There is only an optional collateral output if the transaction is invalid.
Constructors
| InvalidTx (Maybe ChainIndexTxOut) | The transaction is invalid so there is maybe a collateral output. |
| ValidTx [ChainIndexTxOut] |
Instances
data ChainIndexTxOut Source #
Constructors
| ChainIndexTxOut | |
Fields
| |
Instances
data ReferenceScript Source #
Instances
Address with two kinds of credentials, normal and staking.
Constructors
| Address | |
Instances
data OutputDatum Source #
The datum attached to an output: either nothing; a datum hash; or the datum itself (an "inline datum").
Constructors
| NoOutputDatum | |
| OutputDatumHash DatumHash | |
| OutputDatum Datum |
Instances
A cryptocurrency value. This is a map from CurrencySymbols to a
quantity of that currency.
Operations on currencies are usually implemented pointwise. That is,
we apply the operation to the quantities for each currency in turn. So
when we add two Values the resulting Value has, for each currency,
the sum of the quantities of that particular currency in the argument
Value. The effect of this is that the currencies in the Value are "independent",
and are operated on separately.
Whenever we need to get the quantity of a currency in a Value where there
is no explicit quantity of that currency in the Value, then the quantity is
taken to be zero.
See note [Currencies] for more details.
Instances
fromOnChainTx :: OnChainTx -> ChainIndexTx Source #
Convert a OnChainTx to a ChainIndexTx. An invalid OnChainTx will not
produce any ChainIndexTx outputs and the collateral inputs of the
OnChainTx will be the inputs of the ChainIndexTx.
txOuts :: ChainIndexTx -> [ChainIndexTxOut] Source #
Get tx outputs from tx.
txOutRefs :: ChainIndexTx -> [TxOutRef] Source #
Get tx output references from tx.
txOutsWithRef :: ChainIndexTx -> [(ChainIndexTxOut, TxOutRef)] Source #
Get tx output references and tx outputs from tx.
txOutRefMap :: ChainIndexTx -> Map TxOutRef (ChainIndexTxOut, ChainIndexTx) Source #
Get Map of tx outputs references to tx.
txOutRefMapForAddr :: CardanoAddress -> ChainIndexTx -> Map TxOutRef (ChainIndexTxOut, ChainIndexTx) Source #
Get Map of tx outputs from tx for a specific address.
Lenses
citxInputs :: Lens' ChainIndexTx [TxIn] Source #