cardano-ledger-core-1.12.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.UTxO

Synopsis

Primitives

newtype UTxO era Source #

The unspent transaction outputs.

Constructors

UTxO 

Fields

Instances

Instances details
(Era era, ToJSON (TxOut era)) ⇒ ToJSON (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

toJSONUTxO era → Value Source #

toEncodingUTxO era → Encoding Source #

toJSONList ∷ [UTxO era] → Value Source #

toEncodingList ∷ [UTxO era] → Encoding Source #

omitFieldUTxO era → Bool Source #

Era era ⇒ Monoid (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

memptyUTxO era Source #

mappendUTxO era → UTxO era → UTxO era Source #

mconcat ∷ [UTxO era] → UTxO era Source #

Semigroup (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

(<>)UTxO era → UTxO era → UTxO era Source #

sconcatNonEmpty (UTxO era) → UTxO era Source #

stimesIntegral b ⇒ b → UTxO era → UTxO era Source #

Generic (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Associated Types

type Rep (UTxO era) ∷ TypeType Source #

Methods

fromUTxO era → Rep (UTxO era) x Source #

toRep (UTxO era) x → UTxO era Source #

(Show (TxOut era), Crypto (EraCrypto era)) ⇒ Show (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

showsPrecIntUTxO era → ShowS Source #

showUTxO era → String Source #

showList ∷ [UTxO era] → ShowS Source #

(DecCBOR (TxOut era), Era era) ⇒ FromCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

fromCBORDecoder s (UTxO era) Source #

labelProxy (UTxO era) → Text Source #

(EncCBOR (TxOut era), Era era) ⇒ ToCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

toCBORUTxO era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (UTxO era) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [UTxO era] → Size Source #

(Era era, DecCBOR (TxOut era)) ⇒ DecCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

decCBORDecoder s (UTxO era) Source #

dropCBORProxy (UTxO era) → Decoder s () Source #

labelProxy (UTxO era) → Text Source #

(Crypto (EraCrypto era), DecShareCBOR (TxOut era), Share (TxOut era) ~ Interns (Credential 'Staking (EraCrypto era))) ⇒ DecShareCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Associated Types

type Share (UTxO era) Source #

Methods

getShareUTxO era → Share (UTxO era) Source #

decShareCBORShare (UTxO era) → Decoder s (UTxO era) Source #

decSharePlusCBORStateT (Share (UTxO era)) (Decoder s) (UTxO era) Source #

(Era era, EncCBOR (TxOut era)) ⇒ EncCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

encCBORUTxO era → Encoding Source #

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

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

Default (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

defUTxO era Source #

(Era era, NFData (TxOut era)) ⇒ NFData (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

rnfUTxO era → () Source #

(Era era, Eq (TxOut era)) ⇒ Eq (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

(==)UTxO era → UTxO era → Bool Source #

(/=)UTxO era → UTxO era → Bool Source #

NoThunks (TxOut era) ⇒ NoThunks (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

type Rep (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

type Rep (UTxO era) = D1 ('MetaData "UTxO" "Cardano.Ledger.UTxO" "cardano-ledger-core-1.12.0.0-inplace" 'True) (C1 ('MetaCons "UTxO" 'PrefixI 'True) (S1 ('MetaSel ('Just "unUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (TxIn (EraCrypto era)) (TxOut era)))))
type Share (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

class EraTx era ⇒ EraUTxO era where Source #

Associated Types

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

A customizable type on per era basis for the information required to find all scripts needed for the transaction.

Methods

getConsumedValue Source #

Arguments

PParams era 
→ (Credential 'Staking (EraCrypto era) → Maybe Coin)

Function that can lookup current delegation deposits

→ (Credential 'DRepRole (EraCrypto era) → Maybe Coin)

Function that can lookup current drep deposits

UTxO era 
TxBody era 
Value era 

Calculate all the value that is being consumed by the transaction.

getProducedValue Source #

Arguments

PParams era 
→ (KeyHash 'StakePool (EraCrypto era) → Bool)

Check whether a pool with a supplied PoolStakeId is already registered.

TxBody era 
Value era 

getScriptsProvided Source #

Arguments

UTxO era

For some era it is necessary to look into the UTxO to find all of the available scripts for the transaction

Tx era 
ScriptsProvided era 

Initial eras will look into witness set to find all of the available scripts, but starting with Babbage we can look for available scripts in the UTxO using reference inputs.

getScriptsNeededUTxO era → TxBody era → ScriptsNeeded era Source #

Produce all the information required for figuring out which scripts are required for the transaction to be valid, once those scripts are evaluated

getScriptsHashesNeededScriptsNeeded era → Set (ScriptHash (EraCrypto era)) Source #

Extract the set of all script hashes that are needed for script validation.

getWitsVKeyNeededCertState era → UTxO era → TxBody era → Set (KeyHash 'Witness (EraCrypto era)) Source #

Extract all of the KeyHash witnesses that are required for validating the transaction

getMinFeeTxUtxoPParams era → Tx era → UTxO era → Coin Source #

Minimum fee computation, excluding witnesses and including ref scripts size

newtype ScriptsProvided era Source #

The only reason it is a newtype instead of just a Map is becuase for later eras is expensive to compute the actual map, so we want to use the type safety guidance to avoid redundant work.

Constructors

ScriptsProvided 

Fields

Instances

Instances details
Generic (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Associated Types

type Rep (ScriptsProvided era) ∷ TypeType Source #

(Era era, Show (Script era)) ⇒ Show (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

(Era era, NFData (Script era)) ⇒ NFData (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

Methods

rnfScriptsProvided era → () Source #

(Era era, Eq (Script era)) ⇒ Eq (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

(Era era, Ord (Script era)) ⇒ Ord (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

type Rep (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.UTxO

type Rep (ScriptsProvided era) = D1 ('MetaData "ScriptsProvided" "Cardano.Ledger.UTxO" "cardano-ledger-core-1.12.0.0-inplace" 'True) (C1 ('MetaCons "ScriptsProvided" 'PrefixI 'True) (S1 ('MetaSel ('Just "unScriptsProvided") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (ScriptHash (EraCrypto era)) (Script era)))))

Functions

txinsEraTxBody era ⇒ TxBody era → Set (TxIn (EraCrypto era)) Source #

Compute the UTxO inputs of a transaction. txins has the same problems as txouts, see notes below.

txinLookupTxIn (EraCrypto era) → UTxO era → Maybe (TxOut era) Source #

Lookup a txin for a given UTxO collection

txInsFilter Source #

Arguments

UTxO era

Source UTxO

Set (TxIn (EraCrypto era))

Which of the TxIns you would like to keep.

UTxO era 

Filter out TxIn's from the UTxO map

txouts ∷ ∀ era. EraTxBody era ⇒ TxBody era → UTxO era Source #

Compute the transaction outputs of a transaction.

balanceEraTxOut era ⇒ UTxO era → Value era Source #

Determine the total balance contained in the UTxO.

coinBalanceEraTxOut era ⇒ UTxO era → Coin Source #

Determine the total Ada only balance contained in the UTxO. This is equivalent to `coin . balance`, but it will be more efficient

sumAllValue ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Value era Source #

Sum all the value in any Foldable with TxOuts

sumAllCoin ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Coin Source #

Sum all the Coins in any Foldable with with TxOuts. Care should be taken since it is susceptible to integer overflow, therefore make sure this function is not applied to unvalidated TxOuts

areAllAdaOnly ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Bool Source #

Check whether any of the supplied TxOuts contain any MultiAssets. Returns True if non of them do.

verifyWitVKey ∷ (Typeable kr, Crypto c, DSignable c (Hash c EraIndependentTxBody)) ⇒ Hash c EraIndependentTxBodyWitVKey kr c → Bool Source #

Verify a transaction body witness

getScriptHashAddr c → Maybe (ScriptHash c) Source #

Extract script hash from value address with script.