plutus-ledger-1.1.0.0: Wallet API
Safe HaskellNone
LanguageHaskell2010

Ledger.Tx

Synopsis

Documentation

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

pubKeyHashTxOut :: Value -> PubKeyHash -> TxOut Source #

Create a transaction output locked by a public key.

isPayToScriptOut :: TxOut -> Bool Source #

Whether the output is a pay-to-script output.

isPubKeyOut :: TxOut -> Bool Source #

Whether the output is a pay-to-pubkey output.

txOutDatum :: TxOut -> Maybe DatumHash Source #

The datum attached to a TxOut, if there is one.

newtype TxId Source #

A transaction ID, using a SHA256 hash as the transaction id.

Constructors

TxId 

Instances

Instances details
Eq TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

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

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

Ord TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

IsString TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Associated Types

type Rep TxId :: Type -> Type Source #

Methods

from :: TxId -> Rep TxId x Source #

to :: Rep TxId x -> TxId Source #

NFData TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: TxId -> () Source #

ToJSON TxId Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

ToJSONKey TxId Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

FromJSON TxId Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

FromJSONKey TxId Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

ByteArrayAccess TxId Source #

ByteArrayAccess instance for signing support

Instance details

Defined in Ledger.Orphans

Methods

length :: TxId -> Int Source #

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

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

ToSchema TxId Source # 
Instance details

Defined in Ledger.Orphans

Pretty TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

pretty :: TxId -> Doc ann Source #

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

Serialise TxId Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

UnsafeFromData TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

FromData TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

ToData TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Ord TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Eq TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

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

Lift DefaultUni TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

Typeable DefaultUni TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

type Rep TxId 
Instance details

Defined in Plutus.V1.Ledger.Tx

type Rep TxId = D1 ('MetaData "TxId" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-EUjexvcAhXiGIaLon6olWb" 'True) (C1 ('MetaCons "TxId" 'PrefixI 'True) (S1 ('MetaSel ('Just "getTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinByteString)))

data ScriptTag Source #

A tag indicating the type of script that we are pointing to.

Constructors

Spend 
Mint 
Cert 
Reward 

Instances

Instances details
Eq ScriptTag 
Instance details

Defined in Plutus.V1.Ledger.Tx

Ord ScriptTag 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show ScriptTag 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic ScriptTag 
Instance details

Defined in Plutus.V1.Ledger.Tx

Associated Types

type Rep ScriptTag :: Type -> Type Source #

NFData ScriptTag 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: ScriptTag -> () Source #

ToJSON ScriptTag Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

FromJSON ScriptTag Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

ToSchema ScriptTag Source # 
Instance details

Defined in Ledger.Orphans

Serialise ScriptTag Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

type Rep ScriptTag 
Instance details

Defined in Plutus.V1.Ledger.Tx

type Rep ScriptTag = D1 ('MetaData "ScriptTag" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-EUjexvcAhXiGIaLon6olWb" 'False) ((C1 ('MetaCons "Spend" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Mint" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Cert" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Reward" 'PrefixI 'False) (U1 :: Type -> Type)))

data RedeemerPtr Source #

A redeemer pointer is a pair of a script type tag t and an index i, picking out the ith script of type t in the transaction.

Instances

Instances details
Eq RedeemerPtr 
Instance details

Defined in Plutus.V1.Ledger.Tx

Ord RedeemerPtr 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show RedeemerPtr 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic RedeemerPtr 
Instance details

Defined in Plutus.V1.Ledger.Tx

Associated Types

type Rep RedeemerPtr :: Type -> Type Source #

NFData RedeemerPtr 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: RedeemerPtr -> () Source #

ToJSON RedeemerPtr Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

ToJSONKey RedeemerPtr Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

FromJSON RedeemerPtr Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

FromJSONKey RedeemerPtr Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

ToSchema RedeemerPtr Source # 
Instance details

Defined in Ledger.Orphans

Serialise RedeemerPtr Source # 
Instance details

Defined in Ledger.Tx.Orphans.V1

type Rep RedeemerPtr 
Instance details

Defined in Plutus.V1.Ledger.Tx

type Rep RedeemerPtr = D1 ('MetaData "RedeemerPtr" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-EUjexvcAhXiGIaLon6olWb" 'False) (C1 ('MetaCons "RedeemerPtr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ScriptTag) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

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

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

DecoratedTxOut

data DecoratedTxOut Source #

Offchain view of a transaction output.

Constructors

PublicKeyDecoratedTxOut 

Fields

ScriptDecoratedTxOut 

Fields

Instances

Instances details
Eq DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

Show DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

Generic DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

Associated Types

type Rep DecoratedTxOut :: Type -> Type Source #

NFData DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

Methods

rnf :: DecoratedTxOut -> () Source #

ToJSON DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

FromJSON DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

ToSchema DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

Pretty DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

Serialise DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

type Rep DecoratedTxOut Source # 
Instance details

Defined in Ledger.Tx

type Rep DecoratedTxOut = D1 ('MetaData "DecoratedTxOut" "Ledger.Tx" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "PublicKeyDecoratedTxOut" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_decoratedTxOutPubKeyHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PubKeyHash) :*: S1 ('MetaSel ('Just "_decoratedTxOutStakingCredential") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe StakingCredential))) :*: (S1 ('MetaSel ('Just "_decoratedTxOutValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value) :*: (S1 ('MetaSel ('Just "_decoratedTxOutPubKeyDatum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (DatumHash, DatumFromQuery))) :*: S1 ('MetaSel ('Just "_decoratedTxOutReferenceScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Versioned Script)))))) :+: C1 ('MetaCons "ScriptDecoratedTxOut" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_decoratedTxOutValidatorHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ValidatorHash) :*: (S1 ('MetaSel ('Just "_decoratedTxOutStakingCredential") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe StakingCredential)) :*: S1 ('MetaSel ('Just "_decoratedTxOutValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value))) :*: (S1 ('MetaSel ('Just "_decoratedTxOutScriptDatum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (DatumHash, DatumFromQuery)) :*: (S1 ('MetaSel ('Just "_decoratedTxOutReferenceScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Versioned Script))) :*: S1 ('MetaSel ('Just "_decoratedTxOutValidator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Versioned Validator)))))))

toTxInfoTxOut :: DecoratedTxOut -> TxOut Source #

Converts a transaction output from the chain index to the plutus-ledger-api transaction output.

Note that DecoratedTxOut supports features such inline datums and reference scripts which are not supported by V1 TxOut. Converting from DecoratedTxOut to TxOut and back is therefore lossy.

Lenses and Prisms

smart Constructors

DatumFromQuery

data DatumFromQuery Source #

A datum in a transaction output that comes from a chain index query.

Instances

Instances details
Eq DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

Show DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

Generic DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

Associated Types

type Rep DatumFromQuery :: Type -> Type Source #

NFData DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

Methods

rnf :: DatumFromQuery -> () Source #

ToJSON DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

FromJSON DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

ToSchema DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

Serialise DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

type Rep DatumFromQuery Source # 
Instance details

Defined in Ledger.Tx

type Rep DatumFromQuery = D1 ('MetaData "DatumFromQuery" "Ledger.Tx" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "DatumUnknown" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DatumInline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Datum)) :+: C1 ('MetaCons "DatumInBody" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Datum))))

Transactions

data CardanoTx Source #

Instances

Instances details
Eq CardanoTx Source # 
Instance details

Defined in Ledger.Tx

Show CardanoTx Source # 
Instance details

Defined in Ledger.Tx

Generic CardanoTx Source # 
Instance details

Defined in Ledger.Tx

Associated Types

type Rep CardanoTx :: Type -> Type Source #

ToJSON CardanoTx Source # 
Instance details

Defined in Ledger.Tx

FromJSON CardanoTx Source # 
Instance details

Defined in Ledger.Tx

ToSchema CardanoTx Source # 
Instance details

Defined in Ledger.Tx

Pretty CardanoTx Source # 
Instance details

Defined in Ledger.Tx

Methods

pretty :: CardanoTx -> Doc ann Source #

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

Serialise CardanoTx Source # 
Instance details

Defined in Ledger.Tx

type Rep CardanoTx Source # 
Instance details

Defined in Ledger.Tx

type Rep CardanoTx = D1 ('MetaData "CardanoTx" "Ledger.Tx" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (C1 ('MetaCons "EmulatorTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "_emulatorTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tx)) :+: C1 ('MetaCons "CardanoApiTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "_cardanoApiTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SomeCardanoApiTx)))

onCardanoTx :: (Tx -> r) -> (SomeCardanoApiTx -> r) -> CardanoTx -> r Source #

data SomeCardanoApiTx where Source #

Cardano tx from any era.

Constructors

SomeTx :: IsCardanoEra era => Tx era -> EraInMode era CardanoMode -> SomeCardanoApiTx 

Bundled Patterns

pattern CardanoApiEmulatorEraTx :: Tx BabbageEra -> SomeCardanoApiTx 

Instances

Instances details
Eq SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

Show SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

ToJSON SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

FromJSON SomeCardanoApiTx Source #

Converting SomeCardanoApiTx to JSON.

If the "tx" field is from an unknown era, the JSON parser will print an error at runtime while parsing.

Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

ToSchema SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

Pretty SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx

Serialise SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

data ToCardanoError Source #

Instances

Instances details
Eq ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

Show ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

Generic ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

Associated Types

type Rep ToCardanoError :: Type -> Type Source #

ToJSON ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

FromJSON ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

Pretty ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

type Rep ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI.Internal

type Rep ToCardanoError = D1 ('MetaData "ToCardanoError" "Ledger.Tx.CardanoAPI.Internal" "plutus-ledger-1.1.0.0-JskZbcPMCdRJVHaAZ0to82" 'False) (((C1 ('MetaCons "TxBodyError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: (C1 ('MetaCons "DeserialisationError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InvalidValidityRange" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ValueNotPureAda" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OutputHasZeroAda" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "StakingPointersNotSupported" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SimpleScriptsNotSupportedToCardano" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "MissingInputValidator" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MissingDatum" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MissingMintingPolicy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ScriptPurposeNotSupported" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ScriptTag)))) :+: ((C1 ('MetaCons "MissingMintingPolicyRedeemer" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MissingStakeValidator" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "UnsupportedPlutusVersion" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Language)) :+: C1 ('MetaCons "Tag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ToCardanoError))))))

addSignature :: PrivateKey -> Passphrase -> Tx -> Tx Source #

Sign the transaction with a PrivateKey and passphrase (ByteString) and add the signature to the transaction's list of signatures.

addSignature' :: PrivateKey -> Tx -> Tx Source #

Sign the transaction with a PrivateKey that has no passphrase and add the signature to the transaction's list of signatures

pubKeyTxOut :: Value -> PaymentPubKey -> Maybe StakingCredential -> Either ToCardanoError TxOut Source #

Create a transaction output locked by a public payment key and optionnaly a public stake key.

updateUtxo :: CardanoTx -> Map TxOutRef TxOut -> Map TxOutRef TxOut Source #

Update a map of unspent transaction outputs and signatures based on the inputs and outputs of a transaction.

updateUtxoCollateral :: CardanoTx -> Map TxOutRef TxOut -> Map TxOutRef TxOut Source #

Update a map of unspent transaction outputs and signatures based on the collateral inputs of a transaction (for when it is invalid).

txOutRefs :: Tx -> [(TxOut, TxOutRef)] Source #

A list of a transaction's outputs paired with a TxOutRefs referring to them.

unspentOutputsTx :: Tx -> Map TxOutRef TxOut Source #

The unspent outputs of a transaction.

TxBodyContent functions

Hashing transactions

txId :: Tx -> TxId Source #

Compute the id of a transaction.

Orphan instances

Pretty SomeCardanoApiTx Source # 
Instance details

Pretty CardanoBuildTx Source # 
Instance details

Pretty Tx Source # 
Instance details

Methods

pretty :: Tx -> Doc ann Source #

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