plutus-ledger-api-1.0.0.1: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellNone
LanguageHaskell2010

Plutus.V2.Ledger.Tx

Synopsis

Transactions

newtype TxId Source #

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

Constructors

TxId 

Instances

Instances details
Eq TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

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

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

Ord TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

IsString TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic TxId Source # 
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 Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: TxId -> () Source #

Pretty TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

pretty :: TxId -> Doc ann

prettyList :: [TxId] -> Doc ann

FromData TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

ToData TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

UnsafeFromData TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Eq TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

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

Ord TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

compare :: TxId -> TxId -> Ordering

(<) :: TxId -> TxId -> Bool

(<=) :: TxId -> TxId -> Bool

(>) :: TxId -> TxId -> Bool

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

max :: TxId -> TxId -> TxId

min :: TxId -> TxId -> TxId

Lift DefaultUni TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

lift :: TxId -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni TxId Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

typeRep :: Proxy TxId -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep TxId Source # 
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-6EvbyJiK8IAAVEtnIJDu5Z" '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 Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Ord ScriptTag Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show ScriptTag Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic ScriptTag Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Associated Types

type Rep ScriptTag :: Type -> Type Source #

NFData ScriptTag Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: ScriptTag -> () Source #

type Rep ScriptTag Source # 
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-6EvbyJiK8IAAVEtnIJDu5Z" '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 Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Ord RedeemerPtr Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show RedeemerPtr Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic RedeemerPtr Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Associated Types

type Rep RedeemerPtr :: Type -> Type Source #

NFData RedeemerPtr Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: RedeemerPtr -> () Source #

type Rep RedeemerPtr Source # 
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-6EvbyJiK8IAAVEtnIJDu5Z" '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)))

Transaction outputs

data TxOut Source #

A transaction output, consisting of a target address, a value, optionally a datum/datum hash, and optionally a reference script.

Instances

Instances details
Eq TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

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

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

Show TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Generic TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

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 Plutus.V2.Ledger.Tx

Methods

rnf :: TxOut -> () Source #

Pretty TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

pretty :: TxOut -> Doc ann

prettyList :: [TxOut] -> Doc ann

FromData TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

ToData TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

UnsafeFromData TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Eq TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

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

Lift DefaultUni TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

lift :: TxOut -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

typeRep :: Proxy TxOut -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep TxOut Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

type Rep TxOut = D1 ('MetaData "TxOut" "Plutus.V2.Ledger.Tx" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'False) (C1 ('MetaCons "TxOut" 'PrefixI 'True) ((S1 ('MetaSel ('Just "txOutAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address) :*: S1 ('MetaSel ('Just "txOutValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :*: (S1 ('MetaSel ('Just "txOutDatum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OutputDatum) :*: S1 ('MetaSel ('Just "txOutReferenceScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ScriptHash)))))

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 Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Ord TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Associated Types

type Rep TxOutRef :: Type -> Type Source #

NFData TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: TxOutRef -> () Source #

Pretty TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

pretty :: TxOutRef -> Doc ann

prettyList :: [TxOutRef] -> Doc ann

FromData TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

ToData TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

UnsafeFromData TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Eq TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

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

Lift DefaultUni TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

lift :: TxOutRef -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni TxOutRef Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

typeRep :: Proxy TxOutRef -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep TxOutRef Source # 
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-6EvbyJiK8IAAVEtnIJDu5Z" '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 OutputDatum Source #

The datum attached to an output: either nothing; a datum hash; or the datum itself (an "inline datum").

Instances

Instances details
Eq OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Show OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Generic OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Associated Types

type Rep OutputDatum :: Type -> Type Source #

NFData OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

rnf :: OutputDatum -> () Source #

Pretty OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

pretty :: OutputDatum -> Doc ann

prettyList :: [OutputDatum] -> Doc ann

FromData OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

ToData OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

UnsafeFromData OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Eq OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Lift DefaultUni OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

lift :: OutputDatum -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

Methods

typeRep :: Proxy OutputDatum -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep OutputDatum Source # 
Instance details

Defined in Plutus.V2.Ledger.Tx

type Rep OutputDatum = D1 ('MetaData "OutputDatum" "Plutus.V2.Ledger.Tx" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'False) (C1 ('MetaCons "NoOutputDatum" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "OutputDatumHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DatumHash)) :+: C1 ('MetaCons "OutputDatum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Datum))))

isPubKeyOut :: TxOut -> Bool Source #

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

isPayToScriptOut :: TxOut -> Bool Source #

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

outAddress :: Lens' TxOut Address Source #

The address of a transaction output.

outValue :: Lens' TxOut Value Source #

The value of a transaction output. | TODO: Compute address again

txOutPubKey :: TxOut -> Maybe PubKeyHash Source #

The public key attached to a TxOut, if there is one.

outDatum :: Lens' TxOut OutputDatum Source #

The datum attached to a TxOut.

outReferenceScript :: Lens' TxOut (Maybe ScriptHash) Source #

The reference script attached to a TxOut.

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

Create a transaction output locked by a public key.

Transaction inputs

data TxInType Source #

The type of a transaction input.

Constructors

ConsumeScriptAddress !Validator !Redeemer !Datum

A transaction input that consumes a script address with the given validator, redeemer, and 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 Plutus.V1.Ledger.Tx

Ord TxInType Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show TxInType Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic TxInType Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Associated Types

type Rep TxInType :: Type -> Type Source #

NFData TxInType Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

rnf :: TxInType -> () Source #

type Rep TxInType Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

type Rep TxInType = D1 ('MetaData "TxInType" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'False) (C1 ('MetaCons "ConsumeScriptAddress" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Validator) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Redeemer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Datum))) :+: (C1 ('MetaCons "ConsumePublicKeyAddress" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ConsumeSimpleScriptAddress" '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 Plutus.V1.Ledger.Tx

Methods

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

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

Ord TxIn Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Show TxIn Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Generic TxIn Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

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 Plutus.V1.Ledger.Tx

Methods

rnf :: TxIn -> () Source #

Pretty TxIn Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

Methods

pretty :: TxIn -> Doc ann

prettyList :: [TxIn] -> Doc ann

type Rep TxIn Source # 
Instance details

Defined in Plutus.V1.Ledger.Tx

type Rep TxIn = D1 ('MetaData "TxIn" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" '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))))

inRef :: Lens' TxIn TxOutRef Source #

The TxOutRef spent by a transaction input.

inType :: Lens' TxIn (Maybe TxInType) Source #

The type of a transaction input.

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

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

pubKeyTxIn :: TxOutRef -> TxIn Source #

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

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

A transaction input that spends a "pay to script" output, given witnesses.

pubKeyTxIns :: Fold (Set TxIn) TxIn Source #

Filter to get only the pubkey inputs.

scriptTxIns :: Fold (Set TxIn) TxIn Source #

Filter to get only the script inputs.