cardano-ledger-api-1.11.0.0: 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, 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 Source #

This is called wdrl in the spec.

Instances

Instances details
Generic Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep WithdrawalsTypeType Source #

Show Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

DecCBOR Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

Methods

encCBORWithdrawalsEncoding Source #

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

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

NFData Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfWithdrawals → () Source #

Eq Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

NoThunks Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

type Rep Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

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

newtype TxAuxDataHash Source #

Instances

Instances details
ToJSON TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

Generic TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep TxAuxDataHashTypeType Source #

Show TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

DecCBOR TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

EncCBOR TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

NFData TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

rnfTxAuxDataHash → () Source #

Eq TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

Ord TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

NoThunks TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep TxAuxDataHash 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep TxAuxDataHash = D1 ('MetaData "TxAuxDataHash" "Cardano.Ledger.Hashes" "cardano-ledger-core-1.17.0.0-inplace" 'True) (C1 ('MetaCons "TxAuxDataHash" 'PrefixI 'True) (S1 ('MetaSel ('Just "unTxAuxDataHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SafeHash EraIndependentTxAuxData))))

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

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

evalBalanceTxBody Source #

Arguments

EraUTxO era 
PParams era

Current protocol parameters

→ (Credential 'StakingMaybe 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 'DRepRoleMaybe 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 'StakePoolBool)

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 Source #

Shelley Era

Allegra Era

class EraTxBody era ⇒ AllegraEraTxBody era Source #

Minimal complete definition

vldtTxBodyL

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