Safe Haskell | None |
---|---|
Language | Haskell2010 |
Plutus.V2.Ledger.Tx
Synopsis
- newtype TxId = TxId { }
- data ScriptTag
- data RedeemerPtr = RedeemerPtr ScriptTag Integer
- type Redeemers = Map RedeemerPtr Redeemer
- data TxOut = TxOut { }
-
data
TxOutRef
=
TxOutRef
{
- txOutRefId :: TxId
- txOutRefIdx :: Integer
- data OutputDatum
- isPubKeyOut :: TxOut -> Bool
- isPayToScriptOut :: TxOut -> Bool
- outAddress :: Lens' TxOut Address
- outValue :: Lens' TxOut Value
- txOutPubKey :: TxOut -> Maybe PubKeyHash
- outDatum :: Lens' TxOut OutputDatum
- outReferenceScript :: Lens' TxOut ( Maybe ScriptHash )
- pubKeyHashTxOut :: Value -> PubKeyHash -> TxOut
- data TxInType
- data TxIn = TxIn { }
- inRef :: Lens' TxIn TxOutRef
- inType :: Lens' TxIn ( Maybe TxInType )
- inScripts :: TxIn -> Maybe ( Validator , Redeemer , Datum )
- pubKeyTxIn :: TxOutRef -> TxIn
- scriptTxIn :: TxOutRef -> Validator -> Redeemer -> Datum -> TxIn
- pubKeyTxIns :: Fold ( Set TxIn ) TxIn
- scriptTxIns :: Fold ( Set TxIn ) TxIn
Transactions
A transaction ID, using a SHA256 hash as the transaction id.
Constructors
TxId | |
Fields |
Instances
A tag indicating the type of script that we are pointing to.
Instances
Eq ScriptTag Source # | |
Ord ScriptTag Source # | |
Defined in Plutus.V1.Ledger.Tx Methods compare :: ScriptTag -> ScriptTag -> Ordering Source # (<) :: ScriptTag -> ScriptTag -> Bool Source # (<=) :: ScriptTag -> ScriptTag -> Bool Source # (>) :: ScriptTag -> ScriptTag -> Bool Source # (>=) :: ScriptTag -> ScriptTag -> Bool Source # |
|
Show ScriptTag Source # | |
Generic ScriptTag Source # | |
NFData ScriptTag Source # | |
Defined in Plutus.V1.Ledger.Tx |
|
type Rep ScriptTag Source # | |
Defined in Plutus.V1.Ledger.Tx
type
Rep
ScriptTag
=
D1
('
MetaData
"ScriptTag" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" '
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.
Constructors
RedeemerPtr ScriptTag Integer |
Instances
Transaction outputs
A transaction output, consisting of a target address, a value, optionally a datum/datum hash, and optionally a reference script.
Constructors
TxOut | |
Fields |
Instances
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
data OutputDatum Source #
The datum attached to an output: either nothing; a datum hash; or the datum itself (an "inline datum").
Constructors
NoOutputDatum | |
OutputDatumHash DatumHash | |
OutputDatum Datum |
Instances
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.
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.
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
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
Eq TxInType Source # | |
Ord TxInType Source # | |
Defined in Plutus.V1.Ledger.Tx |
|
Show TxInType Source # | |
Generic TxInType Source # | |
NFData TxInType Source # | |
Defined in Plutus.V1.Ledger.Tx |
|
type Rep TxInType Source # | |
Defined in Plutus.V1.Ledger.Tx
type
Rep
TxInType
=
D1
('
MetaData
"TxInType" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" '
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
)))
|
A transaction input, consisting of a transaction output reference and an input type.
Instances
Eq TxIn Source # | |
Ord TxIn Source # | |
Defined in Plutus.V1.Ledger.Tx |
|
Show TxIn Source # | |
Generic TxIn Source # | |
NFData TxIn Source # | |
Defined in Plutus.V1.Ledger.Tx |
|
Pretty TxIn Source # | |
type Rep TxIn Source # | |
Defined in Plutus.V1.Ledger.Tx
type
Rep
TxIn
=
D1
('
MetaData
"TxIn" "Plutus.V1.Ledger.Tx" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" '
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
))))
|
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.