plutus-ledger-api-1.30.0.0: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusLedgerApi.V2.Tx

Synopsis

Transactions

newtype TxId Source #

A transaction ID, i.e. the hash of a transaction. Hashed with BLAKE2b-256. 32 byte.

This is a simple type without any validation, use with caution. You may want to add checks for its invariants. See the Shelley ledger specification.

Constructors

TxId 

Instances

Instances details
IsString TxId Source #

from hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Tx

Generic TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Associated Types

type Rep TxId :: Type -> Type Source #

Methods

from :: TxId -> Rep TxId x Source #

to :: Rep TxId x -> TxId Source #

Show TxId Source #

using hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Tx

NFData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

rnf :: TxId -> () Source #

Eq TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

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

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

Ord TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Eq TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

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

FromData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

ToData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

UnsafeFromData TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Ord TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.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

Pretty TxId Source #

using hex encoding

Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

pretty :: TxId -> Doc ann

prettyList :: [TxId] -> Doc ann

Lift DefaultUni TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

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

Typeable DefaultUni TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

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

type Rep TxId Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

type Rep TxId = D1 ('MetaData "TxId" "PlutusLedgerApi.V1.Tx" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" '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.

See also ScriptPurpose

Constructors

Spend 
Mint 
Cert 
Reward 

Instances

Instances details
Generic ScriptTag Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Associated Types

type Rep ScriptTag :: Type -> Type Source #

Show ScriptTag Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

NFData ScriptTag Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

rnf :: ScriptTag -> () Source #

Eq ScriptTag Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Ord ScriptTag Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

type Rep ScriptTag Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

type Rep ScriptTag = D1 ('MetaData "ScriptTag" "PlutusLedgerApi.V1.Tx" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" '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 (ScriptTag) t and an index i, picking out the i-th script of type t in the transaction.

Instances

Instances details
Generic RedeemerPtr Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Associated Types

type Rep RedeemerPtr :: Type -> Type Source #

Show RedeemerPtr Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

NFData RedeemerPtr Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

rnf :: RedeemerPtr -> () Source #

Eq RedeemerPtr Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Ord RedeemerPtr Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

type Rep RedeemerPtr Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

type Rep RedeemerPtr = D1 ('MetaData "RedeemerPtr" "PlutusLedgerApi.V1.Tx" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" '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)))

type Redeemers = Map RedeemerPtr Redeemer Source #

Redeemers is a Map of redeemer pointer (RedeemerPtr) and its Redeemer.

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

Defined in PlutusLedgerApi.V2.Tx

Associated Types

type Rep TxOut :: Type -> Type Source #

Methods

from :: TxOut -> Rep TxOut x Source #

to :: Rep TxOut x -> TxOut Source #

Show TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

NFData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

rnf :: TxOut -> () Source #

Eq TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

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

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

Eq TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

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

FromData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

ToData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

UnsafeFromData TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Pretty TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

pretty :: TxOut -> Doc ann

prettyList :: [TxOut] -> Doc ann

Lift DefaultUni TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

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

Typeable DefaultUni TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

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

type Rep TxOut Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

type Rep TxOut = D1 ('MetaData "TxOut" "PlutusLedgerApi.V2.Tx" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" '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 ID (TxId), and an index indicating which of the outputs of that transaction we are referring to.

Constructors

TxOutRef 

Fields

Instances

Instances details
Generic TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Associated Types

type Rep TxOutRef :: Type -> Type Source #

Show TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

NFData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

rnf :: TxOutRef -> () Source #

Eq TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Ord TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Eq TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

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

FromData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

ToData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

UnsafeFromData TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Pretty TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

pretty :: TxOutRef -> Doc ann

prettyList :: [TxOutRef] -> Doc ann

Lift DefaultUni TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

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

Typeable DefaultUni TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

Methods

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

type Rep TxOutRef Source # 
Instance details

Defined in PlutusLedgerApi.V1.Tx

type Rep TxOutRef = D1 ('MetaData "TxOutRef" "PlutusLedgerApi.V1.Tx" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" '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
Generic OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Associated Types

type Rep OutputDatum :: Type -> Type Source #

Show OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

NFData OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

rnf :: OutputDatum -> () Source #

Eq OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Eq OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

FromData OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

ToData OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

UnsafeFromData OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Pretty OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

pretty :: OutputDatum -> Doc ann

prettyList :: [OutputDatum] -> Doc ann

Lift DefaultUni OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

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

Typeable DefaultUni OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

Methods

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

type Rep OutputDatum Source # 
Instance details

Defined in PlutusLedgerApi.V2.Tx

type Rep OutputDatum = D1 ('MetaData "OutputDatum" "PlutusLedgerApi.V2.Tx" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" '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.