Safe Haskell | None |
---|---|
Language | Haskell2010 |
Misc. types used in this package
Synopsis
-
data
ChainIndexTx
=
ChainIndexTx
{
- _citxTxId :: TxId
- _citxInputs :: [TxIn]
- _citxOutputs :: ChainIndexTxOutputs
- _citxValidRange :: !SlotRange
- _citxData :: Map DatumHash Datum
- _citxRedeemers :: Redeemers
- _citxScripts :: Map ScriptHash (Versioned Script )
- _citxCardanoTx :: Maybe CardanoTx
-
data
ChainIndexTxOutputs
- = InvalidTx ( Maybe ChainIndexTxOut )
- | ValidTx [ ChainIndexTxOut ]
-
data
ChainIndexTxOut
=
ChainIndexTxOut
{
- citoAddress :: CardanoAddress
- citoValue :: Value
- citoDatum :: OutputDatum
- citoRefScript :: ReferenceScript
- data ReferenceScript
- newtype BlockId = BlockId { }
- blockId :: Block -> BlockId
-
data
Tip
- = TipAtGenesis
-
|
Tip
{
- tipSlot :: Slot
- tipBlockId :: BlockId
- tipBlockNo :: BlockNumber
-
data
Point
- = PointAtGenesis
-
|
Point
{
- pointSlot :: Slot
- pointBlockId :: BlockId
- pointsToTip :: Point -> Tip -> Bool
- tipAsPoint :: Tip -> Point
- _PointAtGenesis :: Prism' Point ()
- _Point :: Prism' Point (Slot, BlockId )
-
data
TxValidity
- = TxValid
- | TxInvalid
- | UnknownValidity
- type TxStatus = RollbackState ()
- type TxOutStatus = RollbackState TxOutState
- data RollbackState a
- data TxOutState
- liftTxOutStatus :: TxOutStatus -> TxStatus
- txOutStatusTxOutState :: TxOutStatus -> Maybe TxOutState
- newtype BlockNumber = BlockNumber { }
- newtype Depth = Depth { }
-
data
Diagnostics
=
Diagnostics
{
- numTransactions :: Integer
- numScripts :: Integer
- numAddresses :: Integer
- numAssetClasses :: Integer
- numUnspentOutputs :: Int
- numUnmatchedInputs :: Int
- someTransactions :: [ TxId ]
- unspentTxOuts :: [ ChainIndexTxOut ]
-
data
TxConfirmedState
=
TxConfirmedState
{
- timesConfirmed :: Sum Int
- blockAdded :: Last BlockNumber
- validity :: Last TxValidity
- data TxStatusFailure
-
data
TxIdState
=
TxIdState
{
- txnsConfirmed :: Map TxId TxConfirmedState
- txnsDeleted :: Map TxId ( Sum Int )
- data TxUtxoBalance = TxUtxoBalance { }
- tubUnspentOutputs :: Lens' TxUtxoBalance ( Set TxOutRef )
- tubUnmatchedSpentInputs :: Lens' TxUtxoBalance ( Set TxOutRef )
- data TxOutBalance = TxOutBalance { }
- tobUnspentOutputs :: Lens' TxOutBalance ( Set TxOutRef )
- tobSpentOutputs :: Lens' TxOutBalance ( Map TxOutRef TxId )
-
data
ChainSyncBlock
=
Block
{
- blockTip :: Tip
- blockTxs :: [( ChainIndexTx , TxProcessOption )]
-
newtype
TxProcessOption
=
TxProcessOption
{
- tpoStoreTx :: Bool
- citxTxId :: Lens' ChainIndexTx TxId
- citxInputs :: Lens' ChainIndexTx [TxIn]
- citxOutputs :: Lens' ChainIndexTx ChainIndexTxOutputs
- citxValidRange :: Lens' ChainIndexTx SlotRange
- citxData :: Lens' ChainIndexTx ( Map DatumHash Datum )
- citxRedeemers :: Lens' ChainIndexTx Redeemers
- citxScripts :: Lens' ChainIndexTx ( Map ScriptHash (Versioned Script ))
- citxCardanoTx :: Lens' ChainIndexTx ( Maybe CardanoTx)
- _InvalidTx :: Prism' ChainIndexTxOutputs ( Maybe ChainIndexTxOut )
- _ValidTx :: Prism' ChainIndexTxOutputs [ ChainIndexTxOut ]
- fromReferenceScript :: ReferenceScript -> Maybe (Versioned Script )
Documentation
data ChainIndexTx Source #
ChainIndexTx | |
|
Instances
data ChainIndexTxOutputs Source #
List of outputs of a transaction. There is only an optional collateral output if the transaction is invalid.
InvalidTx ( Maybe ChainIndexTxOut ) |
The transaction is invalid so there is maybe a collateral output. |
ValidTx [ ChainIndexTxOut ] |
Instances
data ChainIndexTxOut Source #
ChainIndexTxOut | |
|
Instances
data ReferenceScript Source #
Instances
Instances
Eq BlockId | |
Ord BlockId | |
Show BlockId | |
Generic BlockId | |
ToJSON BlockId | |
FromJSON BlockId | |
ToSchema BlockId Source # | |
Defined in Plutus.ChainIndex.Types declareNamedSchema :: Proxy BlockId -> Declare ( Definitions Schema ) NamedSchema Source # |
|
Pretty BlockId | |
HasDbType BlockId Source # | |
type Rep BlockId | |
Defined in Ledger.Blockchain
type
Rep
BlockId
=
D1
('
MetaData
"BlockId" "Ledger.Blockchain" "plutus-ledger-1.2.0.0-5ZNFySGahCv2fMTEPkrA76" '
True
) (
C1
('
MetaCons
"BlockId" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"getBlockId") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
ByteString
)))
|
|
type DbType BlockId Source # | |
Defined in Plutus.ChainIndex.DbSchema |
The tip of the chain index.
TipAtGenesis | |
Tip | |
|
Instances
When performing a rollback the chain sync protocol does not provide a block number where to resume from.
PointAtGenesis | |
Point | |
|
Instances
Eq Point Source # | |
Ord Point Source # | |
Defined in Plutus.ChainIndex.Types |
|
Show Point Source # | |
Generic Point Source # | |
Semigroup Point Source # | |
Monoid Point Source # | |
ToJSON Point Source # | |
FromJSON Point Source # | |
Pretty Point Source # | |
type Rep Point Source # | |
Defined in Plutus.ChainIndex.Types
type
Rep
Point
=
D1
('
MetaData
"Point" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" '
False
) (
C1
('
MetaCons
"PointAtGenesis" '
PrefixI
'
False
) (
U1
::
Type
->
Type
)
:+:
C1
('
MetaCons
"Point" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"pointSlot") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedStrict
) (
Rec0
Slot)
:*:
S1
('
MetaSel
('
Just
"pointBlockId") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedStrict
) (
Rec0
BlockId
)))
|
tipAsPoint :: Tip -> Point Source #
_PointAtGenesis :: Prism' Point () Source #
data TxValidity Source #
Validity of a transaction that has been added to the ledger
Instances
type TxStatus = RollbackState () Source #
The status of a Cardano transaction
type TxOutStatus = RollbackState TxOutState Source #
data RollbackState a Source #
The rollback state of a Cardano transaction
Unknown |
The transaction is not on the chain. That's all we can say. |
TentativelyConfirmed Depth TxValidity a |
The transaction is on the chain, n blocks deep. It can still be rolled back. |
Committed TxValidity a |
The transaction is on the chain. It cannot be rolled back anymore. |
Instances
data TxOutState Source #
Instances
liftTxOutStatus :: TxOutStatus -> TxStatus Source #
Converts a
TxOutStatus
to a
TxStatus
. Possible since a transaction
output belongs to a transaction.
Note, however, that we can't convert a
TxStatus
to a
TxOutStatus
.
txOutStatusTxOutState :: TxOutStatus -> Maybe TxOutState Source #
Maybe extract the
TxOutState
(Spent or Unspent) of a
TxOutStatus
.
newtype BlockNumber Source #
Instances
How many blocks deep the tx is on the chain
Instances
Enum Depth Source # | |
Defined in Plutus.ChainIndex.Types succ :: Depth -> Depth Source # pred :: Depth -> Depth Source # toEnum :: Int -> Depth Source # fromEnum :: Depth -> Int Source # enumFrom :: Depth -> [ Depth ] Source # enumFromThen :: Depth -> Depth -> [ Depth ] Source # enumFromTo :: Depth -> Depth -> [ Depth ] Source # enumFromThenTo :: Depth -> Depth -> Depth -> [ Depth ] Source # |
|
Eq Depth Source # | |
Integral Depth Source # | |
Defined in Plutus.ChainIndex.Types |
|
Num Depth Source # | |
Ord Depth Source # | |
Defined in Plutus.ChainIndex.Types |
|
Real Depth Source # | |
Defined in Plutus.ChainIndex.Types toRational :: Depth -> Rational Source # |
|
Show Depth Source # | |
Generic Depth Source # | |
ToJSON Depth Source # | |
FromJSON Depth Source # | |
Pretty Depth Source # | |
MeetSemiLattice Depth Source # | |
type Rep Depth Source # | |
Defined in Plutus.ChainIndex.Types |
data Diagnostics Source #
Diagnostics | |
|
Instances
data TxConfirmedState Source #
TxConfirmedState | |
|
Instances
data TxStatusFailure Source #
Datatype returned when we couldn't get the state of a tx or a tx output.
TxIdStateInvalid BlockNumber TxId TxIdState |
We couldn't return the status because the
|
TxOutBalanceStateInvalid BlockNumber TxOutRef TxOutBalance |
We couldn't return the status because the
|
InvalidRollbackAttempt BlockNumber TxId TxIdState |
Instances
Eq TxStatusFailure Source # | |
Defined in Plutus.ChainIndex.Types (==) :: TxStatusFailure -> TxStatusFailure -> Bool Source # (/=) :: TxStatusFailure -> TxStatusFailure -> Bool Source # |
|
Show TxStatusFailure Source # | |
Defined in Plutus.ChainIndex.Types |
TxIdState | |
|
Instances
Eq TxIdState Source # | |
Show TxIdState Source # | |
Generic TxIdState Source # | |
Semigroup TxIdState Source # | |
Monoid TxIdState Source # | |
type Rep TxIdState Source # | |
Defined in Plutus.ChainIndex.Types
type
Rep
TxIdState
=
D1
('
MetaData
"TxIdState" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" '
False
) (
C1
('
MetaCons
"TxIdState" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"txnsConfirmed") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedStrict
) (
Rec0
(
Map
TxId
TxConfirmedState
))
:*:
S1
('
MetaSel
('
Just
"txnsDeleted") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedStrict
) (
Rec0
(
Map
TxId
(
Sum
Int
)))))
|
data TxUtxoBalance Source #
The effect of a transaction (or a number of them) on the utxo set.
TxUtxoBalance | |
|
Instances
data TxOutBalance Source #
The effect of a transaction (or a number of them) on the tx output set.
TxOutBalance | |
|
Instances
tobUnspentOutputs :: Lens' TxOutBalance ( Set TxOutRef ) Source #
tobSpentOutputs :: Lens' TxOutBalance ( Map TxOutRef TxId ) Source #
data ChainSyncBlock Source #
A block of transactions to be synced.
Block | |
|
Instances
Show ChainSyncBlock Source # | |
Defined in Plutus.ChainIndex.Types |
newtype TxProcessOption Source #
User-customizable options to process a transaction. See #73 for more motivations.
TxProcessOption | |
|
Instances
Show TxProcessOption Source # | |
Defined in Plutus.ChainIndex.Types |
|
Default TxProcessOption Source # | |
Defined in Plutus.ChainIndex.Types |
Lenses
citxInputs :: Lens' ChainIndexTx [TxIn] Source #
citxValidRange :: Lens' ChainIndexTx SlotRange Source #
citxScripts :: Lens' ChainIndexTx ( Map ScriptHash (Versioned Script )) Source #
citxCardanoTx :: Lens' ChainIndexTx ( Maybe CardanoTx) Source #
fromReferenceScript :: ReferenceScript -> Maybe (Versioned Script ) Source #