plutus-ledger-1.1.0.0: Wallet API
Safe HaskellNone
LanguageHaskell2010

Ledger.Tx.Internal

Synopsis

Documentation

data TxOutTx Source #

A TxOut along with the Tx it comes from, which may have additional information e.g. the full data script that goes with the TxOut.

Constructors

TxOutTx 

Fields

Instances

Instances details
Eq TxOutTx Source # 
Instance details

Defined in Ledger.Tx.Internal

Show TxOutTx Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic TxOutTx Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep TxOutTx :: Type -> Type Source #

ToJSON TxOutTx Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON TxOutTx Source # 
Instance details

Defined in Ledger.Tx.Internal

Serialise TxOutTx Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxOutTx Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxOutTx = D1 ('MetaData "TxOutTx" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "TxOutTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "txOutTxTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tx) :*: S1 ('MetaSel ('Just "txOutTxOut") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxOut)))

data TxStripped Source #

A babbage era transaction without witnesses for its inputs.

Constructors

TxStripped 

Fields

Instances

Instances details
Eq TxStripped Source # 
Instance details

Defined in Ledger.Tx.Internal

Show TxStripped Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic TxStripped Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep TxStripped :: Type -> Type Source #

Serialise TxStripped Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxStripped Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxStripped = D1 ('MetaData "TxStripped" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "TxStripped" 'PrefixI 'True) ((S1 ('MetaSel ('Just "txStrippedInputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxOutRef]) :*: S1 ('MetaSel ('Just "txStrippedReferenceInputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxOutRef])) :*: (S1 ('MetaSel ('Just "txStrippedOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxOut]) :*: (S1 ('MetaSel ('Just "txStrippedMint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Value) :*: S1 ('MetaSel ('Just "txStrippedFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Value)))))

data Tx Source #

A Babbage-era transaction, including witnesses for its inputs.

Constructors

Tx 

Fields

Instances

Instances details
Eq Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

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

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

Show Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep Tx :: Type -> Type Source #

Methods

from :: Tx -> Rep Tx x Source #

to :: Rep Tx x -> Tx Source #

Semigroup Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

(<>) :: Tx -> Tx -> Tx Source #

sconcat :: NonEmpty Tx -> Tx Source #

stimes :: Integral b => b -> Tx -> Tx Source #

Monoid Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

mempty :: Tx Source #

mappend :: Tx -> Tx -> Tx Source #

mconcat :: [Tx] -> Tx Source #

NFData Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: Tx -> () Source #

ToJSON Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

ByteArrayAccess Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

length :: Tx -> Int Source #

withByteArray :: Tx -> (Ptr p -> IO a) -> IO a Source #

copyByteArrayToPtr :: Tx -> Ptr p -> IO () Source #

ToSchema Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

Pretty Tx Source # 
Instance details

Defined in Ledger.Tx

Methods

pretty :: Tx -> Doc ann Source #

prettyList :: [Tx] -> Doc ann Source #

Serialise Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep Tx Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep Tx = D1 ('MetaData "Tx" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "Tx" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "txInputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxInput]) :*: S1 ('MetaSel ('Just "txReferenceInputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxInput])) :*: (S1 ('MetaSel ('Just "txCollateralInputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxInput]) :*: S1 ('MetaSel ('Just "txOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxOut]))) :*: ((S1 ('MetaSel ('Just "txReturnCollateral") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe TxOut)) :*: S1 ('MetaSel ('Just "txTotalCollateral") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value))) :*: (S1 ('MetaSel ('Just "txMint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Value) :*: S1 ('MetaSel ('Just "txFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Value)))) :*: (((S1 ('MetaSel ('Just "txValidRange") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotRange) :*: S1 ('MetaSel ('Just "txMintingWitnesses") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MintingWitnessesMap)) :*: (S1 ('MetaSel ('Just "txWithdrawals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Withdrawal]) :*: S1 ('MetaSel ('Just "txCertificates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Certificate]))) :*: ((S1 ('MetaSel ('Just "txSignatures") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map PubKey Signature)) :*: S1 ('MetaSel ('Just "txScripts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ScriptsMap)) :*: (S1 ('MetaSel ('Just "txData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map DatumHash Datum)) :*: S1 ('MetaSel ('Just "txMetadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe BuiltinByteString)))))))

newtype TxOut Source #

Validator, redeemer, and data scripts of a transaction input that spends a "pay to script" output. inScripts :: Tx -> TxInput -> Maybe (LedgerPlutusVersion, Validator, Redeemer, Datum) inScripts tx i@TxInput{txInputType=TxConsumeScriptAddress pv _ _ _} = case txInType $ fillTxInputWitnesses tx i of Just (ConsumeScriptAddress v r d) -> Just (pv, v, r, d) _ -> Nothing inScripts _ _ = Nothing

Constructors

TxOut 

Instances

Instances details
Eq TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

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

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

Show TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep TxOut :: Type -> Type Source #

Methods

from :: TxOut -> Rep TxOut x Source #

to :: Rep TxOut x -> TxOut Source #

NFData TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: TxOut -> () Source #

ToJSON TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

FromCBOR TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

ToCBOR TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

toCBOR :: TxOut -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy TxOut -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [TxOut] -> Size Source #

ToSchema TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Pretty TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

pretty :: TxOut -> Doc ann Source #

prettyList :: [TxOut] -> Doc ann Source #

Serialise TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxOut = D1 ('MetaData "TxOut" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'True) (C1 ('MetaCons "TxOut" 'PrefixI 'True) (S1 ('MetaSel ('Just "getTxOut") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxOut CtxTx BabbageEra))))

data Certificate Source #

Constructors

Certificate 

Fields

Instances

Instances details
Eq Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

Show Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep Certificate :: Type -> Type Source #

NFData Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: Certificate -> () Source #

ToJSON Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

ToSchema Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

Pretty Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

Serialise Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep Certificate Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep Certificate = D1 ('MetaData "Certificate" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "Certificate" 'PrefixI 'True) (S1 ('MetaSel ('Just "certificateDcert") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DCert) :*: S1 ('MetaSel ('Just "certificateRedeemer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Redeemer))))

data Withdrawal Source #

Stake withdrawal, if applicable the script should be included in txScripts.

Constructors

Withdrawal 

Fields

Instances

Instances details
Eq Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

Show Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep Withdrawal :: Type -> Type Source #

NFData Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: Withdrawal -> () Source #

ToJSON Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

ToSchema Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

Pretty Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

Serialise Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep Withdrawal Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep Withdrawal = D1 ('MetaData "Withdrawal" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "Withdrawal" 'PrefixI 'True) (S1 ('MetaSel ('Just "withdrawalCredential") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Credential) :*: (S1 ('MetaSel ('Just "withdrawalAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "withdrawalRedeemer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Redeemer)))))

data TxInput Source #

A transaction input, consisting of a transaction output reference and an input type. Differs with TxIn by: TxIn *maybe* contains *full* data witnesses, TxInput always contains redeemer witness, but datum/validator hashes.

Constructors

TxInput 

Instances

Instances details
Eq TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

Ord TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

Show TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep TxInput :: Type -> Type Source #

NFData TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: TxInput -> () Source #

ToJSON TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

ToSchema TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

Pretty TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

pretty :: TxInput -> Doc ann Source #

prettyList :: [TxInput] -> Doc ann Source #

Serialise TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxInput Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxInput = D1 ('MetaData "TxInput" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "TxInput" 'PrefixI 'True) (S1 ('MetaSel ('Just "txInputRef") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxOutRef) :*: S1 ('MetaSel ('Just "txInputType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxInputType)))

data TxInputType Source #

The type of a transaction input with hashes.

Constructors

TxScriptAddress !Redeemer !(Either ValidatorHash (Versioned TxOutRef)) !(Maybe DatumHash)

A transaction input that consumes (with a validator hash) or references (with a txOutRef) a script address with the given the redeemer and datum hash.

TxConsumePublicKeyAddress

A transaction input that consumes a public key address.

TxConsumeSimpleScriptAddress

Consume a simple script

Instances

Instances details
Eq TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

Ord TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

Show TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep TxInputType :: Type -> Type Source #

NFData TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: TxInputType -> () Source #

ToJSON TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

ToSchema TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

Serialise TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxInputType Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxInputType = D1 ('MetaData "TxInputType" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "TxScriptAddress" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Redeemer) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Either ValidatorHash (Versioned TxOutRef))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe DatumHash)))) :+: (C1 ('MetaCons "TxConsumePublicKeyAddress" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TxConsumeSimpleScriptAddress" 'PrefixI 'False) (U1 :: Type -> Type)))

data TxIn Source #

A transaction input, consisting of a transaction output reference and an input type.

Constructors

TxIn 

Instances

Instances details
Eq TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

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

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

Ord TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

Show TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep TxIn :: Type -> Type Source #

Methods

from :: TxIn -> Rep TxIn x Source #

to :: Rep TxIn x -> TxIn Source #

NFData TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: TxIn -> () Source #

ToJSON TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

ToSchema TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

Pretty TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

pretty :: TxIn -> Doc ann Source #

prettyList :: [TxIn] -> Doc ann Source #

Serialise TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxIn Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxIn = D1 ('MetaData "TxIn" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "TxIn" 'PrefixI 'True) (S1 ('MetaSel ('Just "txInRef") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxOutRef) :*: S1 ('MetaSel ('Just "txInType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe TxInType))))

data TxInType Source #

The type of a transaction input.

Constructors

ScriptAddress !(Either (Versioned Validator) (Versioned TxOutRef)) !Redeemer !(Maybe Datum)

A transaction input that consumes (with a validator) or references (with a txOutRef) a script address with the given the redeemer and datum. Datum is optional if the input refers to a script output which contains an inline datum

ConsumePublicKeyAddress

A transaction input that consumes a public key address.

ConsumeSimpleScriptAddress

Consume a simple script

Instances

Instances details
Eq TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

Ord TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

Show TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep TxInType :: Type -> Type Source #

NFData TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: TxInType -> () Source #

ToJSON TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

ToSchema TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

Serialise TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxInType Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxInType = D1 ('MetaData "TxInType" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "ScriptAddress" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Either (Versioned Validator) (Versioned TxOutRef))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Redeemer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Datum)))) :+: (C1 ('MetaCons "ConsumePublicKeyAddress" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ConsumeSimpleScriptAddress" 'PrefixI 'False) (U1 :: Type -> Type)))

pubKeyTxIn :: TxOutRef -> TxIn Source #

A transaction input that spends a "pay to public key" output, given the witness.

scriptTxIn :: TxOutRef -> Versioned Validator -> Redeemer -> Maybe Datum -> TxIn Source #

A transaction input that spends a "pay to script" output, given witnesses. Datum is optional if the input refers to a script output which contains an inline datum

inputRef :: Lens' TxInput TxOutRef Source #

The TxOutRef spent by a transaction input.

inputType :: Lens' TxInput TxInputType Source #

The type of a transaction input.

inScripts :: TxIn -> Maybe (Versioned Validator, Redeemer, Maybe Datum) Source #

Validator, redeemer, and data scripts of a transaction input that spends a "pay to script" output.

inRef :: Lens' TxInput TxOutRef Source #

The TxOutRef spent by a transaction input.

inType :: Lens' TxInput TxInputType Source #

The type of a transaction input.

pubKeyTxInputs :: Fold [TxInput] TxInput Source #

Filter to get only the pubkey inputs.

scriptTxInputs :: Fold [TxInput] TxInput Source #

Filter to get only the scripts that consume or reference a script address

referenceScriptTxInputs :: Fold [TxInput] TxInput Source #

Filter to get only the scripts that reference a script address

inputs :: Lens' Tx [TxInput] Source #

The inputs of a transaction.

referenceInputs :: Lens' Tx [TxInput] Source #

The reference inputs of a transaction.

collateralInputs :: Lens' Tx [TxInput] Source #

The collateral inputs of a transaction for paying fees when validating the transaction fails.

outputs :: Lens' Tx [TxOut] Source #

The outputs of a transaction.

validRange :: Lens' Tx SlotRange Source #

The validity range of a transaction.

metadata :: Lens' Tx (Maybe BuiltinByteString) Source #

The inputs of a transaction.

validValuesTx :: Tx -> Bool Source #

Check that all values in a transaction are non-negative.

txOutDatumHash :: TxOut -> Maybe DatumHash Source #

Get a hash from the stored TxOutDatum (either dirctly or by hashing the inlined datum)

spentOutputs :: Tx -> [TxOutRef] Source #

The transaction output references consumed by a transaction.

referencedOutputs :: Tx -> [TxOutRef] Source #

The transaction output references referenced by a transaction.

fillTxInputWitnesses :: Tx -> TxInput -> TxIn Source #

Translate TxInput to old Plutus.V1.Ledger.Api TxIn taking script and datum witnesses from Tx.

addMintingPolicy :: Versioned MintingPolicy -> (Redeemer, Maybe (Versioned TxOutRef)) -> Tx -> Tx Source #

Add minting policy together with the redeemer into txMintingWitnesses and txScripts accordingly. Doesn't alter txMint.

addScriptTxInput :: TxOutRef -> Versioned Validator -> Redeemer -> Maybe Datum -> Tx -> Tx Source #

Add validator together with the redeemer and datum into txInputs, txData and txScripts accordingly. Datum is optional if the input refers to a script output which contains an inline datum

addReferenceTxInput :: TxOutRef -> Versioned TxOutRef -> Redeemer -> Maybe Datum -> Tx -> Tx Source #

Add script reference together with the redeemer and datum into txInputs and txData accordingly. Datum is optional if the input refers to a script output which contains an inline datum

data Language Source #

Non-Native Script language. This is an Enumerated type. This is expected to be an open type. We will add new Constuctors to this type as additional Non-Native scripting language as are added. We use an enumerated type for two reasons. 1) We can write total functions by case analysis over the constructors 2) We will use DataKinds to make some datatypes indexed by Language For now, the only Non-Native Scriting language is Plutus We might add new languages in the futures.

Note that the the serialization of Language depends on the ordering.

Constructors

PlutusV1 
PlutusV2 

Instances

Instances details
Bounded Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Enum Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Eq Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Ord Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Show Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Ix Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Generic Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Associated Types

type Rep Language :: Type -> Type Source #

NFData Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Methods

rnf :: Language -> () Source #

FromCBOR Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

ToCBOR Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

Methods

toCBOR :: Language -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy Language -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Language] -> Size Source #

NoThunks Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

ToSchema Language Source # 
Instance details

Defined in Ledger.Orphans

type Rep Language 
Instance details

Defined in Cardano.Ledger.Alonzo.Language

type Rep Language = D1 ('MetaData "Language" "Cardano.Ledger.Alonzo.Language" "cardano-ledger-alonzo-0.1.0.0-NThdmINrvW30AlLdZjZ0g" 'False) (C1 ('MetaCons "PlutusV1" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PlutusV2" 'PrefixI 'False) (U1 :: Type -> Type))

newtype TxOut Source #

Validator, redeemer, and data scripts of a transaction input that spends a "pay to script" output. inScripts :: Tx -> TxInput -> Maybe (LedgerPlutusVersion, Validator, Redeemer, Datum) inScripts tx i@TxInput{txInputType=TxConsumeScriptAddress pv _ _ _} = case txInType $ fillTxInputWitnesses tx i of Just (ConsumeScriptAddress v r d) -> Just (pv, v, r, d) _ -> Nothing inScripts _ _ = Nothing

Constructors

TxOut 

Instances

Instances details
Eq TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

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

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

Show TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Generic TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Associated Types

type Rep TxOut :: Type -> Type Source #

Methods

from :: TxOut -> Rep TxOut x Source #

to :: Rep TxOut x -> TxOut Source #

NFData TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

rnf :: TxOut -> () Source #

ToJSON TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

FromJSON TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

FromCBOR TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

ToCBOR TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

toCBOR :: TxOut -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy TxOut -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [TxOut] -> Size Source #

ToSchema TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Pretty TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

Methods

pretty :: TxOut -> Doc ann Source #

prettyList :: [TxOut] -> Doc ann Source #

Serialise TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxOut Source # 
Instance details

Defined in Ledger.Tx.Internal

type Rep TxOut = D1 ('MetaData "TxOut" "Ledger.Tx.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'True) (C1 ('MetaCons "TxOut" 'PrefixI 'True) (S1 ('MetaSel ('Just "getTxOut") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxOut CtxTx BabbageEra))))

data TxOutRef Source #

A reference to a transaction output. This is a pair of a transaction reference, and an index indicating which of the outputs of that transaction we are referring to.

Constructors

TxOutRef 

Fields

Instances

Instances details
Eq TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Ord TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Associated Types

type Rep TxOutRef :: Type -> Type Source #

NFData TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: TxOutRef -> () Source #

ToJSON TxOutRef Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

ToJSONKey TxOutRef Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

FromJSON TxOutRef Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

FromJSONKey TxOutRef Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

ToSchema TxOutRef Source # 
Instance details

Defined in Ledger.Orphans

Pretty TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

pretty :: TxOutRef -> Doc ann Source #

prettyList :: [TxOutRef] -> Doc ann Source #

Serialise TxOutRef Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

UnsafeFromData TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

FromData TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

ToData TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Eq TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

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

Lift DefaultUni TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

Typeable DefaultUni TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

type Rep TxOutRef 
Instance details

Defined in Plutus.V1.Ledger.Tx

type Rep TxOutRef = D1 ('MetaData "TxOutRef" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-EUjexvcAhXiGIaLon6olWb" 'False) (C1 ('MetaCons "TxOutRef" 'PrefixI 'True) (S1 ('MetaSel ('Just "txOutRefId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxId) :*: S1 ('MetaSel ('Just "txOutRefIdx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

data Versioned script Source #

A script of some kind with its Plutus language version

Constructors

Versioned 

Fields

Instances

Instances details
Functor Versioned 
Instance details

Defined in Plutus.Script.Utils.Scripts

Methods

fmap :: (a -> b) -> Versioned a -> Versioned b Source #

(<$) :: a -> Versioned b -> Versioned a Source #

Eq script => Eq (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

Methods

(==) :: Versioned script -> Versioned script -> Bool Source #

(/=) :: Versioned script -> Versioned script -> Bool Source #

Ord script => Ord (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

Methods

compare :: Versioned script -> Versioned script -> Ordering Source #

(<) :: Versioned script -> Versioned script -> Bool Source #

(<=) :: Versioned script -> Versioned script -> Bool Source #

(>) :: Versioned script -> Versioned script -> Bool Source #

(>=) :: Versioned script -> Versioned script -> Bool Source #

max :: Versioned script -> Versioned script -> Versioned script Source #

min :: Versioned script -> Versioned script -> Versioned script Source #

Show script => Show (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

Methods

showsPrec :: Int -> Versioned script -> ShowS Source #

show :: Versioned script -> String Source #

showList :: [Versioned script] -> ShowS Source #

Generic (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

Associated Types

type Rep (Versioned script) :: Type -> Type Source #

Methods

from :: Versioned script -> Rep (Versioned script) x Source #

to :: Rep (Versioned script) x -> Versioned script Source #

NFData script => NFData (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

Methods

rnf :: Versioned script -> () Source #

ToJSON script => ToJSON (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

FromJSON script => FromJSON (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

ToSchema script => ToSchema (Versioned script) Source # 
Instance details

Defined in Ledger.Orphans

Pretty script => Pretty (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

Methods

pretty :: Versioned script -> Doc ann Source #

prettyList :: [Versioned script] -> Doc ann Source #

Serialise script => Serialise (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

type Rep (Versioned script) 
Instance details

Defined in Plutus.Script.Utils.Scripts

type Rep (Versioned script) = D1 ('MetaData "Versioned" "Plutus.Script.Utils.Scripts" "plutus-script-utils-1.1.0.0-IFwyzE6CIQ44doxQRh05YH" 'False) (C1 ('MetaCons "Versioned" 'PrefixI 'True) (S1 ('MetaSel ('Just "unversioned") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 script) :*: S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Language)))