cardano-api:internal
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Tx.Body

Description

Transaction bodies

Synopsis

Documentation

Transaction bodies

data TxBody era where Source #

Constructors

ShelleyTxBody 

Fields

Bundled Patterns

pattern TxBody :: TxBodyContent ViewTx era -> TxBody era 

Instances

Instances details
Show (TxBody era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

Methods

showsPrec :: Int -> TxBody era -> ShowS Source #

show :: TxBody era -> String Source #

showList :: [TxBody era] -> ShowS Source #

HasTypeProxy era => HasTypeProxy (TxBody era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

Associated Types

data AsType (TxBody era) 
Instance details

Defined in Cardano.Api.Tx.Sign

data AsType (TxBody era) = AsTxBody (AsType era)

Methods

proxyToAsType :: Proxy (TxBody era) -> AsType (TxBody era) Source #

IsShelleyBasedEra era => SerialiseAsCBOR (TxBody era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

IsShelleyBasedEra era => HasTextEnvelope (TxBody era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

Eq (TxBody era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

Methods

(==) :: TxBody era -> TxBody era -> Bool Source #

(/=) :: TxBody era -> TxBody era -> Bool Source #

data AsType (TxBody era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

data AsType (TxBody era) = AsTxBody (AsType era)

createAndValidateTransactionBody :: ShelleyBasedEra era -> TxBodyContent BuildTx era -> Either TxBodyError (TxBody era) Source #

Deprecated: Use createTransactionBody instead

data TxBodyContent build era Source #

Instances

Instances details
IsShelleyBasedEra era => Show (TxBodyContent build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

showsPrec :: Int -> TxBodyContent build era -> ShowS Source #

show :: TxBodyContent build era -> String Source #

showList :: [TxBodyContent build era] -> ShowS Source #

IsShelleyBasedEra era => Eq (TxBodyContent build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: TxBodyContent build era -> TxBodyContent build era -> Bool Source #

(/=) :: TxBodyContent build era -> TxBodyContent build era -> Bool Source #

Byron only

Transaction body builders

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 #

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 #

setTxFee :: TxFee 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 #

setTxMintValue :: TxMintValue build era -> TxBodyContent build era -> TxBodyContent build era Source #

data TxScriptValidity era where Source #

A representation of whether the era supports tx script validity.

The Alonzo and subsequent eras support script validity.

Constructors

TxScriptValidityNone :: forall era. TxScriptValidity era 
TxScriptValidity :: forall era. AlonzoEraOnwards era -> ScriptValidity -> TxScriptValidity era

Tx script validity is supported in transactions in the Alonzo era onwards.

Instances

Instances details
Show (TxScriptValidity era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

Eq (TxScriptValidity era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

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.

Transaction Ids

newtype TxId Source #

Instances

Instances details
FromJSON TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

parseJSON :: Value -> Parser TxId #

parseJSONList :: Value -> Parser [TxId] #

omittedField :: Maybe TxId #

FromJSONKey TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

fromJSONKey :: FromJSONKeyFunction TxId

fromJSONKeyList :: FromJSONKeyFunction [TxId]

ToJSON TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

toJSON :: TxId -> Value #

toEncoding :: TxId -> Encoding #

toJSONList :: [TxId] -> Value #

toEncodingList :: [TxId] -> Encoding #

omitField :: TxId -> Bool #

ToJSONKey TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

toJSONKey :: ToJSONKeyFunction TxId

toJSONKeyList :: ToJSONKeyFunction [TxId]

IsString TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

Show TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

HasTypeProxy TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

Associated Types

data AsType TxId 
Instance details

Defined in Cardano.Api.TxIn

SerialiseAsRawBytes TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

Eq TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

(==) :: TxId -> TxId -> Bool Source #

(/=) :: TxId -> TxId -> Bool Source #

Ord TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

data AsType TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

getTxId :: TxBody era -> TxId Source #

Calculate the transaction identifier for a TxBody.

Transaction inputs

data TxIn Source #

Constructors

TxIn TxId TxIx 

Instances

Instances details
FromJSON TxIn Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

parseJSON :: Value -> Parser TxIn #

parseJSONList :: Value -> Parser [TxIn] #

omittedField :: Maybe TxIn #

FromJSONKey TxIn Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

fromJSONKey :: FromJSONKeyFunction TxIn

fromJSONKeyList :: FromJSONKeyFunction [TxIn]

ToJSON TxIn Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

toJSON :: TxIn -> Value #

toEncoding :: TxIn -> Encoding #

toJSONList :: [TxIn] -> Value #

toEncodingList :: [TxIn] -> Encoding #

omitField :: TxIn -> Bool #

ToJSONKey TxIn Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

toJSONKey :: ToJSONKeyFunction TxIn

toJSONKeyList :: ToJSONKeyFunction [TxIn]

Show TxIn Source # 
Instance details

Defined in Cardano.Api.TxIn

Eq TxIn Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

(==) :: TxIn -> TxIn -> Bool Source #

(/=) :: TxIn -> TxIn -> Bool Source #

Ord TxIn Source # 
Instance details

Defined in Cardano.Api.TxIn

Pretty TxIn Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

pretty :: TxIn -> Doc ann #

prettyList :: [TxIn] -> Doc ann #

type TxIns build era = [(TxIn, BuildTxWith build (Witness WitCtxTxIn era))] Source #

newtype TxIx Source #

Constructors

TxIx Word 

Instances

Instances details
FromJSON TxIx Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

parseJSON :: Value -> Parser TxIx #

parseJSONList :: Value -> Parser [TxIx] #

omittedField :: Maybe TxIx #

ToJSON TxIx Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

toJSON :: TxIx -> Value #

toEncoding :: TxIx -> Encoding #

toJSONList :: [TxIx] -> Value #

toEncodingList :: [TxIx] -> Encoding #

omitField :: TxIx -> Bool #

Enum TxIx Source # 
Instance details

Defined in Cardano.Api.TxIn

Show TxIx Source # 
Instance details

Defined in Cardano.Api.TxIn

Eq TxIx Source # 
Instance details

Defined in Cardano.Api.TxIn

Methods

(==) :: TxIx -> TxIx -> Bool Source #

(/=) :: TxIx -> TxIx -> Bool Source #

Ord TxIx Source # 
Instance details

Defined in Cardano.Api.TxIn

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

data CtxTx Source #

The context is a transaction body

Instances

Instances details
IsShelleyBasedEra era => FromJSON (TxOut CtxTx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

parseJSON :: Value -> Parser (TxOut CtxTx era) #

parseJSONList :: Value -> Parser [TxOut CtxTx era] #

omittedField :: Maybe (TxOut CtxTx era) #

data CtxUTxO Source #

The context is the UTxO

Instances

Instances details
IsShelleyBasedEra era => FromJSON (TxOut CtxUTxO era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

parseJSON :: Value -> Parser (TxOut CtxUTxO era) #

parseJSONList :: Value -> Parser [TxOut CtxUTxO era] #

omittedField :: Maybe (TxOut CtxUTxO era) #

data TxOut ctx era Source #

Constructors

TxOut (AddressInEra era) (TxOutValue era) (TxOutDatum ctx era) (ReferenceScript era) 

Instances

Instances details
IsShelleyBasedEra era => FromJSON (TxOut CtxTx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

parseJSON :: Value -> Parser (TxOut CtxTx era) #

parseJSONList :: Value -> Parser [TxOut CtxTx era] #

omittedField :: Maybe (TxOut CtxTx era) #

IsShelleyBasedEra era => FromJSON (TxOut CtxUTxO era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

parseJSON :: Value -> Parser (TxOut CtxUTxO era) #

parseJSONList :: Value -> Parser [TxOut CtxUTxO era] #

omittedField :: Maybe (TxOut CtxUTxO era) #

IsCardanoEra era => ToJSON (TxOut ctx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

toJSON :: TxOut ctx era -> Value #

toEncoding :: TxOut ctx era -> Encoding #

toJSONList :: [TxOut ctx era] -> Value #

toEncodingList :: [TxOut ctx era] -> Encoding #

omitField :: TxOut ctx era -> Bool #

Show (TxOut ctx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

showsPrec :: Int -> TxOut ctx era -> ShowS Source #

show :: TxOut ctx era -> String Source #

showList :: [TxOut ctx era] -> ShowS Source #

Eq (TxOut ctx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: TxOut ctx era -> TxOut ctx era -> Bool Source #

(/=) :: TxOut ctx era -> TxOut ctx era -> Bool Source #

data TxOutValue era where Source #

Constructors

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

Instances details
IsShelleyBasedEra era => FromJSON (TxOutValue era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

parseJSON :: Value -> Parser (TxOutValue era) #

parseJSONList :: Value -> Parser [TxOutValue era] #

omittedField :: Maybe (TxOutValue era) #

IsCardanoEra era => ToJSON (TxOutValue era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

toJSON :: TxOutValue era -> Value #

toEncoding :: TxOutValue era -> Encoding #

toJSONList :: [TxOutValue era] -> Value #

toEncodingList :: [TxOutValue era] -> Encoding #

omitField :: TxOutValue era -> Bool #

Show (TxOutValue era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxOutValue era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: TxOutValue era -> TxOutValue era -> Bool Source #

(/=) :: TxOutValue era -> TxOutValue era -> Bool Source #

data TxOutDatum ctx era where Source #

Constructors

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

Instances details
Show (TxOutDatum ctx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

showsPrec :: Int -> TxOutDatum ctx era -> ShowS Source #

show :: TxOutDatum ctx era -> String Source #

showList :: [TxOutDatum ctx era] -> ShowS Source #

Eq (TxOutDatum ctx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: TxOutDatum ctx era -> TxOutDatum ctx era -> Bool Source #

(/=) :: TxOutDatum ctx era -> TxOutDatum ctx era -> Bool Source #

data TxOutInAnyEra where Source #

Constructors

TxOutInAnyEra :: forall era. CardanoEra era -> TxOut CtxTx era -> TxOutInAnyEra 

Instances

Instances details
Show TxOutInAnyEra Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq TxOutInAnyEra Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Pretty TxOutInAnyEra Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

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 #

Constructors

TxInsCollateralNone :: forall era. TxInsCollateral era 
TxInsCollateral :: forall era. AlonzoEraOnwards era -> [TxIn] -> TxInsCollateral era 

Instances

Instances details
Show (TxInsCollateral era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxInsCollateral era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

data TxInsReference era where Source #

Constructors

TxInsReferenceNone :: forall era. TxInsReference era 
TxInsReference :: forall era. BabbageEraOnwards era -> [TxIn] -> TxInsReference era 

Instances

Instances details
Show (TxInsReference era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxInsReference era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

data TxReturnCollateral ctx era where Source #

Constructors

TxReturnCollateralNone :: forall ctx era. TxReturnCollateral ctx era 
TxReturnCollateral :: forall era ctx. BabbageEraOnwards era -> TxOut ctx era -> TxReturnCollateral ctx era 

Instances

Instances details
Show (TxReturnCollateral ctx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxReturnCollateral ctx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

data TxTotalCollateral era where Source #

Constructors

TxTotalCollateralNone :: forall era. TxTotalCollateral era 
TxTotalCollateral :: forall era. BabbageEraOnwards era -> Coin -> TxTotalCollateral era 

Instances

Instances details
Show (TxTotalCollateral era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxTotalCollateral era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

data TxFee era where Source #

Constructors

TxFeeExplicit :: forall era. ShelleyBasedEra era -> Coin -> TxFee era 

Instances

Instances details
Show (TxFee era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

showsPrec :: Int -> TxFee era -> ShowS Source #

show :: TxFee era -> String Source #

showList :: [TxFee era] -> ShowS Source #

Eq (TxFee era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: TxFee era -> TxFee era -> Bool Source #

(/=) :: TxFee era -> TxFee era -> Bool Source #

data TxValidityUpperBound era where Source #

This was formerly known as the TTL.

Constructors

TxValidityUpperBound :: forall era. ShelleyBasedEra era -> Maybe SlotNo -> TxValidityUpperBound era 

data TxMetadataInEra era where Source #

Constructors

TxMetadataNone :: forall era. TxMetadataInEra era 
TxMetadataInEra :: forall era. ShelleyBasedEra era -> TxMetadata -> TxMetadataInEra era 

Instances

Instances details
Show (TxMetadataInEra era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxMetadataInEra era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

data TxAuxScripts era where Source #

Constructors

TxAuxScriptsNone :: forall era. TxAuxScripts era 
TxAuxScripts :: forall era. AllegraEraOnwards era -> [ScriptInEra era] -> TxAuxScripts era 

Instances

Instances details
Show (TxAuxScripts era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxAuxScripts era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

data TxWithdrawals build era where Source #

Constructors

TxWithdrawalsNone :: forall build era. TxWithdrawals build era 
TxWithdrawals :: forall era build. ShelleyBasedEra era -> [(StakeAddress, Coin, BuildTxWith build (Witness WitCtxStake era))] -> TxWithdrawals build era 

Instances

Instances details
Show (TxWithdrawals build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

showsPrec :: Int -> TxWithdrawals build era -> ShowS Source #

show :: TxWithdrawals build era -> String Source #

showList :: [TxWithdrawals build era] -> ShowS Source #

Eq (TxWithdrawals build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: TxWithdrawals build era -> TxWithdrawals build era -> Bool Source #

(/=) :: TxWithdrawals build era -> TxWithdrawals build era -> Bool Source #

data TxCertificates build era where Source #

Constructors

TxCertificatesNone :: forall build era. TxCertificates build era 
TxCertificates 

Fields

Instances

Instances details
Show (TxCertificates build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

showsPrec :: Int -> TxCertificates build era -> ShowS Source #

show :: TxCertificates build era -> String Source #

showList :: [TxCertificates build era] -> ShowS Source #

Eq (TxCertificates build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: TxCertificates build era -> TxCertificates build era -> Bool Source #

(/=) :: TxCertificates build era -> TxCertificates build era -> Bool Source #

data TxUpdateProposal era where Source #

Constructors

TxUpdateProposalNone :: forall era. TxUpdateProposal era 
TxUpdateProposal :: forall era. ShelleyToBabbageEra era -> UpdateProposal -> TxUpdateProposal era 

Instances

Instances details
Show (TxUpdateProposal era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxUpdateProposal era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

data TxMintValue build era where Source #

Constructors

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

Instances details
Show (TxMintValue build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

showsPrec :: Int -> TxMintValue build era -> ShowS Source #

show :: TxMintValue build era -> String Source #

showList :: [TxMintValue build era] -> ShowS Source #

Eq (TxMintValue build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: 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.

data TxVotingProcedures build era where Source #

Constructors

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

Instances details
Show (TxVotingProcedures build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxVotingProcedures build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: 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 #

Constructors

TxProposalProceduresNone :: forall build era. TxProposalProcedures build era 
TxProposalProcedures

Create Tx proposal procedures. Prefer mkTxProposalProcedures smart constructor to using this constructor directly.

Fields

Instances

Instances details
Show (TxProposalProcedures build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Eq (TxProposalProcedures build era) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: 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 #

Constructors

ViewTx :: forall a. BuildTxWith ViewTx a 
BuildTxWith :: forall a. a -> BuildTxWith BuildTx a 

Instances

Instances details
Applicative (BuildTxWith BuildTx) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Applicative (BuildTxWith ViewTx) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Functor (BuildTxWith build) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

fmap :: (a -> b) -> BuildTxWith build a -> BuildTxWith build b Source #

(<$) :: a -> BuildTxWith build b -> BuildTxWith build a Source #

Show a => Show (BuildTxWith build a) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

showsPrec :: Int -> BuildTxWith build a -> ShowS Source #

show :: BuildTxWith build a -> String Source #

showList :: [BuildTxWith build a] -> ShowS Source #

Eq a => Eq (BuildTxWith build a) Source # 
Instance details

Defined in Cardano.Api.Tx.Body

Methods

(==) :: BuildTxWith build a -> BuildTxWith build a -> Bool Source #

(/=) :: BuildTxWith build a -> BuildTxWith build a -> Bool Source #

Inspecting ScriptWitnesses

data AnyScriptWitness era where Source #

A ScriptWitness in any WitCtx. This lets us handle heterogeneous collections of script witnesses from multiple contexts.

Constructors

AnyScriptWitness :: forall witctx era. ScriptWitness witctx era -> AnyScriptWitness era 

Instances

Instances details
Show (AnyScriptWitness era) Source # 
Instance details

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.

Constructors

ScriptWitnessIndexTxIn !Word32

The n'th transaction input, in the order of the TxIds.

ScriptWitnessIndexMint !Word32

The n'th minting PolicyId, in the order of the PolicyIds.

ScriptWitnessIndexCertificate !Word32

The n'th certificate, in the list order of the certificates.

ScriptWitnessIndexWithdrawal !Word32

The n'th withdrawal, in the order of the StakeAddresss.

ScriptWitnessIndexVoting !Word32

The n'th vote, in the order of the votes.

ScriptWitnessIndexProposing !Word32

The n'th proposal, in the order of the proposals.

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

convScripts :: ShelleyLedgerEra era ~ ledgerera => [(ScriptWitnessIndex, AnyScriptWitness era)] -> [Script ledgerera] Source #

convTxOuts :: forall ctx era ledgerera. ShelleyLedgerEra era ~ ledgerera => ShelleyBasedEra era -> [TxOut ctx era] -> StrictSeq (TxOut ledgerera) Source #

convTxUpdateProposal Source #

Arguments

:: ShelleyBasedEra era 
-> TxUpdateProposal era 
-> Either TxBodyError (StrictMaybe (Update (ShelleyLedgerEra era)))

Left when there's protocol params conversion error, Right otherwise, 'Right SNothing' means that there's no update proposal

Convert transaction update proposal into ledger update proposal

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

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.

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

Misc helpers

orderTxIns :: [(TxIn, v)] -> [(TxIn, v)] Source #

Data family instances

data family AsType t Source #

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

Instances details
data AsType AddressAny Source # 
Instance details

Defined in Cardano.Api.Address

data AsType ByronAddr Source # 
Instance details

Defined in Cardano.Api.Address

data AsType ShelleyAddr Source # 
Instance details

Defined in Cardano.Api.Address

data AsType StakeAddress Source # 
Instance details

Defined in Cardano.Api.Address

data AsType BlockHeader Source # 
Instance details

Defined in Cardano.Api.Block

data AsType DRepMetadata Source # 
Instance details

Defined in Cardano.Api.DRepMetadata

data AsType AllegraEra Source # 
Instance details

Defined in Cardano.Api.Eras.Core

data AsType AlonzoEra Source # 
Instance details

Defined in Cardano.Api.Eras.Core

data AsType BabbageEra Source # 
Instance details

Defined in Cardano.Api.Eras.Core

data AsType ByronEra Source # 
Instance details

Defined in Cardano.Api.Eras.Core

data AsType ConwayEra Source # 
Instance details

Defined in Cardano.Api.Eras.Core

data AsType MaryEra Source # 
Instance details

Defined in Cardano.Api.Eras.Core

data AsType ShelleyEra Source # 
Instance details

Defined in Cardano.Api.Eras.Core

data AsType GovernancePoll Source # 
Instance details

Defined in Cardano.Api.Governance.Poll

data AsType GovernancePollAnswer Source # 
Instance details

Defined in Cardano.Api.Governance.Poll

data AsType ByronKey Source # 
Instance details

Defined in Cardano.Api.Keys.Byron

data AsType ByronKeyLegacy Source # 
Instance details

Defined in Cardano.Api.Keys.Byron

data AsType KesKey Source # 
Instance details

Defined in Cardano.Api.Keys.Praos

data AsType VrfKey Source # 
Instance details

Defined in Cardano.Api.Keys.Praos

data AsType CommitteeColdExtendedKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType CommitteeColdKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType CommitteeHotExtendedKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType CommitteeHotKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType DRepExtendedKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType DRepKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType GenesisDelegateExtendedKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType GenesisDelegateKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType GenesisExtendedKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType GenesisKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType GenesisUTxOKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType PaymentExtendedKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType PaymentKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType StakeExtendedKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType StakeKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType StakePoolKey Source # 
Instance details

Defined in Cardano.Api.Keys.Shelley

data AsType OperationalCertificate Source # 
Instance details

Defined in Cardano.Api.OperationalCertificate

data AsType OperationalCertificateIssueCounter Source # 
Instance details

Defined in Cardano.Api.OperationalCertificate

data AsType PraosNonce Source # 
Instance details

Defined in Cardano.Api.ProtocolParameters

data AsType UpdateProposal Source # 
Instance details

Defined in Cardano.Api.ProtocolParameters

data AsType PlutusScriptV1 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType PlutusScriptV2 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType PlutusScriptV3 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType ScriptHash Source # 
Instance details

Defined in Cardano.Api.Script

data AsType ScriptInAnyLang Source # 
Instance details

Defined in Cardano.Api.Script

data AsType SimpleScript' Source # 
Instance details

Defined in Cardano.Api.Script

data AsType HashableScriptData Source # 
Instance details

Defined in Cardano.Api.ScriptData

data AsType ScriptData Source # 
Instance details

Defined in Cardano.Api.ScriptData

data AsType TextEnvelope Source # 
Instance details

Defined in Cardano.Api.SerialiseTextEnvelope

data AsType ByronUpdateProposal Source # 
Instance details

Defined in Cardano.Api.SpecialByron

data AsType ByronVote Source # 
Instance details

Defined in Cardano.Api.SpecialByron

data AsType StakePoolMetadata Source # 
Instance details

Defined in Cardano.Api.StakePoolMetadata

data AsType TxId Source # 
Instance details

Defined in Cardano.Api.TxIn

data AsType TxMetadata Source # 
Instance details

Defined in Cardano.Api.TxMetadata

data AsType AssetName Source # 
Instance details

Defined in Cardano.Api.Value

data AsType PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

data AsType (Address addrtype) Source # 
Instance details

Defined in Cardano.Api.Address

data AsType (Address addrtype) = AsAddress (AsType addrtype)
data AsType (AddressInEra era) Source # 
Instance details

Defined in Cardano.Api.Address

data AsType (Certificate era) Source # 
Instance details

Defined in Cardano.Api.Certificate

data AsType (Proposal era) Source # 
Instance details

Defined in Cardano.Api.Governance.Actions.ProposalProcedure

data AsType (VotingProcedure era) Source # 
Instance details

Defined in Cardano.Api.Governance.Actions.VotingProcedure

data AsType (VotingProcedures era) Source # 
Instance details

Defined in Cardano.Api.Governance.Actions.VotingProcedure

data AsType (Hash a) Source # 
Instance details

Defined in Cardano.Api.Hash

data AsType (Hash a) = AsHash (AsType a)
data AsType (SigningKey a) Source # 
Instance details

Defined in Cardano.Api.Keys.Class

data AsType (VerificationKey a) Source # 
Instance details

Defined in Cardano.Api.Keys.Class

data AsType (PlutusScript lang) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (Script lang) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (Script lang) = AsScript (AsType lang)
data AsType (ScriptInEra era) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (KeyWitness era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

data AsType (Tx era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

data AsType (Tx era) = AsTx (AsType era)
data AsType (TxBody era) Source # 
Instance details

Defined in Cardano.Api.Tx.Sign

data AsType (TxBody era) = AsTxBody (AsType era)