Safe Haskell | None |
---|---|
Language | Haskell2010 |
Transaction bodies
Synopsis
- parseTxId :: Parser TxId
- data TxBody era where
- ShelleyTxBody :: forall era. ShelleyBasedEra era -> TxBody (ShelleyLedgerEra era) -> [Script (ShelleyLedgerEra era)] -> TxBodyScriptData era -> Maybe (TxAuxData (ShelleyLedgerEra era)) -> TxScriptValidity era -> TxBody era
- pattern TxBody :: TxBodyContent ViewTx era -> TxBody era
- createTransactionBody :: ShelleyBasedEra era -> TxBodyContent BuildTx era -> Either TxBodyError (TxBody era)
- createAndValidateTransactionBody :: ShelleyBasedEra era -> TxBodyContent BuildTx era -> Either TxBodyError (TxBody era)
- data TxBodyContent build era = TxBodyContent {
- txIns :: TxIns build era
- txInsCollateral :: TxInsCollateral era
- txInsReference :: TxInsReference era
- txOuts :: [TxOut CtxTx era]
- txTotalCollateral :: TxTotalCollateral era
- txReturnCollateral :: TxReturnCollateral CtxTx era
- txFee :: TxFee era
- txValidityLowerBound :: TxValidityLowerBound era
- txValidityUpperBound :: TxValidityUpperBound era
- txMetadata :: TxMetadataInEra era
- txAuxScripts :: TxAuxScripts era
- txExtraKeyWits :: TxExtraKeyWitnesses era
- txProtocolParams :: BuildTxWith build (Maybe (LedgerProtocolParameters era))
- txWithdrawals :: TxWithdrawals build era
- txCertificates :: TxCertificates build era
- txUpdateProposal :: TxUpdateProposal era
- txMintValue :: TxMintValue build era
- txScriptValidity :: TxScriptValidity era
- txProposalProcedures :: Maybe (Featured ConwayEraOnwards era (TxProposalProcedures build era))
- txVotingProcedures :: Maybe (Featured ConwayEraOnwards era (TxVotingProcedures build era))
- txCurrentTreasuryValue :: Maybe (Featured ConwayEraOnwards era (Maybe Coin))
- txTreasuryDonation :: Maybe (Featured ConwayEraOnwards era Coin)
- makeByronTransactionBody :: TxIns BuildTx ByronEra -> [TxOut CtxTx ByronEra] -> Either TxBodyError (Annotated Tx ByteString)
- defaultTxBodyContent :: ShelleyBasedEra era -> TxBodyContent BuildTx era
- defaultTxFee :: ShelleyBasedEra era -> TxFee era
- defaultTxValidityUpperBound :: ShelleyBasedEra era -> TxValidityUpperBound era
- setTxIns :: TxIns build era -> TxBodyContent build era -> TxBodyContent build era
- modTxIns :: (TxIns build era -> TxIns build era) -> TxBodyContent build era -> TxBodyContent build era
- addTxIn :: (TxIn, BuildTxWith build (Witness WitCtxTxIn era)) -> TxBodyContent build era -> TxBodyContent build era
- setTxInsCollateral :: TxInsCollateral era -> TxBodyContent build era -> TxBodyContent build era
- setTxInsReference :: TxInsReference era -> TxBodyContent build era -> TxBodyContent build era
- setTxOuts :: [TxOut CtxTx era] -> TxBodyContent build era -> TxBodyContent build era
- modTxOuts :: ([TxOut CtxTx era] -> [TxOut CtxTx era]) -> TxBodyContent build era -> TxBodyContent build era
- addTxOut :: TxOut CtxTx era -> TxBodyContent build era -> TxBodyContent build era
- setTxTotalCollateral :: TxTotalCollateral era -> TxBodyContent build era -> TxBodyContent build era
- setTxReturnCollateral :: TxReturnCollateral CtxTx era -> TxBodyContent build era -> TxBodyContent build era
- setTxFee :: TxFee era -> TxBodyContent build era -> TxBodyContent build era
- setTxValidityLowerBound :: TxValidityLowerBound era -> TxBodyContent build era -> TxBodyContent build era
- setTxValidityUpperBound :: TxValidityUpperBound era -> TxBodyContent build era -> TxBodyContent build era
- setTxMetadata :: TxMetadataInEra era -> TxBodyContent build era -> TxBodyContent build era
- setTxAuxScripts :: TxAuxScripts era -> TxBodyContent build era -> TxBodyContent build era
- setTxExtraKeyWits :: TxExtraKeyWitnesses era -> TxBodyContent build era -> TxBodyContent build era
- setTxProtocolParams :: BuildTxWith build (Maybe (LedgerProtocolParameters era)) -> TxBodyContent build era -> TxBodyContent build era
- setTxWithdrawals :: TxWithdrawals build era -> TxBodyContent build era -> TxBodyContent build era
- setTxCertificates :: TxCertificates build era -> TxBodyContent build era -> TxBodyContent build era
- setTxUpdateProposal :: TxUpdateProposal era -> TxBodyContent build era -> TxBodyContent build era
- setTxProposalProcedures :: Maybe (Featured ConwayEraOnwards era (TxProposalProcedures build era)) -> TxBodyContent build era -> TxBodyContent build era
- setTxVotingProcedures :: Maybe (Featured ConwayEraOnwards era (TxVotingProcedures build era)) -> TxBodyContent build era -> TxBodyContent build era
- setTxMintValue :: TxMintValue build era -> TxBodyContent build era -> TxBodyContent build era
- setTxScriptValidity :: TxScriptValidity era -> TxBodyContent build era -> TxBodyContent build era
- setTxCurrentTreasuryValue :: Maybe (Featured ConwayEraOnwards era (Maybe Coin)) -> TxBodyContent build era -> TxBodyContent build era
- setTxTreasuryDonation :: Maybe (Featured ConwayEraOnwards era Coin) -> TxBodyContent build era -> TxBodyContent build era
- data TxBodyError
- = TxBodyEmptyTxIns
- | TxBodyEmptyTxInsCollateral
- | TxBodyEmptyTxOuts
- | TxBodyOutputNegative !Quantity !TxOutInAnyEra
- | TxBodyOutputOverflow !Quantity !TxOutInAnyEra
- | TxBodyMetadataError ![(Word64, TxMetadataRangeError)]
- | TxBodyInIxOverflow !TxIn
- | TxBodyMissingProtocolParams
- | TxBodyProtocolParamsConversionError !ProtocolParametersConversionError
- data TxBodyScriptData era where
- TxBodyNoScriptData :: forall era. TxBodyScriptData era
- TxBodyScriptData :: forall era. AlonzoEraOnwardsConstraints era => AlonzoEraOnwards era -> TxDats (ShelleyLedgerEra era) -> Redeemers (ShelleyLedgerEra era) -> TxBodyScriptData era
- data TxScriptValidity era where
- TxScriptValidityNone :: forall era. TxScriptValidity era
- TxScriptValidity :: forall era. AlonzoEraOnwards era -> ScriptValidity -> TxScriptValidity era
- data ScriptValidity
- scriptValidityToIsValid :: ScriptValidity -> IsValid
- isValidToScriptValidity :: IsValid -> ScriptValidity
- txScriptValidityToIsValid :: TxScriptValidity era -> IsValid
- txScriptValidityToScriptValidity :: TxScriptValidity era -> ScriptValidity
- newtype TxId = TxId (Hash StandardCrypto EraIndependentTxBody)
- getTxId :: TxBody era -> TxId
- getTxIdByron :: ATxAux ByteString -> TxId
- getTxIdShelley :: (EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto, EraTxBody (ShelleyLedgerEra era)) => ShelleyBasedEra era -> TxBody (ShelleyLedgerEra era) -> TxId
- data TxIn = TxIn TxId TxIx
- type TxIns build era = [(TxIn, BuildTxWith build (Witness WitCtxTxIn era))]
- newtype TxIx = TxIx Word
- genesisUTxOPseudoTxIn :: NetworkId -> Hash GenesisUTxOKey -> TxIn
- getReferenceInputsSizeForTxIds :: ShelleyLedgerEra era ~ ledgerera => BabbageEraOnwards era -> UTxO ledgerera -> Set TxIn -> Int
- data CtxTx
- data CtxUTxO
- data TxOut ctx era = TxOut (AddressInEra era) (TxOutValue era) (TxOutDatum ctx era) (ReferenceScript era)
- data TxOutValue era where
- TxOutValueByron :: forall era. Coin -> TxOutValue era
- TxOutValueShelleyBased :: forall era. (Eq (Value (ShelleyLedgerEra era)), Show (Value (ShelleyLedgerEra era))) => ShelleyBasedEra era -> Value (ShelleyLedgerEra era) -> TxOutValue era
- data TxOutDatum ctx era where
- TxOutDatumNone :: forall ctx era. TxOutDatum ctx era
- TxOutDatumHash :: forall era ctx. AlonzoEraOnwards era -> Hash ScriptData -> TxOutDatum ctx era
- TxOutSupplementalDatum :: forall era. AlonzoEraOnwards era -> HashableScriptData -> TxOutDatum CtxTx era
- TxOutDatumInline :: forall era ctx. BabbageEraOnwards era -> HashableScriptData -> TxOutDatum ctx era
- toCtxUTxOTxOut :: TxOut CtxTx era -> TxOut CtxUTxO era
- lovelaceToTxOutValue :: ShelleyBasedEra era -> Coin -> TxOutValue era
- prettyRenderTxOut :: TxOutInAnyEra -> Text
- txOutValueToLovelace :: TxOutValue era -> Coin
- txOutValueToValue :: TxOutValue era -> Value
- parseHash :: SerialiseAsRawBytes (Hash a) => AsType (Hash a) -> Parser (Hash a)
- data TxOutInAnyEra where
- TxOutInAnyEra :: forall era. CardanoEra era -> TxOut CtxTx era -> TxOutInAnyEra
- txOutInAnyEra :: CardanoEra era -> TxOut CtxTx era -> TxOutInAnyEra
- data TxInsCollateral era where
- TxInsCollateralNone :: forall era. TxInsCollateral era
- TxInsCollateral :: forall era. AlonzoEraOnwards era -> [TxIn] -> TxInsCollateral era
- data TxInsReference era where
- TxInsReferenceNone :: forall era. TxInsReference era
- TxInsReference :: forall era. BabbageEraOnwards era -> [TxIn] -> TxInsReference era
- data TxReturnCollateral ctx era where
- TxReturnCollateralNone :: forall ctx era. TxReturnCollateral ctx era
- TxReturnCollateral :: forall era ctx. BabbageEraOnwards era -> TxOut ctx era -> TxReturnCollateral ctx era
- data TxTotalCollateral era where
- TxTotalCollateralNone :: forall era. TxTotalCollateral era
- TxTotalCollateral :: forall era. BabbageEraOnwards era -> Coin -> TxTotalCollateral era
- data TxFee era where
- TxFeeExplicit :: forall era. ShelleyBasedEra era -> Coin -> TxFee era
- data TxValidityLowerBound era where
- TxValidityNoLowerBound :: forall era. TxValidityLowerBound era
- TxValidityLowerBound :: forall era. AllegraEraOnwards era -> SlotNo -> TxValidityLowerBound era
- data TxValidityUpperBound era where
- TxValidityUpperBound :: forall era. ShelleyBasedEra era -> Maybe SlotNo -> TxValidityUpperBound era
- data TxMetadataInEra era where
- TxMetadataNone :: forall era. TxMetadataInEra era
- TxMetadataInEra :: forall era. ShelleyBasedEra era -> TxMetadata -> TxMetadataInEra era
- data TxAuxScripts era where
- TxAuxScriptsNone :: forall era. TxAuxScripts era
- TxAuxScripts :: forall era. AllegraEraOnwards era -> [ScriptInEra era] -> TxAuxScripts era
- data TxExtraKeyWitnesses era where
- TxExtraKeyWitnessesNone :: forall era. TxExtraKeyWitnesses era
- TxExtraKeyWitnesses :: forall era. AlonzoEraOnwards era -> [Hash PaymentKey] -> TxExtraKeyWitnesses era
- data TxWithdrawals build era where
- TxWithdrawalsNone :: forall build era. TxWithdrawals build era
- TxWithdrawals :: forall era build. ShelleyBasedEra era -> [(StakeAddress, Coin, BuildTxWith build (Witness WitCtxStake era))] -> TxWithdrawals build era
- data TxCertificates build era where
- TxCertificatesNone :: forall build era. TxCertificates build era
- TxCertificates :: forall era build. ShelleyBasedEra era -> [Certificate era] -> BuildTxWith build [(StakeCredential, Witness WitCtxStake era)] -> TxCertificates build era
- data TxUpdateProposal era where
- TxUpdateProposalNone :: forall era. TxUpdateProposal era
- TxUpdateProposal :: forall era. ShelleyToBabbageEra era -> UpdateProposal -> TxUpdateProposal era
- data TxMintValue build era where
- TxMintNone :: forall build era. TxMintValue build era
- TxMintValue :: forall era build. MaryEraOnwards era -> Map PolicyId [(AssetName, Quantity, BuildTxWith build (ScriptWitness WitCtxMint era))] -> TxMintValue build era
- txMintValueToValue :: TxMintValue build era -> Value
- txMintValueToIndexed :: TxMintValue build era -> [(ScriptWitnessIndex, PolicyId, AssetName, Quantity, BuildTxWith build (ScriptWitness WitCtxMint era))]
- data TxVotingProcedures build era where
- TxVotingProceduresNone :: forall build era. TxVotingProcedures build era
- TxVotingProcedures :: forall era build. VotingProcedures (ShelleyLedgerEra era) -> BuildTxWith build (Map (Voter (EraCrypto (ShelleyLedgerEra era))) (ScriptWitness WitCtxStake era)) -> TxVotingProcedures build era
- mkTxVotingProcedures :: Applicative (BuildTxWith build) => [(VotingProcedures era, Maybe (ScriptWitness WitCtxStake era))] -> Either (VotesMergingConflict era) (TxVotingProcedures build era)
- data TxProposalProcedures build era where
- TxProposalProceduresNone :: forall build era. TxProposalProcedures build era
- TxProposalProcedures :: forall era build. EraPParams (ShelleyLedgerEra era) => OSet (ProposalProcedure (ShelleyLedgerEra era)) -> BuildTxWith build (Map (ProposalProcedure (ShelleyLedgerEra era)) (ScriptWitness WitCtxStake era)) -> TxProposalProcedures build era
- mkTxProposalProcedures :: forall era build. (Applicative (BuildTxWith build), IsShelleyBasedEra era) => [(ProposalProcedure (ShelleyLedgerEra era), Maybe (ScriptWitness WitCtxStake era))] -> TxProposalProcedures build era
- convProposalProcedures :: TxProposalProcedures build era -> OSet (ProposalProcedure (ShelleyLedgerEra era))
- data BuildTxWith build a where
- ViewTx :: forall a. BuildTxWith ViewTx a
- BuildTxWith :: forall a. a -> BuildTxWith BuildTx a
- data BuildTx
- data ViewTx
- buildTxWithToMaybe :: BuildTxWith build a -> Maybe a
- data AnyScriptWitness era where
- AnyScriptWitness :: forall witctx era. ScriptWitness witctx era -> AnyScriptWitness era
- data ScriptWitnessIndex
- renderScriptWitnessIndex :: ScriptWitnessIndex -> String
- collectTxBodyScriptWitnesses :: ShelleyBasedEra era -> TxBodyContent BuildTx era -> [(ScriptWitnessIndex, AnyScriptWitness era)]
- toScriptIndex :: AlonzoEraOnwards era -> PlutusPurpose AsIx (ShelleyLedgerEra era) -> ScriptWitnessIndex
- scriptDataToInlineDatum :: Era ledgerera => HashableScriptData -> Datum ledgerera
- convCertificates :: ShelleyBasedEra era -> TxCertificates build era -> StrictSeq (TxCert (ShelleyLedgerEra era))
- convCollateralTxIns :: TxInsCollateral era -> Set (TxIn StandardCrypto)
- convExtraKeyWitnesses :: TxExtraKeyWitnesses era -> Set (KeyHash 'Witness StandardCrypto)
- convLanguages :: [(ScriptWitnessIndex, AnyScriptWitness era)] -> Set Language
- convMintValue :: TxMintValue build era -> MultiAsset StandardCrypto
- convReferenceInputs :: TxInsReference era -> Set (TxIn StandardCrypto)
- convReturnCollateral :: ShelleyBasedEra era -> TxReturnCollateral ctx era -> StrictMaybe (TxOut (ShelleyLedgerEra era))
- convScripts :: ShelleyLedgerEra era ~ ledgerera => [(ScriptWitnessIndex, AnyScriptWitness era)] -> [Script ledgerera]
- convScriptData :: ShelleyBasedEra era -> [TxOut CtxTx era] -> [(ScriptWitnessIndex, AnyScriptWitness era)] -> TxBodyScriptData era
- convTotalCollateral :: TxTotalCollateral era -> StrictMaybe Coin
- convTransactionFee :: ShelleyBasedEra era -> TxFee era -> Coin
- convTxIns :: TxIns BuildTx era -> Set (TxIn StandardCrypto)
- convTxOuts :: forall ctx era ledgerera. ShelleyLedgerEra era ~ ledgerera => ShelleyBasedEra era -> [TxOut ctx era] -> StrictSeq (TxOut ledgerera)
- convTxUpdateProposal :: ShelleyBasedEra era -> TxUpdateProposal era -> Either TxBodyError (StrictMaybe (Update (ShelleyLedgerEra era)))
- convValidityLowerBound :: TxValidityLowerBound era -> Maybe SlotNo
- convValidityUpperBound :: ShelleyBasedEra era -> TxValidityUpperBound era -> Maybe SlotNo
- convVotingProcedures :: TxVotingProcedures build era -> VotingProcedures (ShelleyLedgerEra era)
- convWithdrawals :: TxWithdrawals build era -> Withdrawals StandardCrypto
- getScriptIntegrityHash :: BuildTxWith BuildTx (Maybe (LedgerProtocolParameters era)) -> Set Language -> TxBodyScriptData era -> StrictMaybe (ScriptIntegrityHash (EraCrypto (ShelleyLedgerEra era)))
- mkCommonTxBody :: ShelleyBasedEra era -> TxIns BuildTx era -> [TxOut ctx era] -> TxFee era -> TxWithdrawals build era -> Maybe (TxAuxData (ShelleyLedgerEra era)) -> TxBody era
- scriptWitnessesProposing :: TxProposalProcedures BuildTx era -> [(ScriptWitnessIndex, AnyScriptWitness era)]
- toAuxiliaryData :: ShelleyBasedEra era -> TxMetadataInEra era -> TxAuxScripts era -> Maybe (TxAuxData (ShelleyLedgerEra era))
- toByronTxId :: TxId -> TxId
- toShelleyTxId :: TxId -> TxId StandardCrypto
- toShelleyTxIn :: TxIn -> TxIn StandardCrypto
- toShelleyTxOut :: (HasCallStack, ShelleyLedgerEra era ~ ledgerera) => ShelleyBasedEra era -> TxOut CtxUTxO era -> TxOut ledgerera
- toShelleyTxOutAny :: forall ctx era ledgerera. (HasCallStack, ShelleyLedgerEra era ~ ledgerera) => ShelleyBasedEra era -> TxOut ctx era -> TxOut ledgerera
- fromShelleyTxId :: TxId StandardCrypto -> TxId
- fromShelleyTxIn :: TxIn StandardCrypto -> TxIn
- fromShelleyTxOut :: ShelleyBasedEra era -> TxOut (ShelleyLedgerEra era) -> TxOut ctx era
- fromByronTxIn :: TxIn -> TxIn
- fromLedgerTxOuts :: ShelleyBasedEra era -> TxBody (ShelleyLedgerEra era) -> TxBodyScriptData era -> [TxOut CtxTx era]
- renderTxIn :: TxIn -> Text
- calculateExecutionUnitsLovelace :: Prices -> ExecutionUnits -> Maybe Coin
- orderStakeAddrs :: [(StakeAddress, x, v)] -> [(StakeAddress, x, v)]
- orderTxIns :: [(TxIn, v)] -> [(TxIn, v)]
- data family AsType t
- getTxBodyContent :: TxBody era -> TxBodyContent ViewTx era
- validateTxIns :: [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn era))] -> Either TxBodyError ()
- guardShelleyTxInsOverflow :: [TxIn] -> Either TxBodyError ()
- validateTxOuts :: ShelleyBasedEra era -> [TxOut CtxTx era] -> Either TxBodyError ()
- validateMetadata :: TxMetadataInEra era -> Either TxBodyError ()
- validateTxInsCollateral :: TxInsCollateral era -> Set Language -> Either TxBodyError ()
- validateProtocolParameters :: BuildTxWith BuildTx (Maybe (LedgerProtocolParameters era)) -> Set Language -> Either TxBodyError ()
Documentation
Transaction bodies
data TxBody era where Source #
ShelleyTxBody | |
|
pattern TxBody :: TxBodyContent ViewTx era -> TxBody era |
Instances
Show (TxBody era) Source # | |||||
HasTypeProxy era => HasTypeProxy (TxBody era) Source # | |||||
Defined in Cardano.Api.Tx.Sign
| |||||
IsShelleyBasedEra era => SerialiseAsCBOR (TxBody era) Source # | |||||
Defined in Cardano.Api.Tx.Sign serialiseToCBOR :: TxBody era -> ByteString Source # deserialiseFromCBOR :: AsType (TxBody era) -> ByteString -> Either DecoderError (TxBody era) Source # | |||||
IsShelleyBasedEra era => HasTextEnvelope (TxBody era) Source # | |||||
Defined in Cardano.Api.Tx.Sign textEnvelopeType :: AsType (TxBody era) -> TextEnvelopeType Source # textEnvelopeDefaultDescr :: TxBody era -> TextEnvelopeDescr Source # | |||||
Eq (TxBody era) Source # | |||||
data AsType (TxBody era) Source # | |||||
Defined in Cardano.Api.Tx.Sign |
createTransactionBody :: ShelleyBasedEra era -> TxBodyContent BuildTx era -> Either TxBodyError (TxBody era) Source #
createAndValidateTransactionBody :: ShelleyBasedEra era -> TxBodyContent BuildTx era -> Either TxBodyError (TxBody era) Source #
Deprecated: Use createTransactionBody instead
data TxBodyContent build era Source #
Instances
IsShelleyBasedEra era => Show (TxBodyContent build era) Source # | |
Defined in Cardano.Api.Tx.Body | |
IsShelleyBasedEra era => Eq (TxBodyContent build era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxBodyContent build era -> TxBodyContent build era -> Bool Source # (/=) :: TxBodyContent build era -> TxBodyContent build era -> Bool Source # |
Byron only
makeByronTransactionBody :: TxIns BuildTx ByronEra -> [TxOut CtxTx ByronEra] -> Either TxBodyError (Annotated Tx ByteString) Source #
Transaction body builders
defaultTxBodyContent :: ShelleyBasedEra era -> TxBodyContent BuildTx era Source #
defaultTxFee :: ShelleyBasedEra era -> TxFee era Source #
defaultTxValidityUpperBound :: ShelleyBasedEra era -> TxValidityUpperBound era Source #
setTxIns :: TxIns build era -> TxBodyContent build era -> TxBodyContent build era Source #
modTxIns :: (TxIns build era -> TxIns build era) -> TxBodyContent build era -> TxBodyContent build era Source #
addTxIn :: (TxIn, BuildTxWith build (Witness WitCtxTxIn era)) -> TxBodyContent build era -> TxBodyContent build era Source #
setTxInsCollateral :: TxInsCollateral era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxInsReference :: TxInsReference era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxOuts :: [TxOut CtxTx era] -> TxBodyContent build era -> TxBodyContent build era Source #
modTxOuts :: ([TxOut CtxTx era] -> [TxOut CtxTx era]) -> TxBodyContent build era -> TxBodyContent build era Source #
addTxOut :: TxOut CtxTx era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxTotalCollateral :: TxTotalCollateral era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxReturnCollateral :: TxReturnCollateral CtxTx era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxFee :: TxFee era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxValidityLowerBound :: TxValidityLowerBound era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxValidityUpperBound :: TxValidityUpperBound era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxMetadata :: TxMetadataInEra era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxAuxScripts :: TxAuxScripts era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxExtraKeyWits :: TxExtraKeyWitnesses era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxProtocolParams :: BuildTxWith build (Maybe (LedgerProtocolParameters era)) -> TxBodyContent build era -> TxBodyContent build era Source #
setTxWithdrawals :: TxWithdrawals build era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxCertificates :: TxCertificates build era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxUpdateProposal :: TxUpdateProposal era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxProposalProcedures :: Maybe (Featured ConwayEraOnwards era (TxProposalProcedures build era)) -> TxBodyContent build era -> TxBodyContent build era Source #
setTxVotingProcedures :: Maybe (Featured ConwayEraOnwards era (TxVotingProcedures build era)) -> TxBodyContent build era -> TxBodyContent build era Source #
setTxMintValue :: TxMintValue build era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxScriptValidity :: TxScriptValidity era -> TxBodyContent build era -> TxBodyContent build era Source #
setTxCurrentTreasuryValue :: Maybe (Featured ConwayEraOnwards era (Maybe Coin)) -> TxBodyContent build era -> TxBodyContent build era Source #
setTxTreasuryDonation :: Maybe (Featured ConwayEraOnwards era Coin) -> TxBodyContent build era -> TxBodyContent build era Source #
data TxBodyError Source #
Instances
Show TxBodyError Source # | |
Defined in Cardano.Api.Tx.Body | |
Error TxBodyError Source # | |
Defined in Cardano.Api.Tx.Body prettyError :: TxBodyError -> Doc ann Source # | |
Eq TxBodyError Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxBodyError -> TxBodyError -> Bool Source # (/=) :: TxBodyError -> TxBodyError -> Bool Source # |
data TxBodyScriptData era where Source #
TxBodyNoScriptData :: forall era. TxBodyScriptData era | |
TxBodyScriptData :: forall era. AlonzoEraOnwardsConstraints era => AlonzoEraOnwards era -> TxDats (ShelleyLedgerEra era) -> Redeemers (ShelleyLedgerEra era) -> TxBodyScriptData era |
Instances
EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto => Show (TxBodyScriptData era) Source # | |
Defined in Cardano.Api.Tx.Sign | |
Eq (TxBodyScriptData era) Source # | |
Defined in Cardano.Api.Tx.Sign (==) :: TxBodyScriptData era -> TxBodyScriptData era -> Bool Source # (/=) :: TxBodyScriptData era -> TxBodyScriptData era -> Bool Source # |
data TxScriptValidity era where Source #
A representation of whether the era supports tx script validity.
The Alonzo and subsequent eras support script validity.
TxScriptValidityNone :: forall era. TxScriptValidity era | |
TxScriptValidity :: forall era. AlonzoEraOnwards era -> ScriptValidity -> TxScriptValidity era | Tx script validity is supported in transactions in the |
Instances
Show (TxScriptValidity era) Source # | |
Defined in Cardano.Api.Tx.Sign | |
Eq (TxScriptValidity era) Source # | |
Defined in Cardano.Api.Tx.Sign (==) :: TxScriptValidity era -> TxScriptValidity era -> Bool Source # (/=) :: TxScriptValidity era -> TxScriptValidity era -> Bool Source # |
data ScriptValidity Source #
Indicates whether a script is expected to fail or pass validation.
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
Show ScriptValidity Source # | |
Defined in Cardano.Api.Tx.Sign | |
DecCBOR ScriptValidity Source # | |
Defined in Cardano.Api.Tx.Sign | |
EncCBOR ScriptValidity Source # | |
Defined in Cardano.Api.Tx.Sign encCBOR :: ScriptValidity -> Encoding Source # encodedSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy ScriptValidity -> Size Source # encodedListSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy [ScriptValidity] -> Size Source # | |
Eq ScriptValidity Source # | |
Defined in Cardano.Api.Tx.Sign (==) :: ScriptValidity -> ScriptValidity -> Bool Source # (/=) :: ScriptValidity -> ScriptValidity -> Bool Source # |
txScriptValidityToIsValid :: TxScriptValidity era -> IsValid Source #
Transaction Ids
Instances
FromJSON TxId Source # | |
Defined in Cardano.Api.TxIn parseJSON :: Value -> Parser TxId # parseJSONList :: Value -> Parser [TxId] # omittedField :: Maybe TxId # | |
FromJSONKey TxId Source # | |
Defined in Cardano.Api.TxIn fromJSONKey :: FromJSONKeyFunction TxId fromJSONKeyList :: FromJSONKeyFunction [TxId] | |
ToJSON TxId Source # | |
Defined in Cardano.Api.TxIn | |
ToJSONKey TxId Source # | |
Defined in Cardano.Api.TxIn toJSONKey :: ToJSONKeyFunction TxId toJSONKeyList :: ToJSONKeyFunction [TxId] | |
IsString TxId Source # | |
Defined in Cardano.Api.TxIn fromString :: String -> TxId Source # | |
Show TxId Source # | |
HasTypeProxy TxId Source # | |
Defined in Cardano.Api.TxIn | |
SerialiseAsRawBytes TxId Source # | |
Defined in Cardano.Api.TxIn | |
Eq TxId Source # | |
Ord TxId Source # | |
data AsType TxId Source # | |
Defined in Cardano.Api.TxIn |
getTxIdByron :: ATxAux ByteString -> TxId Source #
getTxIdShelley :: (EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto, EraTxBody (ShelleyLedgerEra era)) => ShelleyBasedEra era -> TxBody (ShelleyLedgerEra era) -> TxId Source #
Transaction inputs
Instances
FromJSON TxIn Source # | |
Defined in Cardano.Api.TxIn parseJSON :: Value -> Parser TxIn # parseJSONList :: Value -> Parser [TxIn] # omittedField :: Maybe TxIn # | |
FromJSONKey TxIn Source # | |
Defined in Cardano.Api.TxIn fromJSONKey :: FromJSONKeyFunction TxIn fromJSONKeyList :: FromJSONKeyFunction [TxIn] | |
ToJSON TxIn Source # | |
Defined in Cardano.Api.TxIn | |
ToJSONKey TxIn Source # | |
Defined in Cardano.Api.TxIn toJSONKey :: ToJSONKeyFunction TxIn toJSONKeyList :: ToJSONKeyFunction [TxIn] | |
Show TxIn Source # | |
Eq TxIn Source # | |
Ord TxIn Source # | |
Pretty TxIn Source # | |
Defined in Cardano.Api.TxIn |
type TxIns build era = [(TxIn, BuildTxWith build (Witness WitCtxTxIn era))] Source #
Instances
FromJSON TxIx Source # | |
Defined in Cardano.Api.TxIn parseJSON :: Value -> Parser TxIx # parseJSONList :: Value -> Parser [TxIx] # omittedField :: Maybe TxIx # | |
ToJSON TxIx Source # | |
Defined in Cardano.Api.TxIn | |
Enum TxIx Source # | |
Show TxIx Source # | |
Eq TxIx Source # | |
Ord TxIx Source # | |
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.
getReferenceInputsSizeForTxIds :: ShelleyLedgerEra era ~ ledgerera => BabbageEraOnwards era -> UTxO ledgerera -> Set TxIn -> Int Source #
Calculate the reference inputs size in bytes for provided set of transaction IDs and UTXOs.
Transaction outputs
The context is a transaction body
Instances
IsShelleyBasedEra era => FromJSON (TxOut CtxTx era) Source # | |
Defined in Cardano.Api.Tx.Body |
The context is the UTxO
Instances
IsShelleyBasedEra era => FromJSON (TxOut CtxUTxO era) Source # | |
Defined in Cardano.Api.Tx.Body |
TxOut (AddressInEra era) (TxOutValue era) (TxOutDatum ctx era) (ReferenceScript era) |
Instances
IsShelleyBasedEra era => FromJSON (TxOut CtxTx era) Source # | |
Defined in Cardano.Api.Tx.Body | |
IsShelleyBasedEra era => FromJSON (TxOut CtxUTxO era) Source # | |
Defined in Cardano.Api.Tx.Body | |
IsCardanoEra era => ToJSON (TxOut ctx era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Show (TxOut ctx era) Source # | |
Eq (TxOut ctx era) Source # | |
data TxOutValue era where Source #
TxOutValueByron :: forall era. Coin -> TxOutValue era | |
TxOutValueShelleyBased :: forall era. (Eq (Value (ShelleyLedgerEra era)), Show (Value (ShelleyLedgerEra era))) => ShelleyBasedEra era -> Value (ShelleyLedgerEra era) -> TxOutValue era |
Instances
IsShelleyBasedEra era => FromJSON (TxOutValue era) Source # | |
Defined in Cardano.Api.Tx.Body parseJSON :: Value -> Parser (TxOutValue era) # parseJSONList :: Value -> Parser [TxOutValue era] # omittedField :: Maybe (TxOutValue era) # | |
IsCardanoEra era => ToJSON (TxOutValue era) Source # | |
Defined in Cardano.Api.Tx.Body toJSON :: TxOutValue era -> Value # toEncoding :: TxOutValue era -> Encoding # toJSONList :: [TxOutValue era] -> Value # toEncodingList :: [TxOutValue era] -> Encoding # omitField :: TxOutValue era -> Bool # | |
Show (TxOutValue era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxOutValue era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxOutValue era -> TxOutValue era -> Bool Source # (/=) :: TxOutValue era -> TxOutValue era -> Bool Source # |
data TxOutDatum ctx era where Source #
TxOutDatumNone :: forall ctx era. TxOutDatum ctx era | |
TxOutDatumHash :: forall era ctx. AlonzoEraOnwards era -> Hash ScriptData -> TxOutDatum ctx era | A transaction output that only specifies the hash of the datum, but not the full datum value. |
TxOutSupplementalDatum :: forall era. AlonzoEraOnwards era -> HashableScriptData -> TxOutDatum CtxTx era | A transaction output that specifies the whole datum value. This can only be used in the context of the transaction body (i.e this is a supplemental datum), and does not occur in the UTxO. The UTxO only contains the datum hash. |
TxOutDatumInline :: forall era ctx. BabbageEraOnwards era -> HashableScriptData -> TxOutDatum ctx era | A transaction output that specifies the whole datum instead of the datum hash. Note that the datum map will not be updated with this datum, it only exists at the transaction output. |
Instances
Show (TxOutDatum ctx era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxOutDatum ctx era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxOutDatum ctx era -> TxOutDatum ctx era -> Bool Source # (/=) :: TxOutDatum ctx era -> TxOutDatum ctx era -> Bool Source # |
lovelaceToTxOutValue :: ShelleyBasedEra era -> Coin -> TxOutValue era Source #
txOutValueToLovelace :: TxOutValue era -> Coin Source #
txOutValueToValue :: TxOutValue era -> Value Source #
data TxOutInAnyEra where Source #
TxOutInAnyEra :: forall era. CardanoEra era -> TxOut CtxTx era -> TxOutInAnyEra |
Instances
Show TxOutInAnyEra Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq TxOutInAnyEra Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxOutInAnyEra -> TxOutInAnyEra -> Bool Source # (/=) :: TxOutInAnyEra -> TxOutInAnyEra -> Bool Source # | |
Pretty TxOutInAnyEra Source # | |
Defined in Cardano.Api.Tx.Body pretty :: TxOutInAnyEra -> Doc ann # prettyList :: [TxOutInAnyEra] -> Doc ann # |
txOutInAnyEra :: CardanoEra era -> TxOut CtxTx era -> TxOutInAnyEra Source #
Convenience constructor for TxOutInAnyEra
Other transaction body types
data TxInsCollateral era where Source #
TxInsCollateralNone :: forall era. TxInsCollateral era | |
TxInsCollateral :: forall era. AlonzoEraOnwards era -> [TxIn] -> TxInsCollateral era |
Instances
Show (TxInsCollateral era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxInsCollateral era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxInsCollateral era -> TxInsCollateral era -> Bool Source # (/=) :: TxInsCollateral era -> TxInsCollateral era -> Bool Source # |
data TxInsReference era where Source #
TxInsReferenceNone :: forall era. TxInsReference era | |
TxInsReference :: forall era. BabbageEraOnwards era -> [TxIn] -> TxInsReference era |
Instances
Show (TxInsReference era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxInsReference era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxInsReference era -> TxInsReference era -> Bool Source # (/=) :: TxInsReference era -> TxInsReference era -> Bool Source # |
data TxReturnCollateral ctx era where Source #
TxReturnCollateralNone :: forall ctx era. TxReturnCollateral ctx era | |
TxReturnCollateral :: forall era ctx. BabbageEraOnwards era -> TxOut ctx era -> TxReturnCollateral ctx era |
Instances
Show (TxReturnCollateral ctx era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxReturnCollateral ctx era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxReturnCollateral ctx era -> TxReturnCollateral ctx era -> Bool Source # (/=) :: TxReturnCollateral ctx era -> TxReturnCollateral ctx era -> Bool Source # |
data TxTotalCollateral era where Source #
TxTotalCollateralNone :: forall era. TxTotalCollateral era | |
TxTotalCollateral :: forall era. BabbageEraOnwards era -> Coin -> TxTotalCollateral era |
Instances
Show (TxTotalCollateral era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxTotalCollateral era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxTotalCollateral era -> TxTotalCollateral era -> Bool Source # (/=) :: TxTotalCollateral era -> TxTotalCollateral era -> Bool Source # |
TxFeeExplicit :: forall era. ShelleyBasedEra era -> Coin -> TxFee era |
data TxValidityLowerBound era where Source #
TxValidityNoLowerBound :: forall era. TxValidityLowerBound era | |
TxValidityLowerBound :: forall era. AllegraEraOnwards era -> SlotNo -> TxValidityLowerBound era |
Instances
Show (TxValidityLowerBound era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxValidityLowerBound era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxValidityLowerBound era -> TxValidityLowerBound era -> Bool Source # (/=) :: TxValidityLowerBound era -> TxValidityLowerBound era -> Bool Source # |
data TxValidityUpperBound era where Source #
This was formerly known as the TTL.
TxValidityUpperBound :: forall era. ShelleyBasedEra era -> Maybe SlotNo -> TxValidityUpperBound era |
Instances
Show (TxValidityUpperBound era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxValidityUpperBound era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxValidityUpperBound era -> TxValidityUpperBound era -> Bool Source # (/=) :: TxValidityUpperBound era -> TxValidityUpperBound era -> Bool Source # |
data TxMetadataInEra era where Source #
TxMetadataNone :: forall era. TxMetadataInEra era | |
TxMetadataInEra :: forall era. ShelleyBasedEra era -> TxMetadata -> TxMetadataInEra era |
Instances
Show (TxMetadataInEra era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxMetadataInEra era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxMetadataInEra era -> TxMetadataInEra era -> Bool Source # (/=) :: TxMetadataInEra era -> TxMetadataInEra era -> Bool Source # |
data TxAuxScripts era where Source #
TxAuxScriptsNone :: forall era. TxAuxScripts era | |
TxAuxScripts :: forall era. AllegraEraOnwards era -> [ScriptInEra era] -> TxAuxScripts era |
Instances
Show (TxAuxScripts era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxAuxScripts era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxAuxScripts era -> TxAuxScripts era -> Bool Source # (/=) :: TxAuxScripts era -> TxAuxScripts era -> Bool Source # |
data TxExtraKeyWitnesses era where Source #
TxExtraKeyWitnessesNone :: forall era. TxExtraKeyWitnesses era | |
TxExtraKeyWitnesses :: forall era. AlonzoEraOnwards era -> [Hash PaymentKey] -> TxExtraKeyWitnesses era |
Instances
Show (TxExtraKeyWitnesses era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxExtraKeyWitnesses era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxExtraKeyWitnesses era -> TxExtraKeyWitnesses era -> Bool Source # (/=) :: TxExtraKeyWitnesses era -> TxExtraKeyWitnesses era -> Bool Source # |
data TxWithdrawals build era where Source #
TxWithdrawalsNone :: forall build era. TxWithdrawals build era | |
TxWithdrawals :: forall era build. ShelleyBasedEra era -> [(StakeAddress, Coin, BuildTxWith build (Witness WitCtxStake era))] -> TxWithdrawals build era |
Instances
Show (TxWithdrawals build era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxWithdrawals build era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxWithdrawals build era -> TxWithdrawals build era -> Bool Source # (/=) :: TxWithdrawals build era -> TxWithdrawals build era -> Bool Source # |
data TxCertificates build era where Source #
TxCertificatesNone :: forall build era. TxCertificates build era | |
TxCertificates | |
|
Instances
Show (TxCertificates build era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxCertificates build era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxCertificates build era -> TxCertificates build era -> Bool Source # (/=) :: TxCertificates build era -> TxCertificates build era -> Bool Source # |
data TxUpdateProposal era where Source #
TxUpdateProposalNone :: forall era. TxUpdateProposal era | |
TxUpdateProposal :: forall era. ShelleyToBabbageEra era -> UpdateProposal -> TxUpdateProposal era |
Instances
Show (TxUpdateProposal era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxUpdateProposal era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxUpdateProposal era -> TxUpdateProposal era -> Bool Source # (/=) :: TxUpdateProposal era -> TxUpdateProposal era -> Bool Source # |
data TxMintValue build era where Source #
TxMintNone :: forall build era. TxMintValue build era | |
TxMintValue :: forall era build. MaryEraOnwards era -> Map PolicyId [(AssetName, Quantity, BuildTxWith build (ScriptWitness WitCtxMint era))] -> TxMintValue build era |
Instances
Show (TxMintValue build era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxMintValue build era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxMintValue build era -> TxMintValue build era -> Bool Source # (/=) :: TxMintValue build era -> TxMintValue build era -> Bool Source # |
txMintValueToValue :: TxMintValue build era -> Value Source #
Convert TxMintValue
to a more handy Value
.
txMintValueToIndexed :: TxMintValue build era -> [(ScriptWitnessIndex, PolicyId, AssetName, Quantity, BuildTxWith build (ScriptWitness WitCtxMint era))] Source #
Index the assets with witnesses in the order of policy ids. See section 4.1 of https://github.com/intersectmbo/cardano-ledger/releases/latest/download/alonzo-ledger.pdf
data TxVotingProcedures build era where Source #
TxVotingProceduresNone :: forall build era. TxVotingProcedures build era | |
TxVotingProcedures :: forall era build. VotingProcedures (ShelleyLedgerEra era) -> BuildTxWith build (Map (Voter (EraCrypto (ShelleyLedgerEra era))) (ScriptWitness WitCtxStake era)) -> TxVotingProcedures build era |
Instances
Show (TxVotingProcedures build era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxVotingProcedures build era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxVotingProcedures build era -> TxVotingProcedures build era -> Bool Source # (/=) :: TxVotingProcedures build era -> TxVotingProcedures build era -> Bool Source # |
mkTxVotingProcedures :: Applicative (BuildTxWith build) => [(VotingProcedures era, Maybe (ScriptWitness WitCtxStake era))] -> Either (VotesMergingConflict era) (TxVotingProcedures build era) Source #
Create voting procedures from map of voting procedures and optional witnesses.
Validates the function argument, to make sure the list of votes is legal.
See mergeVotingProcedures
for validation rules.
data TxProposalProcedures build era where Source #
TxProposalProceduresNone :: forall build era. TxProposalProcedures build era | |
TxProposalProcedures | Create Tx proposal procedures. Prefer |
|
Instances
Show (TxProposalProcedures build era) Source # | |
Defined in Cardano.Api.Tx.Body | |
Eq (TxProposalProcedures build era) Source # | |
Defined in Cardano.Api.Tx.Body (==) :: TxProposalProcedures build era -> TxProposalProcedures build era -> Bool Source # (/=) :: TxProposalProcedures build era -> TxProposalProcedures build era -> Bool Source # |
mkTxProposalProcedures :: forall era build. (Applicative (BuildTxWith build), IsShelleyBasedEra era) => [(ProposalProcedure (ShelleyLedgerEra era), Maybe (ScriptWitness WitCtxStake era))] -> TxProposalProcedures build era Source #
A smart constructor for TxProposalProcedures
. It makes sure that the value produced is consistent - the
witnessed proposals are also present in the first constructor parameter.
convProposalProcedures :: TxProposalProcedures build era -> OSet (ProposalProcedure (ShelleyLedgerEra era)) Source #
Returns an OSet of proposals from TxProposalProcedures
.
If pws
in 'TxProposalProcedures pps (BuildTxWith pws)' contained proposals not present in pps
, the'll
be sorted ascendingly and snoc-ed to pps
if they're not present in pps
.
Building vs viewing transactions
data BuildTxWith build a where Source #
ViewTx :: forall a. BuildTxWith ViewTx a | |
BuildTxWith :: forall a. a -> BuildTxWith BuildTx a |
Instances
Instances
Applicative (BuildTxWith BuildTx) Source # | |
Defined in Cardano.Api.Tx.Body pure :: a -> BuildTxWith BuildTx a Source # (<*>) :: BuildTxWith BuildTx (a -> b) -> BuildTxWith BuildTx a -> BuildTxWith BuildTx b Source # liftA2 :: (a -> b -> c) -> BuildTxWith BuildTx a -> BuildTxWith BuildTx b -> BuildTxWith BuildTx c Source # (*>) :: BuildTxWith BuildTx a -> BuildTxWith BuildTx b -> BuildTxWith BuildTx b Source # (<*) :: BuildTxWith BuildTx a -> BuildTxWith BuildTx b -> BuildTxWith BuildTx a Source # |
Instances
Applicative (BuildTxWith ViewTx) Source # | |
Defined in Cardano.Api.Tx.Body pure :: a -> BuildTxWith ViewTx a Source # (<*>) :: BuildTxWith ViewTx (a -> b) -> BuildTxWith ViewTx a -> BuildTxWith ViewTx b Source # liftA2 :: (a -> b -> c) -> BuildTxWith ViewTx a -> BuildTxWith ViewTx b -> BuildTxWith ViewTx c Source # (*>) :: BuildTxWith ViewTx a -> BuildTxWith ViewTx b -> BuildTxWith ViewTx b Source # (<*) :: BuildTxWith ViewTx a -> BuildTxWith ViewTx b -> BuildTxWith ViewTx a Source # |
buildTxWithToMaybe :: BuildTxWith build a -> Maybe a 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.
AnyScriptWitness :: forall witctx era. ScriptWitness witctx era -> AnyScriptWitness era |
Instances
Show (AnyScriptWitness era) Source # | |
Defined in Cardano.Api.Tx.Body |
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.
ScriptWitnessIndexTxIn !Word32 | The n'th transaction input, in the order of the |
ScriptWitnessIndexMint !Word32 | |
ScriptWitnessIndexCertificate !Word32 | The n'th certificate, in the list order of the certificates. |
ScriptWitnessIndexWithdrawal !Word32 | The n'th withdrawal, in the order of the |
ScriptWitnessIndexVoting !Word32 | The n'th vote, in the order of the votes. |
ScriptWitnessIndexProposing !Word32 | The n'th proposal, in the order of the proposals. |
Instances
collectTxBodyScriptWitnesses :: ShelleyBasedEra era -> TxBodyContent BuildTx era -> [(ScriptWitnessIndex, AnyScriptWitness era)] Source #
toScriptIndex :: AlonzoEraOnwards era -> PlutusPurpose AsIx (ShelleyLedgerEra era) -> ScriptWitnessIndex Source #
Conversion to inline data
scriptDataToInlineDatum :: Era ledgerera => HashableScriptData -> Datum ledgerera Source #
Conversion of ScriptData to binary data which allows for the storage of data onchain within a transaction output.
Internal conversion functions & types
convCertificates :: ShelleyBasedEra era -> TxCertificates build era -> StrictSeq (TxCert (ShelleyLedgerEra era)) Source #
convCollateralTxIns :: TxInsCollateral era -> Set (TxIn StandardCrypto) Source #
convExtraKeyWitnesses :: TxExtraKeyWitnesses era -> Set (KeyHash 'Witness StandardCrypto) Source #
convLanguages :: [(ScriptWitnessIndex, AnyScriptWitness era)] -> Set Language Source #
convMintValue :: TxMintValue build era -> MultiAsset StandardCrypto Source #
convReferenceInputs :: TxInsReference era -> Set (TxIn StandardCrypto) Source #
convReturnCollateral :: ShelleyBasedEra era -> TxReturnCollateral ctx era -> StrictMaybe (TxOut (ShelleyLedgerEra era)) Source #
convScripts :: ShelleyLedgerEra era ~ ledgerera => [(ScriptWitnessIndex, AnyScriptWitness era)] -> [Script ledgerera] Source #
convScriptData :: ShelleyBasedEra era -> [TxOut CtxTx era] -> [(ScriptWitnessIndex, AnyScriptWitness era)] -> TxBodyScriptData era Source #
convTotalCollateral :: TxTotalCollateral era -> StrictMaybe Coin Source #
convTransactionFee :: ShelleyBasedEra era -> TxFee era -> Coin Source #
convTxOuts :: forall ctx era ledgerera. ShelleyLedgerEra era ~ ledgerera => ShelleyBasedEra era -> [TxOut ctx era] -> StrictSeq (TxOut ledgerera) Source #
:: ShelleyBasedEra era | |
-> TxUpdateProposal era | |
-> Either TxBodyError (StrictMaybe (Update (ShelleyLedgerEra era))) |
|
Convert transaction update proposal into ledger update proposal
convValidityLowerBound :: TxValidityLowerBound era -> Maybe SlotNo Source #
convValidityUpperBound :: ShelleyBasedEra era -> TxValidityUpperBound era -> Maybe SlotNo Source #
convVotingProcedures :: TxVotingProcedures build era -> VotingProcedures (ShelleyLedgerEra era) Source #
convWithdrawals :: TxWithdrawals build era -> Withdrawals StandardCrypto Source #
getScriptIntegrityHash :: BuildTxWith BuildTx (Maybe (LedgerProtocolParameters era)) -> Set Language -> TxBodyScriptData era -> StrictMaybe (ScriptIntegrityHash (EraCrypto (ShelleyLedgerEra era))) Source #
mkCommonTxBody :: ShelleyBasedEra era -> TxIns BuildTx era -> [TxOut ctx era] -> TxFee era -> TxWithdrawals build era -> Maybe (TxAuxData (ShelleyLedgerEra era)) -> TxBody era Source #
A helper function that constructs a TxBody with all of the fields that are common for all eras
scriptWitnessesProposing :: TxProposalProcedures BuildTx era -> [(ScriptWitnessIndex, AnyScriptWitness era)] Source #
toAuxiliaryData :: ShelleyBasedEra era -> TxMetadataInEra era -> TxAuxScripts era -> Maybe (TxAuxData (ShelleyLedgerEra era)) Source #
In the Allegra and Mary eras the auxiliary data consists of the tx metadata and the axiliary scripts. In the Alonzo and later eras the auxiliary data consists of the tx metadata and the axiliary scripts, and the axiliary script data.
toByronTxId :: TxId -> TxId Source #
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 :: (HasCallStack, ShelleyLedgerEra era ~ ledgerera) => ShelleyBasedEra era -> TxOut CtxUTxO era -> TxOut ledgerera Source #
toShelleyTxOutAny :: forall ctx era ledgerera. (HasCallStack, 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 :: ShelleyBasedEra era -> TxOut (ShelleyLedgerEra era) -> TxOut ctx era Source #
fromByronTxIn :: TxIn -> TxIn Source #
fromLedgerTxOuts :: ShelleyBasedEra era -> TxBody (ShelleyLedgerEra era) -> TxBodyScriptData era -> [TxOut CtxTx era] Source #
renderTxIn :: TxIn -> Text Source #
Misc helpers
orderStakeAddrs :: [(StakeAddress, x, v)] -> [(StakeAddress, x, v)] Source #
orderTxIns :: [(TxIn, v)] -> [(TxIn, v)] Source #
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.
Instances
getTxBodyContent :: TxBody era -> TxBodyContent ViewTx era Source #
validateTxIns :: [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn era))] -> Either TxBodyError () Source #
guardShelleyTxInsOverflow :: [TxIn] -> Either TxBodyError () Source #
validateTxOuts :: ShelleyBasedEra era -> [TxOut CtxTx era] -> Either TxBodyError () Source #
validateMetadata :: TxMetadataInEra era -> Either TxBodyError () Source #
validateTxInsCollateral :: TxInsCollateral era -> Set Language -> Either TxBodyError () Source #
validateProtocolParameters :: BuildTxWith BuildTx (Maybe (LedgerProtocolParameters era)) -> Set Language -> Either TxBodyError () Source #