Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- module Cardano.Ledger.Api.Tx.Out
- module Cardano.Ledger.Api.Scripts
- class (EraTxOut era, EraTxCert era, EraPParams era, HashAnnotated (TxBody era) EraIndependentTxBody, DecCBOR (Annotator (TxBody era)), EncCBOR (TxBody era), ToCBOR (TxBody era), NoThunks (TxBody era), NFData (TxBody era), Show (TxBody era), Eq (TxBody era), EqRaw (TxBody era)) ⇒ EraTxBody era where
- mkBasicTxBody ∷ EraTxBody era ⇒ TxBody era
- inputsTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (Set TxIn)
- outputsTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (StrictSeq (TxOut era))
- feeTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) Coin
- withdrawalsTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) Withdrawals
- newtype Withdrawals = Withdrawals {}
- auxDataHashTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe TxAuxDataHash)
- newtype TxAuxDataHash = TxAuxDataHash {}
- type AuxiliaryDataHash = TxAuxDataHash
- spendableInputsTxBodyF ∷ EraTxBody era ⇒ SimpleGetter (TxBody era) (Set TxIn)
- allInputsTxBodyF ∷ EraTxBody era ⇒ SimpleGetter (TxBody era) (Set TxIn)
- evalBalanceTxBody ∷ EraUTxO era ⇒ PParams era → (Credential 'Staking → Maybe Coin) → (Credential 'DRepRole → Maybe Coin) → (KeyHash 'StakePool → Bool) → UTxO era → TxBody era → Value era
- txIdTxBody ∷ EraTxBody era ⇒ TxBody era → TxId
- class (ShelleyEraTxCert era, EraTxBody era, ProtVerAtMost era 8) ⇒ ShelleyEraTxBody era
- ttlTxBodyL ∷ ShelleyEraTxBody era ⇒ Lens' (TxBody era) SlotNo
- updateTxBodyL ∷ ShelleyEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (Update era))
- certsTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (StrictSeq (TxCert era))
- class EraTxBody era ⇒ AllegraEraTxBody era
- vldtTxBodyL ∷ AllegraEraTxBody era ⇒ Lens' (TxBody era) ValidityInterval
- data ValidityInterval = ValidityInterval {}
- invalidBeforeL ∷ Lens' ValidityInterval (Maybe SlotNo)
- invalidHereAfterL ∷ Lens' ValidityInterval (Maybe SlotNo)
- class AllegraEraTxBody era ⇒ MaryEraTxBody era
- mintTxBodyL ∷ MaryEraTxBody era ⇒ Lens' (TxBody era) MultiAsset
- mintValueTxBodyF ∷ MaryEraTxBody era ⇒ SimpleGetter (TxBody era) (Value era)
- mintedTxBodyF ∷ MaryEraTxBody era ⇒ SimpleGetter (TxBody era) (Set PolicyID)
- class (MaryEraTxBody era, AlonzoEraTxOut era) ⇒ AlonzoEraTxBody era
- collateralInputsTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (Set TxIn)
- reqSignerHashesTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (Set (KeyHash 'Witness))
- scriptIntegrityHashTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe ScriptIntegrityHash)
- networkIdTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe Network)
- redeemerPointer ∷ AlonzoEraTxBody era ⇒ TxBody era → PlutusPurpose AsItem era → StrictMaybe (PlutusPurpose AsIx era)
- redeemerPointerInverse ∷ AlonzoEraTxBody era ⇒ TxBody era → PlutusPurpose AsIx era → StrictMaybe (PlutusPurpose AsIxItem era)
- class (AlonzoEraTxBody era, BabbageEraTxOut era) ⇒ BabbageEraTxBody era
- sizedOutputsTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictSeq (Sized (TxOut era)))
- referenceInputsTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (Set TxIn)
- totalCollateralTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe Coin)
- collateralReturnTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (TxOut era))
- sizedCollateralReturnTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (Sized (TxOut era)))
- allSizedOutputsTxBodyF ∷ BabbageEraTxBody era ⇒ SimpleGetter (TxBody era) (StrictSeq (Sized (TxOut era)))
- class (BabbageEraTxBody era, ConwayEraTxCert era, ConwayEraPParams era, ConwayEraScript era) ⇒ ConwayEraTxBody era
- votingProceduresTxBodyL ∷ ConwayEraTxBody era ⇒ Lens' (TxBody era) (VotingProcedures era)
- proposalProceduresTxBodyL ∷ ConwayEraTxBody era ⇒ Lens' (TxBody era) (OSet (ProposalProcedure era))
Documentation
Building and inspecting transaction outputs
module Cardano.Ledger.Api.Tx.Out
Working with Timelock scripts and Plutus scripts
module Cardano.Ledger.Api.Scripts
class (EraTxOut era, EraTxCert era, EraPParams era, HashAnnotated (TxBody era) EraIndependentTxBody, DecCBOR (Annotator (TxBody era)), EncCBOR (TxBody era), ToCBOR (TxBody era), NoThunks (TxBody era), NFData (TxBody era), Show (TxBody era), Eq (TxBody era), EqRaw (TxBody era)) ⇒ EraTxBody era Source #
mkBasicTxBody ∷ EraTxBody era ⇒ TxBody era Source #
withdrawalsTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) Withdrawals Source #
newtype Withdrawals Source #
This is called wdrl
in the spec.
Instances
auxDataHashTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe TxAuxDataHash) Source #
newtype TxAuxDataHash Source #
Instances
type AuxiliaryDataHash = TxAuxDataHash Source #
spendableInputsTxBodyF ∷ EraTxBody era ⇒ SimpleGetter (TxBody era) (Set TxIn) Source #
This getter will produce all inputs from the UTxO map that this transaction might spend, which ones will depend on the validity of the transaction itself. Starting in Alonzo this will include collateral inputs.
allInputsTxBodyF ∷ EraTxBody era ⇒ SimpleGetter (TxBody era) (Set TxIn) Source #
This getter will produce all inputs from the UTxO map that this transaction is referencing, even if some of them cannot be spent by the transaction. For example starting with Babbage era it will also include reference inputs.
∷ EraUTxO era | |
⇒ PParams era | Current protocol parameters |
→ (Credential 'Staking → Maybe Coin) | Lookup current deposit amount for a registered stake credential delegation. This
function must produce valid answer for all of the stake credentials present in any of
the |
→ (Credential 'DRepRole → Maybe Coin) | Lookup current deposit amount for a registered DRep credential. This
function must produce valid answer for all of the DRep credentials present in any of
the |
→ (KeyHash 'StakePool → Bool) | Check whether a pool with a supplied PoolStakeId is already registered. There is no
requirement to answer this question for all stake pool credentials, just for the ones
that have the registration certificates included in the supplied |
→ UTxO era | The UTxO relevant to the transaction. |
→ TxBody era | The transaction being evaluated for balance. |
→ Value era | The difference between what the transaction consumes and what it produces. |
Evaluate the difference between the value currently being consumed by a transaction and the total value being produced. This value will be zero for a valid transaction.
In case when full CertState
is available then this can be simplified to:
let lookupRefund = lookupDepositDState (certDState dpState) let isRegPoolId = (`Map.member` psStakePoolParams (certPState dpState)) evalBalanceTxBody pp lookupRefund isRegPoolId utxo txBody
Shelley Era
class (ShelleyEraTxCert era, EraTxBody era, ProtVerAtMost era 8) ⇒ ShelleyEraTxBody era Source #
Instances
ttlTxBodyL ∷ ShelleyEraTxBody era ⇒ Lens' (TxBody era) SlotNo Source #
updateTxBodyL ∷ ShelleyEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (Update era)) Source #
Allegra Era
class EraTxBody era ⇒ AllegraEraTxBody era Source #
Instances
vldtTxBodyL ∷ AllegraEraTxBody era ⇒ Lens' (TxBody era) ValidityInterval Source #
data ValidityInterval Source #
ValidityInterval is a half open interval. Closed on the bottom, open on the top. A SNothing on the bottom is negative infinity, and a SNothing on the top is positive infinity
Instances
invalidBeforeL ∷ Lens' ValidityInterval (Maybe SlotNo) Source #
Lens to access the invalidBefore
field of a ValidityInterval
as a 'Maybe SlotNo'.
invalidHereAfterL ∷ Lens' ValidityInterval (Maybe SlotNo) Source #
Lens to access the invalidHereAfter
field of a ValidityInterval
as a 'Maybe SlotNo'.
Mary Era
class AllegraEraTxBody era ⇒ MaryEraTxBody era Source #
Instances
mintTxBodyL ∷ MaryEraTxBody era ⇒ Lens' (TxBody era) MultiAsset Source #
mintValueTxBodyF ∷ MaryEraTxBody era ⇒ SimpleGetter (TxBody era) (Value era) Source #
mintedTxBodyF ∷ MaryEraTxBody era ⇒ SimpleGetter (TxBody era) (Set PolicyID) Source #
Alonzo Era
class (MaryEraTxBody era, AlonzoEraTxOut era) ⇒ AlonzoEraTxBody era Source #
collateralInputsTxBodyL, reqSignerHashesTxBodyL, scriptIntegrityHashTxBodyL, networkIdTxBodyL, redeemerPointer, redeemerPointerInverse
Instances
collateralInputsTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (Set TxIn) Source #
reqSignerHashesTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (Set (KeyHash 'Witness)) Source #
scriptIntegrityHashTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe ScriptIntegrityHash) Source #
networkIdTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe Network) Source #
redeemerPointer ∷ AlonzoEraTxBody era ⇒ TxBody era → PlutusPurpose AsItem era → StrictMaybe (PlutusPurpose AsIx era) Source #
This function is called rdptr
in the spec. Given a TxBody
and a plutus
purpose with an item, we should be able to find the plutus purpose as in index
redeemerPointerInverse ∷ AlonzoEraTxBody era ⇒ TxBody era → PlutusPurpose AsIx era → StrictMaybe (PlutusPurpose AsIxItem era) Source #
This is an inverse of redeemerPointer
. Given purpose as an index return it as an item.
Babbage Era
class (AlonzoEraTxBody era, BabbageEraTxOut era) ⇒ BabbageEraTxBody era Source #
sizedOutputsTxBodyL, referenceInputsTxBodyL, totalCollateralTxBodyL, collateralReturnTxBodyL, sizedCollateralReturnTxBodyL, allSizedOutputsTxBodyF
Instances
sizedOutputsTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictSeq (Sized (TxOut era))) Source #
referenceInputsTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (Set TxIn) Source #
totalCollateralTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe Coin) Source #
collateralReturnTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (TxOut era)) Source #
sizedCollateralReturnTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (Sized (TxOut era))) Source #
allSizedOutputsTxBodyF ∷ BabbageEraTxBody era ⇒ SimpleGetter (TxBody era) (StrictSeq (Sized (TxOut era))) Source #
Conway Era
class (BabbageEraTxBody era, ConwayEraTxCert era, ConwayEraPParams era, ConwayEraScript era) ⇒ ConwayEraTxBody era Source #
currentTreasuryValueTxBodyL, votingProceduresTxBodyL, proposalProceduresTxBodyL, treasuryDonationTxBodyL
Instances
votingProceduresTxBodyL ∷ ConwayEraTxBody era ⇒ Lens' (TxBody era) (VotingProcedures era) Source #
Lens for getting and setting VotingProcedures
.
proposalProceduresTxBodyL ∷ ConwayEraTxBody era ⇒ Lens' (TxBody era) (OSet (ProposalProcedure era)) Source #
Lens for getting and setting ProposalProcedures
.