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 (EraCrypto era), 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 (EraCrypto era)))
- outputsTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (StrictSeq (TxOut era))
- feeTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) Coin
- withdrawalsTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (Withdrawals (EraCrypto era))
- newtype Withdrawals c = Withdrawals {
- unWithdrawals ∷ Map (RewardAccount c) Coin
- auxDataHashTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (AuxiliaryDataHash (EraCrypto era)))
- data AuxiliaryDataHash c
- spendableInputsTxBodyF ∷ EraTxBody era ⇒ SimpleGetter (TxBody era) (Set (TxIn (EraCrypto era)))
- allInputsTxBodyF ∷ EraTxBody era ⇒ SimpleGetter (TxBody era) (Set (TxIn (EraCrypto era)))
- evalBalanceTxBody ∷ EraUTxO era ⇒ PParams era → (Credential 'Staking (EraCrypto era) → Maybe Coin) → (Credential 'DRepRole (EraCrypto era) → Maybe Coin) → (KeyHash 'StakePool (EraCrypto era) → Bool) → UTxO era → TxBody era → Value era
- txIdTxBody ∷ EraTxBody era ⇒ TxBody era → TxId (EraCrypto era)
- 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 (EraCrypto era))
- mintValueTxBodyF ∷ MaryEraTxBody era ⇒ SimpleGetter (TxBody era) (Value era)
- mintedTxBodyF ∷ MaryEraTxBody era ⇒ SimpleGetter (TxBody era) (Set (PolicyID (EraCrypto era)))
- class (MaryEraTxBody era, AlonzoEraTxOut era) ⇒ AlonzoEraTxBody era
- collateralInputsTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (Set (TxIn (EraCrypto era)))
- reqSignerHashesTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (Set (KeyHash 'Witness (EraCrypto era)))
- scriptIntegrityHashTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (ScriptIntegrityHash (EraCrypto era)))
- 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 (EraCrypto era)))
- 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 (EraCrypto era), 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 (EraCrypto era)) Source #
newtype Withdrawals c Source #
This is called wdrl
in the spec.
Instances
auxDataHashTxBodyL ∷ EraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (AuxiliaryDataHash (EraCrypto era))) Source #
data AuxiliaryDataHash c Source #
Instances
spendableInputsTxBodyF ∷ EraTxBody era ⇒ SimpleGetter (TxBody era) (Set (TxIn (EraCrypto era))) 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 (EraCrypto era))) 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 (EraCrypto era) → 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 (EraCrypto era) → 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 (EraCrypto era) → 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
Crypto c ⇒ ShelleyEraTxBody (ShelleyEra c) | |
Defined in Cardano.Ledger.Shelley.TxBody ttlTxBodyL ∷ Lens' (TxBody (ShelleyEra c)) SlotNo Source # updateTxBodyL ∷ Lens' (TxBody (ShelleyEra c)) (StrictMaybe (Update (ShelleyEra c))) Source # |
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
Crypto c ⇒ AllegraEraTxBody (AllegraEra c) | |
Defined in Cardano.Ledger.Allegra.TxBody.Internal vldtTxBodyL ∷ Lens' (TxBody (AllegraEra c)) ValidityInterval Source # |
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
Crypto c ⇒ MaryEraTxBody (MaryEra c) | |
Defined in Cardano.Ledger.Mary.TxBody.Internal mintTxBodyL ∷ Lens' (TxBody (MaryEra c)) (MultiAsset (EraCrypto (MaryEra c))) Source # mintValueTxBodyF ∷ SimpleGetter (TxBody (MaryEra c)) (Value (MaryEra c)) Source # mintedTxBodyF ∷ SimpleGetter (TxBody (MaryEra c)) (Set (PolicyID (EraCrypto (MaryEra c)))) Source # |
mintTxBodyL ∷ MaryEraTxBody era ⇒ Lens' (TxBody era) (MultiAsset (EraCrypto era)) Source #
mintValueTxBodyF ∷ MaryEraTxBody era ⇒ SimpleGetter (TxBody era) (Value era) Source #
mintedTxBodyF ∷ MaryEraTxBody era ⇒ SimpleGetter (TxBody era) (Set (PolicyID (EraCrypto era))) Source #
Alonzo Era
class (MaryEraTxBody era, AlonzoEraTxOut era) ⇒ AlonzoEraTxBody era Source #
collateralInputsTxBodyL, reqSignerHashesTxBodyL, scriptIntegrityHashTxBodyL, networkIdTxBodyL, redeemerPointer, redeemerPointerInverse
Instances
Crypto c ⇒ AlonzoEraTxBody (AlonzoEra c) | |
Defined in Cardano.Ledger.Alonzo.TxBody.Internal collateralInputsTxBodyL ∷ Lens' (TxBody (AlonzoEra c)) (Set (TxIn (EraCrypto (AlonzoEra c)))) Source # reqSignerHashesTxBodyL ∷ Lens' (TxBody (AlonzoEra c)) (Set (KeyHash 'Witness (EraCrypto (AlonzoEra c)))) Source # scriptIntegrityHashTxBodyL ∷ Lens' (TxBody (AlonzoEra c)) (StrictMaybe (ScriptIntegrityHash (EraCrypto (AlonzoEra c)))) Source # networkIdTxBodyL ∷ Lens' (TxBody (AlonzoEra c)) (StrictMaybe Network) Source # redeemerPointer ∷ TxBody (AlonzoEra c) → PlutusPurpose AsItem (AlonzoEra c) → StrictMaybe (PlutusPurpose AsIx (AlonzoEra c)) Source # redeemerPointerInverse ∷ TxBody (AlonzoEra c) → PlutusPurpose AsIx (AlonzoEra c) → StrictMaybe (PlutusPurpose AsIxItem (AlonzoEra c)) Source # |
collateralInputsTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (Set (TxIn (EraCrypto era))) Source #
reqSignerHashesTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (Set (KeyHash 'Witness (EraCrypto era))) Source #
scriptIntegrityHashTxBodyL ∷ AlonzoEraTxBody era ⇒ Lens' (TxBody era) (StrictMaybe (ScriptIntegrityHash (EraCrypto era))) 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
Crypto c ⇒ BabbageEraTxBody (BabbageEra c) | |
Defined in Cardano.Ledger.Babbage.TxBody.Internal sizedOutputsTxBodyL ∷ Lens' (TxBody (BabbageEra c)) (StrictSeq (Sized (TxOut (BabbageEra c)))) Source # referenceInputsTxBodyL ∷ Lens' (TxBody (BabbageEra c)) (Set (TxIn (EraCrypto (BabbageEra c)))) Source # totalCollateralTxBodyL ∷ Lens' (TxBody (BabbageEra c)) (StrictMaybe Coin) Source # collateralReturnTxBodyL ∷ Lens' (TxBody (BabbageEra c)) (StrictMaybe (TxOut (BabbageEra c))) Source # sizedCollateralReturnTxBodyL ∷ Lens' (TxBody (BabbageEra c)) (StrictMaybe (Sized (TxOut (BabbageEra c)))) Source # allSizedOutputsTxBodyF ∷ SimpleGetter (TxBody (BabbageEra c)) (StrictSeq (Sized (TxOut (BabbageEra c)))) Source # |
sizedOutputsTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (StrictSeq (Sized (TxOut era))) Source #
referenceInputsTxBodyL ∷ BabbageEraTxBody era ⇒ Lens' (TxBody era) (Set (TxIn (EraCrypto era))) 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
Crypto c ⇒ ConwayEraTxBody (ConwayEra c) | |
Defined in Cardano.Ledger.Conway.TxBody.Internal currentTreasuryValueTxBodyL ∷ Lens' (TxBody (ConwayEra c)) (StrictMaybe Coin) Source # votingProceduresTxBodyL ∷ Lens' (TxBody (ConwayEra c)) (VotingProcedures (ConwayEra c)) Source # proposalProceduresTxBodyL ∷ Lens' (TxBody (ConwayEra c)) (OSet (ProposalProcedure (ConwayEra c))) Source # treasuryDonationTxBodyL ∷ Lens' (TxBody (ConwayEra c)) Coin Source # |
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
.