Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.TxBody
Contents
Description
Transaction bodies
Synopsis
- parseTxId ∷ Parser TxId
- data TxBody era where
- ByronTxBody ∷ Annotated Tx ByteString → TxBody ByronEra
- ShelleyTxBody ∷ ShelleyBasedEra era → TxBody (ShelleyLedgerEra era) → [Script (ShelleyLedgerEra era)] → TxBodyScriptData era → Maybe (AuxiliaryData (ShelleyLedgerEra era)) → TxScriptValidity era → TxBody era
- pattern TxBody ∷ TxBodyContent ViewTx era → TxBody era
- makeTransactionBody ∷ ∀ era. IsCardanoEra era ⇒ TxBodyContent BuildTx era → Either TxBodyError (TxBody era)
- data TxBodyContent build era = TxBodyContent {
- txIns ∷ TxIns build era
- txInsCollateral ∷ TxInsCollateral era
- txOuts ∷ [TxOut CtxTx era]
- txFee ∷ TxFee era
- txValidityRange ∷ (TxValidityLowerBound era, TxValidityUpperBound era)
- txMetadata ∷ TxMetadataInEra era
- txAuxScripts ∷ TxAuxScripts era
- txExtraKeyWits ∷ TxExtraKeyWitnesses era
- txProtocolParams ∷ BuildTxWith build (Maybe ProtocolParameters)
- txWithdrawals ∷ TxWithdrawals build era
- txCertificates ∷ TxCertificates build era
- txUpdateProposal ∷ TxUpdateProposal era
- txMintValue ∷ TxMintValue build era
- txScriptValidity ∷ TxScriptValidity era
- data TxBodyError
- data TxBodyScriptData era where
- TxBodyNoScriptData ∷ TxBodyScriptData era
- TxBodyScriptData ∷ ScriptDataSupportedInEra era → TxDats (ShelleyLedgerEra era) → Redeemers (ShelleyLedgerEra era) → TxBodyScriptData era
- data TxScriptValidity era where
- data TxScriptValiditySupportedInEra era where
- data ScriptValidity
- scriptValidityToIsValid ∷ ScriptValidity → IsValid
- isValidToScriptValidity ∷ IsValid → ScriptValidity
- scriptValidityToTxScriptValidity ∷ ShelleyBasedEra era → ScriptValidity → TxScriptValidity era
- txScriptValidityToIsValid ∷ TxScriptValidity era → IsValid
- txScriptValidityToScriptValidity ∷ TxScriptValidity era → ScriptValidity
- newtype TxId = TxId (Hash StandardCrypto EraIndependentTxBody)
- getTxId ∷ ∀ era. TxBody era → TxId
- getTxIdShelley ∷ Crypto (ShelleyLedgerEra era) ~ StandardCrypto ⇒ UsesTxBody (ShelleyLedgerEra era) ⇒ ShelleyBasedEra era → TxBody (ShelleyLedgerEra era) → TxId
- data TxIn = TxIn TxId TxIx
- newtype TxIx = TxIx Word
- genesisUTxOPseudoTxIn ∷ NetworkId → Hash GenesisUTxOKey → TxIn
- data CtxTx
- data CtxUTxO
- data TxOut ctx era = TxOut (AddressInEra era) (TxOutValue era) (TxOutDatum ctx era)
- data TxOutValue era where
- TxOutAdaOnly ∷ OnlyAdaSupportedInEra era → Lovelace → TxOutValue era
- TxOutValue ∷ MultiAssetSupportedInEra era → Value → TxOutValue era
- data TxOutDatum ctx era where
- TxOutDatumNone ∷ TxOutDatum ctx era
- TxOutDatumHash ∷ ScriptDataSupportedInEra era → Hash ScriptData → TxOutDatum ctx era
- pattern TxOutDatum ∷ ScriptDataSupportedInEra era → ScriptData → TxOutDatum CtxTx era
- toCtxUTxOTxOut ∷ TxOut CtxTx era → TxOut CtxUTxO era
- lovelaceToTxOutValue ∷ IsCardanoEra era ⇒ Lovelace → TxOutValue era
- prettyRenderTxOut ∷ TxOutInAnyEra → Text
- txOutValueToLovelace ∷ TxOutValue era → Lovelace
- txOutValueToValue ∷ TxOutValue era → Value
- parseHash ∷ SerialiseAsRawBytes (Hash a) ⇒ AsType (Hash a) → Parser (Hash a)
- data TxOutInAnyEra where
- TxOutInAnyEra ∷ CardanoEra era → TxOut CtxTx era → TxOutInAnyEra
- txOutInAnyEra ∷ IsCardanoEra era ⇒ TxOut CtxTx era → TxOutInAnyEra
- data TxInsCollateral era where
- TxInsCollateralNone ∷ TxInsCollateral era
- TxInsCollateral ∷ CollateralSupportedInEra era → [TxIn] → TxInsCollateral era
- data TxFee era where
- TxFeeImplicit ∷ TxFeesImplicitInEra era → TxFee era
- TxFeeExplicit ∷ TxFeesExplicitInEra era → Lovelace → TxFee era
- data TxValidityLowerBound era where
- data TxValidityUpperBound era where
- data TxMetadataInEra era where
- TxMetadataNone ∷ TxMetadataInEra era
- TxMetadataInEra ∷ TxMetadataSupportedInEra era → TxMetadata → TxMetadataInEra era
- data TxAuxScripts era where
- TxAuxScriptsNone ∷ TxAuxScripts era
- TxAuxScripts ∷ AuxScriptsSupportedInEra era → [ScriptInEra era] → TxAuxScripts era
- data TxExtraKeyWitnesses era where
- data TxWithdrawals build era where
- TxWithdrawalsNone ∷ TxWithdrawals build era
- TxWithdrawals ∷ WithdrawalsSupportedInEra era → [(StakeAddress, Lovelace, BuildTxWith build (Witness WitCtxStake era))] → TxWithdrawals build era
- data TxCertificates build era where
- TxCertificatesNone ∷ TxCertificates build era
- TxCertificates ∷ CertificatesSupportedInEra era → [Certificate] → BuildTxWith build (Map StakeCredential (Witness WitCtxStake era)) → TxCertificates build era
- data TxUpdateProposal era where
- data TxMintValue build era where
- TxMintNone ∷ TxMintValue build era
- TxMintValue ∷ MultiAssetSupportedInEra era → Value → BuildTxWith build (Map PolicyId (ScriptWitness WitCtxMint era)) → TxMintValue build era
- data BuildTxWith build a where
- ViewTx ∷ BuildTxWith ViewTx a
- BuildTxWith ∷ a → BuildTxWith BuildTx a
- data BuildTx
- data ViewTx
- data CollateralSupportedInEra era where
- data MultiAssetSupportedInEra era where
- data OnlyAdaSupportedInEra era where
- data TxFeesExplicitInEra era where
- data TxFeesImplicitInEra era where
- data ValidityUpperBoundSupportedInEra era where
- data ValidityNoUpperBoundSupportedInEra era where
- ValidityNoUpperBoundInByronEra ∷ ValidityNoUpperBoundSupportedInEra ByronEra
- ValidityNoUpperBoundInAllegraEra ∷ ValidityNoUpperBoundSupportedInEra AllegraEra
- ValidityNoUpperBoundInMaryEra ∷ ValidityNoUpperBoundSupportedInEra MaryEra
- ValidityNoUpperBoundInAlonzoEra ∷ ValidityNoUpperBoundSupportedInEra AlonzoEra
- data ValidityLowerBoundSupportedInEra era where
- data TxMetadataSupportedInEra era where
- data AuxScriptsSupportedInEra era where
- data TxExtraKeyWitnessesSupportedInEra era where
- data ScriptDataSupportedInEra era where
- data WithdrawalsSupportedInEra era where
- data CertificatesSupportedInEra era where
- data UpdateProposalSupportedInEra era where
- collateralSupportedInEra ∷ CardanoEra era → Maybe (CollateralSupportedInEra era)
- multiAssetSupportedInEra ∷ CardanoEra era → Either (OnlyAdaSupportedInEra era) (MultiAssetSupportedInEra era)
- txFeesExplicitInEra ∷ CardanoEra era → Either (TxFeesImplicitInEra era) (TxFeesExplicitInEra era)
- validityUpperBoundSupportedInEra ∷ CardanoEra era → Maybe (ValidityUpperBoundSupportedInEra era)
- validityNoUpperBoundSupportedInEra ∷ CardanoEra era → Maybe (ValidityNoUpperBoundSupportedInEra era)
- validityLowerBoundSupportedInEra ∷ CardanoEra era → Maybe (ValidityLowerBoundSupportedInEra era)
- txMetadataSupportedInEra ∷ CardanoEra era → Maybe (TxMetadataSupportedInEra era)
- auxScriptsSupportedInEra ∷ CardanoEra era → Maybe (AuxScriptsSupportedInEra era)
- extraKeyWitnessesSupportedInEra ∷ CardanoEra era → Maybe (TxExtraKeyWitnessesSupportedInEra era)
- scriptDataSupportedInEra ∷ CardanoEra era → Maybe (ScriptDataSupportedInEra era)
- withdrawalsSupportedInEra ∷ CardanoEra era → Maybe (WithdrawalsSupportedInEra era)
- certificatesSupportedInEra ∷ CardanoEra era → Maybe (CertificatesSupportedInEra era)
- updateProposalSupportedInEra ∷ CardanoEra era → Maybe (UpdateProposalSupportedInEra era)
- txScriptValiditySupportedInShelleyBasedEra ∷ ShelleyBasedEra era → Maybe (TxScriptValiditySupportedInEra era)
- txScriptValiditySupportedInCardanoEra ∷ CardanoEra era → Maybe (TxScriptValiditySupportedInEra era)
- data AnyScriptWitness era where
- AnyScriptWitness ∷ ScriptWitness witctx era → AnyScriptWitness era
- data ScriptWitnessIndex
- renderScriptWitnessIndex ∷ ScriptWitnessIndex → String
- collectTxBodyScriptWitnesses ∷ ∀ era. TxBodyContent BuildTx era → [(ScriptWitnessIndex, AnyScriptWitness era)]
- mapTxScriptWitnesses ∷ ∀ era. (∀ witctx. ScriptWitnessIndex → ScriptWitness witctx era → ScriptWitness witctx era) → TxBodyContent BuildTx era → TxBodyContent BuildTx era
- toShelleyTxId ∷ TxId → TxId StandardCrypto
- toShelleyTxIn ∷ TxIn → TxIn StandardCrypto
- toShelleyTxOut ∷ ∀ era ledgerera. ShelleyLedgerEra era ~ ledgerera ⇒ ShelleyBasedEra era → TxOut CtxUTxO era → TxOut ledgerera
- toShelleyTxOutAny ∷ ∀ ctx era ledgerera. ShelleyLedgerEra era ~ ledgerera ⇒ ShelleyBasedEra era → TxOut ctx era → TxOut ledgerera
- fromShelleyTxId ∷ TxId StandardCrypto → TxId
- fromShelleyTxIn ∷ TxIn StandardCrypto → TxIn
- fromShelleyTxOut ∷ ShelleyLedgerEra era ~ ledgerera ⇒ ShelleyBasedEra era → TxOut ledgerera → TxOut ctx era
- toAlonzoRdmrPtr ∷ ScriptWitnessIndex → RdmrPtr
- fromAlonzoRdmrPtr ∷ RdmrPtr → ScriptWitnessIndex
- fromByronTxIn ∷ TxIn → TxIn
- fromLedgerTxOuts ∷ ∀ era. ShelleyBasedEra era → TxBody (ShelleyLedgerEra era) → TxBodyScriptData era → [TxOut CtxTx era]
- renderTxIn ∷ TxIn → Text
- calculateExecutionUnitsLovelace ∷ ExecutionUnitPrices → ExecutionUnits → Maybe Lovelace
- data family AsType t
Documentation
Transaction bodies
data TxBody era where Source #
Constructors
ByronTxBody ∷ Annotated Tx ByteString → TxBody ByronEra | |
ShelleyTxBody | |
Fields
|
Bundled Patterns
pattern TxBody ∷ TxBodyContent ViewTx era → TxBody era |
Instances
Eq (TxBody era) Source # | |
Show (TxBody era) Source # | |
HasTypeProxy era ⇒ HasTypeProxy (TxBody era) Source # | |
IsCardanoEra era ⇒ SerialiseAsCBOR (TxBody era) Source # | |
Defined in Cardano.Api.TxBody Methods serialiseToCBOR ∷ TxBody era → ByteString Source # deserialiseFromCBOR ∷ AsType (TxBody era) → ByteString → Either DecoderError (TxBody era) Source # | |
IsCardanoEra era ⇒ HasTextEnvelope (TxBody era) Source # | |
Defined in Cardano.Api.TxBody Methods textEnvelopeType ∷ AsType (TxBody era) → TextEnvelopeType Source # textEnvelopeDefaultDescr ∷ TxBody era → TextEnvelopeDescr Source # | |
data AsType (TxBody era) Source # | |
Defined in Cardano.Api.TxBody |
makeTransactionBody ∷ ∀ era. IsCardanoEra era ⇒ TxBodyContent BuildTx era → Either TxBodyError (TxBody era) Source #
data TxBodyContent build era Source #
Constructors
TxBodyContent | |
Fields
|
Instances
Eq (TxBodyContent build era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxBodyContent build era → TxBodyContent build era → Bool Source # (/=) ∷ TxBodyContent build era → TxBodyContent build era → Bool Source # | |
Show (TxBodyContent build era) Source # | |
Defined in Cardano.Api.TxBody |
data TxBodyError Source #
Constructors
Instances
Eq TxBodyError Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxBodyError → TxBodyError → Bool Source # (/=) ∷ TxBodyError → TxBodyError → Bool Source # | |
Show TxBodyError Source # | |
Defined in Cardano.Api.TxBody | |
Error TxBodyError Source # | |
Defined in Cardano.Api.TxBody Methods |
data TxBodyScriptData era where Source #
Constructors
TxBodyNoScriptData ∷ TxBodyScriptData era | |
TxBodyScriptData ∷ ScriptDataSupportedInEra era → TxDats (ShelleyLedgerEra era) → Redeemers (ShelleyLedgerEra era) → TxBodyScriptData era |
Instances
Eq (TxBodyScriptData era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxBodyScriptData era → TxBodyScriptData era → Bool Source # (/=) ∷ TxBodyScriptData era → TxBodyScriptData era → Bool Source # | |
Show (TxBodyScriptData era) Source # | |
Defined in Cardano.Api.TxBody |
data TxScriptValidity era where Source #
A representation of whether the era supports tx script validity.
The Mary and subsequent eras support script validity.
Constructors
TxScriptValidityNone ∷ TxScriptValidity era | |
TxScriptValidity ∷ TxScriptValiditySupportedInEra era → ScriptValidity → TxScriptValidity era | Tx script validity is supported in transactions in the |
Instances
Eq (TxScriptValidity era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxScriptValidity era → TxScriptValidity era → Bool Source # (/=) ∷ TxScriptValidity era → TxScriptValidity era → Bool Source # | |
Show (TxScriptValidity era) Source # | |
Defined in Cardano.Api.TxBody |
data TxScriptValiditySupportedInEra era where Source #
Instances
Eq (TxScriptValiditySupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxScriptValiditySupportedInEra era → TxScriptValiditySupportedInEra era → Bool Source # (/=) ∷ TxScriptValiditySupportedInEra era → TxScriptValiditySupportedInEra era → Bool Source # | |
Show (TxScriptValiditySupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data ScriptValidity Source #
Indicates whether a script is expected to fail or pass validation.
Constructors
ScriptInvalid | Script is expected to fail validation. Transactions marked as such can include scripts that fail validation. Such transactions may be submitted to the chain, in which case the collateral will be taken upon on chain script validation failure. |
ScriptValid | Script is expected to pass validation. Transactions marked as such cannot include scripts that fail validation. |
Instances
Eq ScriptValidity Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ ScriptValidity → ScriptValidity → Bool Source # (/=) ∷ ScriptValidity → ScriptValidity → Bool Source # | |
Show ScriptValidity Source # | |
Defined in Cardano.Api.TxBody | |
FromCBOR ScriptValidity Source # | |
Defined in Cardano.Api.TxBody | |
ToCBOR ScriptValidity Source # | |
Defined in Cardano.Api.TxBody Methods toCBOR ∷ ScriptValidity → Encoding # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ScriptValidity → Size # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ScriptValidity] → Size # |
scriptValidityToIsValid ∷ ScriptValidity → IsValid Source #
isValidToScriptValidity ∷ IsValid → ScriptValidity Source #
scriptValidityToTxScriptValidity ∷ ShelleyBasedEra era → ScriptValidity → TxScriptValidity era Source #
txScriptValidityToIsValid ∷ TxScriptValidity era → IsValid Source #
Transaction Ids
Constructors
TxId (Hash StandardCrypto EraIndependentTxBody) |
Instances
Eq TxId Source # | |
Ord TxId Source # | |
Show TxId Source # | |
IsString TxId Source # | |
Defined in Cardano.Api.TxBody Methods fromString ∷ String → TxId Source # | |
FromJSON TxId Source # | |
Defined in Cardano.Api.TxBody | |
ToJSON TxId Source # | |
Defined in Cardano.Api.TxBody Methods toEncoding ∷ TxId → Encoding # toJSONList ∷ [TxId] → Value # toEncodingList ∷ [TxId] → Encoding # | |
FromJSONKey TxId Source # | |
Defined in Cardano.Api.TxBody | |
ToJSONKey TxId Source # | |
Defined in Cardano.Api.TxBody | |
HasTypeProxy TxId Source # | |
SerialiseAsRawBytes TxId Source # | |
Defined in Cardano.Api.TxBody Methods serialiseToRawBytes ∷ TxId → ByteString Source # deserialiseFromRawBytes ∷ AsType TxId → ByteString → Maybe TxId Source # | |
data AsType TxId Source # | |
Defined in Cardano.Api.TxBody |
getTxIdShelley ∷ Crypto (ShelleyLedgerEra era) ~ StandardCrypto ⇒ UsesTxBody (ShelleyLedgerEra era) ⇒ ShelleyBasedEra era → TxBody (ShelleyLedgerEra era) → TxId Source #
Transaction inputs
Instances
Eq TxIn Source # | |
Ord TxIn Source # | |
Show TxIn Source # | |
FromJSON TxIn Source # | |
Defined in Cardano.Api.TxBody | |
ToJSON TxIn Source # | |
Defined in Cardano.Api.TxBody Methods toEncoding ∷ TxIn → Encoding # toJSONList ∷ [TxIn] → Value # toEncodingList ∷ [TxIn] → Encoding # | |
FromJSONKey TxIn Source # | |
Defined in Cardano.Api.TxBody | |
ToJSONKey TxIn Source # | |
Defined in Cardano.Api.TxBody |
Instances
Enum TxIx Source # | |
Defined in Cardano.Api.TxBody | |
Eq TxIx Source # | |
Ord TxIx Source # | |
Show TxIx Source # | |
FromJSON TxIx Source # | |
Defined in Cardano.Api.TxBody | |
ToJSON TxIx Source # | |
Defined in Cardano.Api.TxBody Methods toEncoding ∷ TxIx → Encoding # toJSONList ∷ [TxIx] → Value # toEncodingList ∷ [TxIx] → Encoding # |
genesisUTxOPseudoTxIn ∷ NetworkId → Hash GenesisUTxOKey → TxIn Source #
Compute the TxIn
of the initial UTxO pseudo-transaction corresponding
to the given address in the genesis initial funds.
The Shelley initial UTxO is constructed from the sgInitialFunds
which
is not a full UTxO but just a map from addresses to coin values.
This gets turned into a UTxO by making a pseudo-transaction for each address,
with the 0th output being the coin value. So to spend from the initial UTxO
we need this same TxIn
to use as an input to the spending transaction.
Transaction outputs
The context is a transaction body
Instances
(IsShelleyBasedEra era, IsCardanoEra era) ⇒ FromJSON (TxOut CtxTx era) Source # | |
Defined in Cardano.Api.TxBody |
The context is the UTxO
Instances
(IsShelleyBasedEra era, IsCardanoEra era) ⇒ FromJSON (TxOut CtxUTxO era) Source # | |
Defined in Cardano.Api.TxBody |
Constructors
TxOut (AddressInEra era) (TxOutValue era) (TxOutDatum ctx era) |
Instances
Eq (TxOut ctx era) Source # | |
Show (TxOut ctx era) Source # | |
(IsShelleyBasedEra era, IsCardanoEra era) ⇒ FromJSON (TxOut CtxUTxO era) Source # | |
Defined in Cardano.Api.TxBody | |
(IsShelleyBasedEra era, IsCardanoEra era) ⇒ FromJSON (TxOut CtxTx era) Source # | |
Defined in Cardano.Api.TxBody | |
IsCardanoEra era ⇒ ToJSON (TxOut ctx era) Source # | |
Defined in Cardano.Api.TxBody Methods toJSON ∷ TxOut ctx era → Value # toEncoding ∷ TxOut ctx era → Encoding # toJSONList ∷ [TxOut ctx era] → Value # toEncodingList ∷ [TxOut ctx era] → Encoding # |
data TxOutValue era where Source #
Constructors
TxOutAdaOnly ∷ OnlyAdaSupportedInEra era → Lovelace → TxOutValue era | |
TxOutValue ∷ MultiAssetSupportedInEra era → Value → TxOutValue era |
Instances
data TxOutDatum ctx era where Source #
Constructors
TxOutDatumNone ∷ TxOutDatum ctx era | |
TxOutDatumHash ∷ ScriptDataSupportedInEra era → Hash ScriptData → TxOutDatum ctx era | A transaction output that only specifies the hash of the datum, but not the full datum value. |
Bundled Patterns
pattern TxOutDatum ∷ ScriptDataSupportedInEra era → ScriptData → TxOutDatum CtxTx era |
Instances
Eq (TxOutDatum ctx era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxOutDatum ctx era → TxOutDatum ctx era → Bool Source # (/=) ∷ TxOutDatum ctx era → TxOutDatum ctx era → Bool Source # | |
Show (TxOutDatum ctx era) Source # | |
Defined in Cardano.Api.TxBody |
lovelaceToTxOutValue ∷ IsCardanoEra era ⇒ Lovelace → TxOutValue era Source #
txOutValueToLovelace ∷ TxOutValue era → Lovelace Source #
txOutValueToValue ∷ TxOutValue era → Value Source #
data TxOutInAnyEra where Source #
Constructors
TxOutInAnyEra ∷ CardanoEra era → TxOut CtxTx era → TxOutInAnyEra |
Instances
Eq TxOutInAnyEra Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxOutInAnyEra → TxOutInAnyEra → Bool Source # (/=) ∷ TxOutInAnyEra → TxOutInAnyEra → Bool Source # | |
Show TxOutInAnyEra Source # | |
Defined in Cardano.Api.TxBody |
txOutInAnyEra ∷ IsCardanoEra era ⇒ TxOut CtxTx era → TxOutInAnyEra Source #
Convenience constructor for TxOutInAnyEra
Other transaction body types
data TxInsCollateral era where Source #
Constructors
TxInsCollateralNone ∷ TxInsCollateral era | |
TxInsCollateral ∷ CollateralSupportedInEra era → [TxIn] → TxInsCollateral era |
Instances
Eq (TxInsCollateral era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxInsCollateral era → TxInsCollateral era → Bool Source # (/=) ∷ TxInsCollateral era → TxInsCollateral era → Bool Source # | |
Show (TxInsCollateral era) Source # | |
Defined in Cardano.Api.TxBody |
Constructors
TxFeeImplicit ∷ TxFeesImplicitInEra era → TxFee era | |
TxFeeExplicit ∷ TxFeesExplicitInEra era → Lovelace → TxFee era |
data TxValidityLowerBound era where Source #
Constructors
TxValidityNoLowerBound ∷ TxValidityLowerBound era | |
TxValidityLowerBound ∷ ValidityLowerBoundSupportedInEra era → SlotNo → TxValidityLowerBound era |
Instances
Eq (TxValidityLowerBound era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxValidityLowerBound era → TxValidityLowerBound era → Bool Source # (/=) ∷ TxValidityLowerBound era → TxValidityLowerBound era → Bool Source # | |
Show (TxValidityLowerBound era) Source # | |
Defined in Cardano.Api.TxBody |
data TxValidityUpperBound era where Source #
This was formerly known as the TTL.
Constructors
TxValidityNoUpperBound ∷ ValidityNoUpperBoundSupportedInEra era → TxValidityUpperBound era | |
TxValidityUpperBound ∷ ValidityUpperBoundSupportedInEra era → SlotNo → TxValidityUpperBound era |
Instances
Eq (TxValidityUpperBound era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxValidityUpperBound era → TxValidityUpperBound era → Bool Source # (/=) ∷ TxValidityUpperBound era → TxValidityUpperBound era → Bool Source # | |
Show (TxValidityUpperBound era) Source # | |
Defined in Cardano.Api.TxBody |
data TxMetadataInEra era where Source #
Constructors
TxMetadataNone ∷ TxMetadataInEra era | |
TxMetadataInEra ∷ TxMetadataSupportedInEra era → TxMetadata → TxMetadataInEra era |
Instances
Eq (TxMetadataInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxMetadataInEra era → TxMetadataInEra era → Bool Source # (/=) ∷ TxMetadataInEra era → TxMetadataInEra era → Bool Source # | |
Show (TxMetadataInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data TxAuxScripts era where Source #
Constructors
TxAuxScriptsNone ∷ TxAuxScripts era | |
TxAuxScripts ∷ AuxScriptsSupportedInEra era → [ScriptInEra era] → TxAuxScripts era |
Instances
Eq (TxAuxScripts era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxAuxScripts era → TxAuxScripts era → Bool Source # (/=) ∷ TxAuxScripts era → TxAuxScripts era → Bool Source # | |
Show (TxAuxScripts era) Source # | |
Defined in Cardano.Api.TxBody |
data TxExtraKeyWitnesses era where Source #
Constructors
TxExtraKeyWitnessesNone ∷ TxExtraKeyWitnesses era | |
TxExtraKeyWitnesses ∷ TxExtraKeyWitnessesSupportedInEra era → [Hash PaymentKey] → TxExtraKeyWitnesses era |
Instances
Eq (TxExtraKeyWitnesses era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxExtraKeyWitnesses era → TxExtraKeyWitnesses era → Bool Source # (/=) ∷ TxExtraKeyWitnesses era → TxExtraKeyWitnesses era → Bool Source # | |
Show (TxExtraKeyWitnesses era) Source # | |
Defined in Cardano.Api.TxBody |
data TxWithdrawals build era where Source #
Constructors
TxWithdrawalsNone ∷ TxWithdrawals build era | |
TxWithdrawals ∷ WithdrawalsSupportedInEra era → [(StakeAddress, Lovelace, BuildTxWith build (Witness WitCtxStake era))] → TxWithdrawals build era |
Instances
Eq (TxWithdrawals build era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxWithdrawals build era → TxWithdrawals build era → Bool Source # (/=) ∷ TxWithdrawals build era → TxWithdrawals build era → Bool Source # | |
Show (TxWithdrawals build era) Source # | |
Defined in Cardano.Api.TxBody |
data TxCertificates build era where Source #
Constructors
TxCertificatesNone ∷ TxCertificates build era | |
TxCertificates ∷ CertificatesSupportedInEra era → [Certificate] → BuildTxWith build (Map StakeCredential (Witness WitCtxStake era)) → TxCertificates build era |
Instances
Eq (TxCertificates build era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxCertificates build era → TxCertificates build era → Bool Source # (/=) ∷ TxCertificates build era → TxCertificates build era → Bool Source # | |
Show (TxCertificates build era) Source # | |
Defined in Cardano.Api.TxBody |
data TxUpdateProposal era where Source #
Constructors
TxUpdateProposalNone ∷ TxUpdateProposal era | |
TxUpdateProposal ∷ UpdateProposalSupportedInEra era → UpdateProposal → TxUpdateProposal era |
Instances
Eq (TxUpdateProposal era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxUpdateProposal era → TxUpdateProposal era → Bool Source # (/=) ∷ TxUpdateProposal era → TxUpdateProposal era → Bool Source # | |
Show (TxUpdateProposal era) Source # | |
Defined in Cardano.Api.TxBody |
data TxMintValue build era where Source #
Constructors
TxMintNone ∷ TxMintValue build era | |
TxMintValue ∷ MultiAssetSupportedInEra era → Value → BuildTxWith build (Map PolicyId (ScriptWitness WitCtxMint era)) → TxMintValue build era |
Instances
Eq (TxMintValue build era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxMintValue build era → TxMintValue build era → Bool Source # (/=) ∷ TxMintValue build era → TxMintValue build era → Bool Source # | |
Show (TxMintValue build era) Source # | |
Defined in Cardano.Api.TxBody |
Building vs viewing transactions
data BuildTxWith build a where Source #
Constructors
ViewTx ∷ BuildTxWith ViewTx a | |
BuildTxWith ∷ a → BuildTxWith BuildTx a |
Instances
Eq a ⇒ Eq (BuildTxWith build a) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ BuildTxWith build a → BuildTxWith build a → Bool Source # (/=) ∷ BuildTxWith build a → BuildTxWith build a → Bool Source # | |
Show a ⇒ Show (BuildTxWith build a) Source # | |
Defined in Cardano.Api.TxBody |
Era-dependent transaction body features
data CollateralSupportedInEra era where Source #
A representation of whether the era supports transactions with inputs used only for collateral for script fees.
The Alonzo and subsequent eras support collateral inputs.
Constructors
CollateralInAlonzoEra ∷ CollateralSupportedInEra AlonzoEra |
Instances
Eq (CollateralSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ CollateralSupportedInEra era → CollateralSupportedInEra era → Bool Source # (/=) ∷ CollateralSupportedInEra era → CollateralSupportedInEra era → Bool Source # | |
Show (CollateralSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data MultiAssetSupportedInEra era where Source #
A representation of whether the era supports multi-asset transactions.
The Mary and subsequent eras support multi-asset transactions.
The negation of this is OnlyAdaSupportedInEra
.
Constructors
MultiAssetInMaryEra ∷ MultiAssetSupportedInEra MaryEra | Multi-asset transactions are supported in the |
MultiAssetInAlonzoEra ∷ MultiAssetSupportedInEra AlonzoEra | Multi-asset transactions are supported in the |
Instances
Eq (MultiAssetSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ MultiAssetSupportedInEra era → MultiAssetSupportedInEra era → Bool Source # (/=) ∷ MultiAssetSupportedInEra era → MultiAssetSupportedInEra era → Bool Source # | |
Show (MultiAssetSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody | |
ToJSON (MultiAssetSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods toJSON ∷ MultiAssetSupportedInEra era → Value # toEncoding ∷ MultiAssetSupportedInEra era → Encoding # toJSONList ∷ [MultiAssetSupportedInEra era] → Value # toEncodingList ∷ [MultiAssetSupportedInEra era] → Encoding # |
data OnlyAdaSupportedInEra era where Source #
A representation of whether the era supports only ada transactions.
Prior to the Mary era only ada transactions are supported. Multi-assets are supported from the Mary era onwards.
This is the negation of MultiAssetSupportedInEra
. It exists since we need
evidence to be positive.
Constructors
AdaOnlyInByronEra ∷ OnlyAdaSupportedInEra ByronEra | |
AdaOnlyInShelleyEra ∷ OnlyAdaSupportedInEra ShelleyEra | |
AdaOnlyInAllegraEra ∷ OnlyAdaSupportedInEra AllegraEra |
Instances
Eq (OnlyAdaSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ OnlyAdaSupportedInEra era → OnlyAdaSupportedInEra era → Bool Source # (/=) ∷ OnlyAdaSupportedInEra era → OnlyAdaSupportedInEra era → Bool Source # | |
Show (OnlyAdaSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data TxFeesExplicitInEra era where Source #
A representation of whether the era requires explicitly specified fees in transactions.
The Byron era tx fees are implicit (as the difference bettween the sum of outputs and sum of inputs), but all later eras the fees are specified in the transaction explicitly.
Constructors
Instances
Eq (TxFeesExplicitInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxFeesExplicitInEra era → TxFeesExplicitInEra era → Bool Source # (/=) ∷ TxFeesExplicitInEra era → TxFeesExplicitInEra era → Bool Source # | |
Show (TxFeesExplicitInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data TxFeesImplicitInEra era where Source #
A representation of whether the era requires implicitly specified fees in transactions.
This is the negation of TxFeesExplicitInEra
.
Constructors
TxFeesImplicitInByronEra ∷ TxFeesImplicitInEra ByronEra |
Instances
Eq (TxFeesImplicitInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxFeesImplicitInEra era → TxFeesImplicitInEra era → Bool Source # (/=) ∷ TxFeesImplicitInEra era → TxFeesImplicitInEra era → Bool Source # | |
Show (TxFeesImplicitInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data ValidityUpperBoundSupportedInEra era where Source #
A representation of whether the era supports transactions with an upper bound on the range of slots in which they are valid.
The Shelley and subsequent eras support an upper bound on the validity range. In the Shelley era specifically it is actually required. It is optional in later eras.
Constructors
Instances
Eq (ValidityUpperBoundSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ ValidityUpperBoundSupportedInEra era → ValidityUpperBoundSupportedInEra era → Bool Source # (/=) ∷ ValidityUpperBoundSupportedInEra era → ValidityUpperBoundSupportedInEra era → Bool Source # | |
Show (ValidityUpperBoundSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data ValidityNoUpperBoundSupportedInEra era where Source #
A representation of whether the era supports transactions having no upper bound on the range of slots in which they are valid.
Note that the ShelleyEra
does not support omitting a validity upper
bound. It was introduced as a required field in Shelley and then made
optional in Allegra and subsequent eras.
The Byron era supports this by virtue of the fact that it does not support validity ranges at all.
Constructors
Instances
Eq (ValidityNoUpperBoundSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ ValidityNoUpperBoundSupportedInEra era → ValidityNoUpperBoundSupportedInEra era → Bool Source # (/=) ∷ ValidityNoUpperBoundSupportedInEra era → ValidityNoUpperBoundSupportedInEra era → Bool Source # | |
Show (ValidityNoUpperBoundSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data ValidityLowerBoundSupportedInEra era where Source #
A representation of whether the era supports transactions with a lower bound on the range of slots in which they are valid.
The Allegra and subsequent eras support an optional lower bound on the
validity range. No equivalent of ValidityNoUpperBoundSupportedInEra
is
needed since all eras support having no lower bound.
Constructors
Instances
Eq (ValidityLowerBoundSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ ValidityLowerBoundSupportedInEra era → ValidityLowerBoundSupportedInEra era → Bool Source # (/=) ∷ ValidityLowerBoundSupportedInEra era → ValidityLowerBoundSupportedInEra era → Bool Source # | |
Show (ValidityLowerBoundSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data TxMetadataSupportedInEra era where Source #
A representation of whether the era supports transaction metadata.
Transaction metadata is supported from the Shelley era onwards.
Constructors
Instances
Eq (TxMetadataSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxMetadataSupportedInEra era → TxMetadataSupportedInEra era → Bool Source # (/=) ∷ TxMetadataSupportedInEra era → TxMetadataSupportedInEra era → Bool Source # | |
Show (TxMetadataSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data AuxScriptsSupportedInEra era where Source #
A representation of whether the era supports auxiliary scripts in transactions.
Auxiliary scripts are supported from the Allegra era onwards.
Constructors
AuxScriptsInAllegraEra ∷ AuxScriptsSupportedInEra AllegraEra | |
AuxScriptsInMaryEra ∷ AuxScriptsSupportedInEra MaryEra | |
AuxScriptsInAlonzoEra ∷ AuxScriptsSupportedInEra AlonzoEra |
Instances
Eq (AuxScriptsSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ AuxScriptsSupportedInEra era → AuxScriptsSupportedInEra era → Bool Source # (/=) ∷ AuxScriptsSupportedInEra era → AuxScriptsSupportedInEra era → Bool Source # | |
Show (AuxScriptsSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data TxExtraKeyWitnessesSupportedInEra era where Source #
A representation of whether the era supports transactions that specify in the body that they need extra key witnesses, and where this fact is visible to scripts.
Extra key witnesses visible to scripts are supported from the Alonzo era onwards.
Instances
Eq (TxExtraKeyWitnessesSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ TxExtraKeyWitnessesSupportedInEra era → TxExtraKeyWitnessesSupportedInEra era → Bool Source # (/=) ∷ TxExtraKeyWitnessesSupportedInEra era → TxExtraKeyWitnessesSupportedInEra era → Bool Source # | |
Show (TxExtraKeyWitnessesSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data ScriptDataSupportedInEra era where Source #
A representation of whether the era supports multi-asset transactions.
The Mary and subsequent eras support multi-asset transactions.
The negation of this is OnlyAdaSupportedInEra
.
Constructors
ScriptDataInAlonzoEra ∷ ScriptDataSupportedInEra AlonzoEra | Script data is supported in transactions in the |
Instances
Eq (ScriptDataSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ ScriptDataSupportedInEra era → ScriptDataSupportedInEra era → Bool Source # (/=) ∷ ScriptDataSupportedInEra era → ScriptDataSupportedInEra era → Bool Source # | |
Show (ScriptDataSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data WithdrawalsSupportedInEra era where Source #
A representation of whether the era supports withdrawals from reward accounts.
The Shelley and subsequent eras support stake addresses, their associated reward accounts and support for withdrawals from them.
Constructors
Instances
Eq (WithdrawalsSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ WithdrawalsSupportedInEra era → WithdrawalsSupportedInEra era → Bool Source # (/=) ∷ WithdrawalsSupportedInEra era → WithdrawalsSupportedInEra era → Bool Source # | |
Show (WithdrawalsSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data CertificatesSupportedInEra era where Source #
A representation of whether the era supports Certificate
s embedded in
transactions.
The Shelley and subsequent eras support such certificates.
Constructors
Instances
Eq (CertificatesSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ CertificatesSupportedInEra era → CertificatesSupportedInEra era → Bool Source # (/=) ∷ CertificatesSupportedInEra era → CertificatesSupportedInEra era → Bool Source # | |
Show (CertificatesSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
data UpdateProposalSupportedInEra era where Source #
A representation of whether the era supports UpdateProposal
s embedded in
transactions.
The Shelley and subsequent eras support such update proposals. They Byron era has a notion of an update proposal, but it is a standalone chain object and not embedded in a transaction.
Constructors
Instances
Eq (UpdateProposalSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ UpdateProposalSupportedInEra era → UpdateProposalSupportedInEra era → Bool Source # (/=) ∷ UpdateProposalSupportedInEra era → UpdateProposalSupportedInEra era → Bool Source # | |
Show (UpdateProposalSupportedInEra era) Source # | |
Defined in Cardano.Api.TxBody |
Feature availability functions
collateralSupportedInEra ∷ CardanoEra era → Maybe (CollateralSupportedInEra era) Source #
multiAssetSupportedInEra ∷ CardanoEra era → Either (OnlyAdaSupportedInEra era) (MultiAssetSupportedInEra era) Source #
txFeesExplicitInEra ∷ CardanoEra era → Either (TxFeesImplicitInEra era) (TxFeesExplicitInEra era) Source #
validityUpperBoundSupportedInEra ∷ CardanoEra era → Maybe (ValidityUpperBoundSupportedInEra era) Source #
validityNoUpperBoundSupportedInEra ∷ CardanoEra era → Maybe (ValidityNoUpperBoundSupportedInEra era) Source #
validityLowerBoundSupportedInEra ∷ CardanoEra era → Maybe (ValidityLowerBoundSupportedInEra era) Source #
txMetadataSupportedInEra ∷ CardanoEra era → Maybe (TxMetadataSupportedInEra era) Source #
auxScriptsSupportedInEra ∷ CardanoEra era → Maybe (AuxScriptsSupportedInEra era) Source #
extraKeyWitnessesSupportedInEra ∷ CardanoEra era → Maybe (TxExtraKeyWitnessesSupportedInEra era) Source #
scriptDataSupportedInEra ∷ CardanoEra era → Maybe (ScriptDataSupportedInEra era) Source #
withdrawalsSupportedInEra ∷ CardanoEra era → Maybe (WithdrawalsSupportedInEra era) Source #
certificatesSupportedInEra ∷ CardanoEra era → Maybe (CertificatesSupportedInEra era) Source #
txScriptValiditySupportedInShelleyBasedEra ∷ ShelleyBasedEra era → Maybe (TxScriptValiditySupportedInEra era) Source #
txScriptValiditySupportedInCardanoEra ∷ CardanoEra era → Maybe (TxScriptValiditySupportedInEra era) Source #
Inspecting ScriptWitness
es
data AnyScriptWitness era where Source #
A ScriptWitness
in any WitCtx
. This lets us handle heterogeneous
collections of script witnesses from multiple contexts.
Constructors
AnyScriptWitness ∷ ScriptWitness witctx era → AnyScriptWitness era |
data ScriptWitnessIndex Source #
Identify the location of a ScriptWitness
within the context of a
TxBody
. These are indexes of the objects within the transaction that
need or can use script witnesses: inputs, minted assets, withdrawals and
certificates. These are simple numeric indices, enumerated from zero.
Thus the indices are not stable if the transaction body is modified.
Constructors
ScriptWitnessIndexTxIn !Word | The n'th transaction input, in the order of the |
ScriptWitnessIndexMint !Word | |
ScriptWitnessIndexCertificate !Word | The n'th certificate, in the list order of the certificates. |
ScriptWitnessIndexWithdrawal !Word | The n'th withdrawal, in the order of the |
Instances
Eq ScriptWitnessIndex Source # | |
Defined in Cardano.Api.TxBody Methods (==) ∷ ScriptWitnessIndex → ScriptWitnessIndex → Bool Source # (/=) ∷ ScriptWitnessIndex → ScriptWitnessIndex → Bool Source # | |
Ord ScriptWitnessIndex Source # | |
Defined in Cardano.Api.TxBody Methods compare ∷ ScriptWitnessIndex → ScriptWitnessIndex → Ordering Source # (<) ∷ ScriptWitnessIndex → ScriptWitnessIndex → Bool Source # (<=) ∷ ScriptWitnessIndex → ScriptWitnessIndex → Bool Source # (>) ∷ ScriptWitnessIndex → ScriptWitnessIndex → Bool Source # (>=) ∷ ScriptWitnessIndex → ScriptWitnessIndex → Bool Source # max ∷ ScriptWitnessIndex → ScriptWitnessIndex → ScriptWitnessIndex Source # min ∷ ScriptWitnessIndex → ScriptWitnessIndex → ScriptWitnessIndex Source # | |
Show ScriptWitnessIndex Source # | |
Defined in Cardano.Api.TxBody |
collectTxBodyScriptWitnesses ∷ ∀ era. TxBodyContent BuildTx era → [(ScriptWitnessIndex, AnyScriptWitness era)] Source #
mapTxScriptWitnesses ∷ ∀ era. (∀ witctx. ScriptWitnessIndex → ScriptWitness witctx era → ScriptWitness witctx era) → TxBodyContent BuildTx era → TxBodyContent BuildTx era Source #
Internal conversion functions & types
toShelleyTxId ∷ TxId → TxId StandardCrypto Source #
toShelleyTxIn ∷ TxIn → TxIn StandardCrypto Source #
This function may overflow on the transaction index. Call sites must ensure that all uses of this function are appropriately guarded.
toShelleyTxOut ∷ ∀ era ledgerera. ShelleyLedgerEra era ~ ledgerera ⇒ ShelleyBasedEra era → TxOut CtxUTxO era → TxOut ledgerera Source #
toShelleyTxOutAny ∷ ∀ ctx era ledgerera. ShelleyLedgerEra era ~ ledgerera ⇒ ShelleyBasedEra era → TxOut ctx era → TxOut ledgerera Source #
A variant of 'toShelleyTxOutAny that is used only internally to this module
that works with a TxOut
in any context (including CtxTx) by ignoring
embedded datums (taking only their hash).
fromShelleyTxId ∷ TxId StandardCrypto → TxId Source #
fromShelleyTxIn ∷ TxIn StandardCrypto → TxIn Source #
fromShelleyTxOut ∷ ShelleyLedgerEra era ~ ledgerera ⇒ ShelleyBasedEra era → TxOut ledgerera → TxOut ctx era Source #
toAlonzoRdmrPtr ∷ ScriptWitnessIndex → RdmrPtr Source #
fromAlonzoRdmrPtr ∷ RdmrPtr → ScriptWitnessIndex Source #
fromByronTxIn ∷ TxIn → TxIn Source #
fromLedgerTxOuts ∷ ∀ era. ShelleyBasedEra era → TxBody (ShelleyLedgerEra era) → TxBodyScriptData era → [TxOut CtxTx era] Source #
renderTxIn ∷ TxIn → Text Source #
Misc helpers
Data family instances
A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.
Values of this type are passed to deserialisation functions for example.