| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Plutus.ChainIndex.Types
Contents
Description
Misc. types used in this package
Synopsis
- data ChainIndexTx = ChainIndexTx {
- _citxTxId :: TxId
- _citxInputs :: [TxOutRef]
- _citxOutputs :: ChainIndexTxOutputs
- _citxValidRange :: !SlotRange
- _citxData :: Map DatumHash Datum
- _citxRedeemers :: Redeemers
- _citxScripts :: Map ScriptHash (Versioned Script)
- _citxCardanoTx :: Maybe CardanoTx
- data ChainIndexTxOutputs
- chainIndexTxOutputs :: Traversal' ChainIndexTxOutputs ChainIndexTxOut
- data ChainIndexTxOut = ChainIndexTxOut {
- citoAddress :: CardanoAddress
- citoValue :: Value
- citoDatum :: OutputDatum
- citoRefScript :: ReferenceScript
- data ReferenceScript
- = ReferenceScriptNone
- | ReferenceScriptInAnyLang ScriptInAnyLang
- newtype BlockId = BlockId {
- getBlockId :: ByteString
- 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
- 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 :: Set TxOutRef
- _tubUnmatchedSpentInputs :: Set TxOutRef
- tubUnspentOutputs :: Lens' TxUtxoBalance (Set TxOutRef)
- tubUnmatchedSpentInputs :: Lens' TxUtxoBalance (Set TxOutRef)
- data TxOutBalance = TxOutBalance {
- _tobUnspentOutputs :: Set TxOutRef
- _tobSpentOutputs :: Map TxOutRef TxId
- 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 [TxOutRef]
- 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 #
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
chainIndexTxOutputs :: Traversal' ChainIndexTxOutputs ChainIndexTxOut Source #
data ChainIndexTxOut Source #
Constructors
| ChainIndexTxOut | |
Fields
| |
Instances
data ReferenceScript Source #
Constructors
| ReferenceScriptNone | |
| ReferenceScriptInAnyLang ScriptInAnyLang |
Instances
Constructors
| BlockId | |
Fields
| |
Instances
| Eq BlockId | |
| Ord BlockId | |
Defined in Ledger.Blockchain | |
| Show BlockId | |
| Generic BlockId | |
| FromJSON BlockId | |
Defined in Ledger.Blockchain | |
| ToJSON BlockId | |
Defined in Ledger.Blockchain Methods toEncoding :: BlockId -> Encoding toJSONList :: [BlockId] -> Value toEncodingList :: [BlockId] -> Encoding | |
| ToSchema BlockId | |
Defined in Plutus.ChainIndex.Types Methods declareNamedSchema :: Proxy BlockId -> Declare (Definitions Schema) NamedSchema | |
| Pretty BlockId | |
Defined in Ledger.Blockchain | |
| HasDbType BlockId Source # | |
| type Rep BlockId | |
Defined in Ledger.Blockchain | |
| 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 # | |
| FromJSON Point Source # | |
Defined in Plutus.ChainIndex.Types | |
| ToJSON Point Source # | |
Defined in Plutus.ChainIndex.Types Methods toEncoding :: Point -> Encoding toJSONList :: [Point] -> Value toEncodingList :: [Point] -> Encoding | |
| Pretty Point Source # | |
Defined in Plutus.ChainIndex.Types | |
| 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-KXwe88sWnh3Kg9uXBYztrS" '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
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.2.0.0-KXwe88sWnh3Kg9uXBYztrS" '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
tubUnspentOutputs :: Lens' TxUtxoBalance (Set TxOutRef) Source #
tubUnmatchedSpentInputs :: Lens' TxUtxoBalance (Set TxOutRef) Source #
data TxOutBalance Source #
The effect of a transaction (or a number of them) on the tx output set.
Constructors
| TxOutBalance | |
Fields
| |
Instances
tobUnspentOutputs :: Lens' TxOutBalance (Set TxOutRef) Source #
tobSpentOutputs :: Lens' TxOutBalance (Map TxOutRef TxId) Source #
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
citxTxId :: Lens' ChainIndexTx TxId Source #
citxInputs :: Lens' ChainIndexTx [TxOutRef] Source #
citxOutputs :: Lens' ChainIndexTx ChainIndexTxOutputs Source #
citxValidRange :: Lens' ChainIndexTx SlotRange Source #
citxData :: Lens' ChainIndexTx (Map DatumHash Datum) Source #
citxRedeemers :: Lens' ChainIndexTx Redeemers Source #
citxScripts :: Lens' ChainIndexTx (Map ScriptHash (Versioned Script)) Source #
citxCardanoTx :: Lens' ChainIndexTx (Maybe CardanoTx) Source #
_InvalidTx :: Prism' ChainIndexTxOutputs (Maybe ChainIndexTxOut) Source #
_ValidTx :: Prism' ChainIndexTxOutputs [ChainIndexTxOut] Source #
fromReferenceScript :: ReferenceScript -> Maybe (Versioned Script) Source #
Orphan instances
| Serialise ScriptInAnyLang Source # | |
Methods encode :: ScriptInAnyLang -> Encoding decode :: Decoder s ScriptInAnyLang encodeList :: [ScriptInAnyLang] -> Encoding decodeList :: Decoder s [ScriptInAnyLang] | |
| ToSchema ScriptInAnyLang Source # | |
Methods declareNamedSchema :: Proxy ScriptInAnyLang -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Value Source # | |
Methods declareNamedSchema :: Proxy Value -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Language Source # | |
Methods declareNamedSchema :: Proxy Language -> Declare (Definitions Schema) NamedSchema | |
| ToSchema BlockId Source # | |
Methods declareNamedSchema :: Proxy BlockId -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Slot Source # | |
Methods declareNamedSchema :: Proxy Slot -> Declare (Definitions Schema) NamedSchema | |
| ToSchema CardanoTx Source # | |
Methods declareNamedSchema :: Proxy CardanoTx -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Datum Source # | |
Methods declareNamedSchema :: Proxy Datum -> Declare (Definitions Schema) NamedSchema | |
| ToSchema DatumHash Source # | |
Methods declareNamedSchema :: Proxy DatumHash -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Redeemer Source # | |
Methods declareNamedSchema :: Proxy Redeemer -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Script Source # | |
Methods declareNamedSchema :: Proxy Script -> Declare (Definitions Schema) NamedSchema | |
| ToSchema ScriptHash Source # | |
Methods declareNamedSchema :: Proxy ScriptHash -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Validator Source # | |
Methods declareNamedSchema :: Proxy Validator -> Declare (Definitions Schema) NamedSchema | |
| ToSchema RedeemerPtr Source # | |
Methods declareNamedSchema :: Proxy RedeemerPtr -> Declare (Definitions Schema) NamedSchema | |
| ToSchema ScriptTag Source # | |
Methods declareNamedSchema :: Proxy ScriptTag -> Declare (Definitions Schema) NamedSchema | |
| ToSchema TxOutRef Source # | |
Methods declareNamedSchema :: Proxy TxOutRef -> Declare (Definitions Schema) NamedSchema | |
| ToSchema BuiltinData Source # | |
Methods declareNamedSchema :: Proxy BuiltinData -> Declare (Definitions Schema) NamedSchema | |
| ToSchema BuiltinByteString Source # | |
Methods declareNamedSchema :: Proxy BuiltinByteString -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Data Source # | |
Methods declareNamedSchema :: Proxy Data -> Declare (Definitions Schema) NamedSchema | |
| ToSchema TxId Source # | |
Methods declareNamedSchema :: Proxy TxId -> Declare (Definitions Schema) NamedSchema | |
| ToSchema CurrencySymbol Source # | |
Methods declareNamedSchema :: Proxy CurrencySymbol -> Declare (Definitions Schema) NamedSchema | |
| ToSchema TokenName Source # | |
Methods declareNamedSchema :: Proxy TokenName -> Declare (Definitions Schema) NamedSchema | |
| ToSchema Value Source # | |
Methods declareNamedSchema :: Proxy Value -> Declare (Definitions Schema) NamedSchema | |
| ToSchema OutputDatum Source # | |
Methods declareNamedSchema :: Proxy OutputDatum -> Declare (Definitions Schema) NamedSchema | |
| ToSchema (AddressInEra BabbageEra) Source # | |
Methods declareNamedSchema :: Proxy (AddressInEra BabbageEra) -> Declare (Definitions Schema) NamedSchema | |
| Typeable era => ToSchema (Tx era) Source # | |
Methods declareNamedSchema :: Proxy (Tx era) -> Declare (Definitions Schema) NamedSchema | |
| ToSchema a => ToSchema (Extended a) Source # | |
Methods declareNamedSchema :: Proxy (Extended a) -> Declare (Definitions Schema) NamedSchema | |
| ToSchema a => ToSchema (Interval a) Source # | |
Methods declareNamedSchema :: Proxy (Interval a) -> Declare (Definitions Schema) NamedSchema | |
| ToSchema a => ToSchema (LowerBound a) Source # | |
Methods declareNamedSchema :: Proxy (LowerBound a) -> Declare (Definitions Schema) NamedSchema | |
| ToSchema a => ToSchema (UpperBound a) Source # | |
Methods declareNamedSchema :: Proxy (UpperBound a) -> Declare (Definitions Schema) NamedSchema | |
| ToSchema script => ToSchema (Versioned script) Source # | |
Methods declareNamedSchema :: Proxy (Versioned script) -> Declare (Definitions Schema) NamedSchema | |
| (Typeable era, Typeable mode) => ToSchema (EraInMode era mode) Source # | |
Methods declareNamedSchema :: Proxy (EraInMode era mode) -> Declare (Definitions Schema) NamedSchema | |
| (ToSchema k, ToSchema v) => ToSchema (Map k v) Source # | |
Methods declareNamedSchema :: Proxy (Map k v) -> Declare (Definitions Schema) NamedSchema | |