| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Plutus.ChainIndex.Types
Contents
Description
Misc. types used in this package
Synopsis
- data ChainIndexTx = ChainIndexTx {}
- data ChainIndexTxOutputs
- data ChainIndexTxOut = ChainIndexTxOut {}
- data ReferenceScript
- newtype BlockId = BlockId {}
- blockId :: Block -> BlockId
- data Tip
- = TipAtGenesis
- | Tip { }
- 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
- 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 {}
- data TxConfirmedState = TxConfirmedState {}
- 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 SomeCardanoApiTx)
- _InvalidTx :: Prism' ChainIndexTxOutputs (Maybe ChainIndexTxOut)
- _ValidTx :: Prism' ChainIndexTxOutputs [ChainIndexTxOut]
- fromReferenceScript :: ReferenceScript -> Maybe (Versioned Script)
Documentation
data ChainIndexTx Source #
Constructors
| ChainIndexTx | |
Fields
| |
Instances
data ChainIndexTxOutputs Source #
List of outputs of a transaction. There is only an optional collateral output if the transaction is invalid.
Constructors
| InvalidTx (Maybe ChainIndexTxOut) | The transaction is invalid so there is maybe a collateral output. |
| ValidTx [ChainIndexTxOut] |
Instances
data ChainIndexTxOut Source #
Constructors
| ChainIndexTxOut | |
Fields
| |
Instances
data ReferenceScript Source #
Instances
Block identifier (usually a hash)
Constructors
| BlockId | |
Fields | |
Instances
| Eq BlockId | |
| Ord BlockId | |
Defined in Ledger.Blockchain | |
| Show BlockId | |
| Generic BlockId | |
| ToJSON BlockId | |
| FromJSON BlockId | |
| ToSchema BlockId | |
Defined in Ledger.Blockchain Methods 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.1.0.0-JskZbcPMCdRJVHaAZ0to82" '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.
Constructors
| TipAtGenesis | |
| Tip | |
Fields
| |
Instances
When performing a rollback the chain sync protocol does not provide a block number where to resume from.
Constructors
| PointAtGenesis | |
| Point | |
Fields
| |
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.1.0.0-K7whjMLv5AnJVt0avXcbFn" '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
Constructors
| TxValid | |
| TxInvalid | |
| UnknownValidity |
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
Constructors
| 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 #
Constructors
| BlockNumber | |
Fields | |
Instances
How many blocks deep the tx is on the chain
Instances
| Enum Depth Source # | |
Defined in Plutus.ChainIndex.Types Methods 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 Methods 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 #
Constructors
| Diagnostics | |
Fields
| |
Instances
data TxConfirmedState Source #
Constructors
| TxConfirmedState | |
Fields
| |
Instances
data TxStatusFailure Source #
Datatype returned when we couldn't get the state of a tx or a tx output.
Constructors
| 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 Methods (==) :: TxStatusFailure -> TxStatusFailure -> Bool Source # (/=) :: TxStatusFailure -> TxStatusFailure -> Bool Source # | |
| Show TxStatusFailure Source # | |
Defined in Plutus.ChainIndex.Types | |
Constructors
| TxIdState | |
Fields
| |
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.1.0.0-K7whjMLv5AnJVt0avXcbFn" '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.
Constructors
| TxUtxoBalance | |
Fields
| |
Instances
data TxOutBalance Source #
The effect of a transaction (or a number of them) on the tx output set.
Constructors
| TxOutBalance | |
Fields
| |
Instances
data ChainSyncBlock Source #
A block of transactions to be synced.
Constructors
| Block | |
Fields
| |
Instances
| Show ChainSyncBlock Source # | |
Defined in Plutus.ChainIndex.Types | |
newtype TxProcessOption Source #
User-customizable options to process a transaction. See #73 for more motivations.
Constructors
| TxProcessOption | |
Fields
| |
Instances
| Show TxProcessOption Source # | |
Defined in Plutus.ChainIndex.Types | |
| Default TxProcessOption Source # | |
Defined in Plutus.ChainIndex.Types Methods | |
Lenses
citxInputs :: Lens' ChainIndexTx [TxIn] Source #
Orphan instances
| ToSchema ScriptInAnyLang Source # | |
Methods declareNamedSchema :: Proxy ScriptInAnyLang -> Declare (Definitions Schema) NamedSchema Source # | |
| Serialise ScriptInAnyLang Source # | |
Methods encode :: ScriptInAnyLang -> Encoding Source # decode :: Decoder s ScriptInAnyLang Source # encodeList :: [ScriptInAnyLang] -> Encoding Source # decodeList :: Decoder s [ScriptInAnyLang] Source # | |