cardano-ledger-api-1.9.2.2: Public API for the cardano ledger codebase
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Api.Tx.Body

Synopsis

Documentation

Building and inspecting transaction outputs

Working with Timelock scripts and Plutus 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 #

Associated Types

type TxBody era = (r ∷ Type) | r → era Source #

The body of a transaction.

newtype Withdrawals c Source #

This is called wdrl in the spec.

Constructors

Withdrawals 

Instances

Instances details
Generic (Withdrawals c) 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep (Withdrawals c) ∷ TypeType Source #

Methods

fromWithdrawals c → Rep (Withdrawals c) x Source #

toRep (Withdrawals c) x → Withdrawals c Source #

Show (Withdrawals c) 
Instance details

Defined in Cardano.Ledger.Address

Crypto c ⇒ DecCBOR (Withdrawals c) 
Instance details

Defined in Cardano.Ledger.Address

Crypto c ⇒ EncCBOR (Withdrawals c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

encCBORWithdrawals c → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (Withdrawals c) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Withdrawals c] → Size Source #

NFData (Withdrawals c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfWithdrawals c → () Source #

Eq (Withdrawals c) 
Instance details

Defined in Cardano.Ledger.Address

NoThunks (Withdrawals c) 
Instance details

Defined in Cardano.Ledger.Address

type Rep (Withdrawals c) 
Instance details

Defined in Cardano.Ledger.Address

type Rep (Withdrawals c) = D1 ('MetaData "Withdrawals" "Cardano.Ledger.Address" "cardano-ledger-core-1.14.0.0-inplace" 'True) (C1 ('MetaCons "Withdrawals" 'PrefixI 'True) (S1 ('MetaSel ('Just "unWithdrawals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (RewardAcnt c) Coin))))

data AuxiliaryDataHash c Source #

Instances

Instances details
Crypto c ⇒ ToJSON (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

Generic (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

Associated Types

type Rep (AuxiliaryDataHash c) ∷ TypeType Source #

Show (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

Crypto c ⇒ DecCBOR (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

Crypto c ⇒ EncCBOR (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

NFData (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

Methods

rnfAuxiliaryDataHash c → () Source #

Eq (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

Ord (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

NoThunks (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

type Rep (AuxiliaryDataHash c) 
Instance details

Defined in Cardano.Ledger.AuxiliaryData

type Rep (AuxiliaryDataHash c) = D1 ('MetaData "AuxiliaryDataHash" "Cardano.Ledger.AuxiliaryData" "cardano-ledger-core-1.14.0.0-inplace" 'True) (C1 ('MetaCons "AuxiliaryDataHash" 'PrefixI 'True) (S1 ('MetaSel ('Just "unsafeAuxiliaryDataHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SafeHash c EraIndependentTxAuxData))))

spendableInputsTxBodyFEraTxBody 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.

allInputsTxBodyFEraTxBody 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.

evalBalanceTxBody Source #

Arguments

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 DeRegKey delegation certificates in the supplied TxBody. In other words, there is no requirement to know about all of the delegation certificates in the ledger state, just the ones this transaction cares about.

→ (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 UnRegDRep certificates in the supplied TxBody. In other words, there is no requirement to know about all of the DRep registrations in the ledger state, just the ones this transaction cares about.

→ (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 TxBody

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

txIdTxBodyEraTxBody era ⇒ TxBody era → TxId (EraCrypto era) Source #

Shelley Era

class (ShelleyEraTxCert era, EraTxBody era, ProtVerAtMost era 8) ⇒ ShelleyEraTxBody era Source #

Minimal complete definition

ttlTxBodyL, updateTxBodyL

Instances

Instances details
Crypto c ⇒ ShelleyEraTxBody (ShelleyEra c) 
Instance details

Defined in Cardano.Ledger.Shelley.TxBody

Allegra Era

class EraTxBody era ⇒ AllegraEraTxBody era Source #

Minimal complete definition

vldtTxBodyL

Instances

Instances details
Crypto c ⇒ AllegraEraTxBody (AllegraEra c) 
Instance details

Defined in Cardano.Ledger.Allegra.TxBody

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

Instances details
ToJSON ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Generic ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Associated Types

type Rep ValidityIntervalTypeType Source #

Show ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

DecCBOR ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

EncCBOR ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

NFData ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

rnfValidityInterval → () Source #

Eq ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Ord ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

NoThunks ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type Rep ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type Rep ValidityInterval = D1 ('MetaData "ValidityInterval" "Cardano.Ledger.Allegra.Scripts" "cardano-ledger-allegra-1.5.0.1-inplace" 'False) (C1 ('MetaCons "ValidityInterval" 'PrefixI 'True) (S1 ('MetaSel ('Just "invalidBefore") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe SlotNo)) :*: S1 ('MetaSel ('Just "invalidHereafter") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe SlotNo))))

invalidBeforeLLens' ValidityInterval (Maybe SlotNo) Source #

Lens to access the invalidBefore field of a ValidityInterval as a 'Maybe SlotNo'.

invalidHereAfterLLens' ValidityInterval (Maybe SlotNo) Source #

Lens to access the invalidHereAfter field of a ValidityInterval as a 'Maybe SlotNo'.

Mary Era

Alonzo Era

redeemerPointerAlonzoEraTxBody 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

redeemerPointerInverseAlonzoEraTxBody 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

Conway Era

votingProceduresTxBodyLConwayEraTxBody era ⇒ Lens' (TxBody era) (VotingProcedures era) Source #

Lens for getting and setting VotingProcedures.

proposalProceduresTxBodyLConwayEraTxBody era ⇒ Lens' (TxBody era) (OSet (ProposalProcedure era)) Source #

Lens for getting and setting ProposalProcedures.