Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 #
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
chainIndexTxOutputs :: Traversal' ChainIndexTxOutputs ChainIndexTxOut Source #
data ChainIndexTxOut Source #
ChainIndexTxOut | |
|
Instances
data ReferenceScript Source #
ReferenceScriptNone | |
ReferenceScriptInAnyLang ScriptInAnyLang |
Instances
BlockId | |
|
Instances
Eq BlockId | |
Ord BlockId | |
Show BlockId | |
Generic BlockId | |
FromJSON BlockId | |
Defined in Ledger.Blockchain parseJSON :: Value -> Parser BlockId parseJSONList :: Value -> Parser [BlockId] | |
ToJSON BlockId | |
Defined in Ledger.Blockchain toEncoding :: BlockId -> Encoding toJSONList :: [BlockId] -> Value toEncodingList :: [BlockId] -> Encoding | |
ToSchema BlockId | |
Defined in Plutus.ChainIndex.Types declareNamedSchema :: Proxy BlockId -> Declare (Definitions Schema) NamedSchema | |
Pretty BlockId | |
Defined in Ledger.Blockchain prettyList :: [BlockId] -> Doc ann | |
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.
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 # | |
FromJSON Point Source # | |
Defined in Plutus.ChainIndex.Types parseJSON :: Value -> Parser Point parseJSONList :: Value -> Parser [Point] | |
ToJSON Point Source # | |
Defined in Plutus.ChainIndex.Types | |
Pretty Point Source # | |
Defined in Plutus.ChainIndex.Types prettyList :: [Point] -> Doc ann | |
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
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
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-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.
TxUtxoBalance | |
|
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.
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
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 # | |
encode :: ScriptInAnyLang -> Encoding decode :: Decoder s ScriptInAnyLang encodeList :: [ScriptInAnyLang] -> Encoding decodeList :: Decoder s [ScriptInAnyLang] | |
ToSchema ScriptInAnyLang Source # | |
declareNamedSchema :: Proxy ScriptInAnyLang -> Declare (Definitions Schema) NamedSchema | |
ToSchema Value Source # | |
declareNamedSchema :: Proxy Value -> Declare (Definitions Schema) NamedSchema | |
ToSchema Language Source # | |
declareNamedSchema :: Proxy Language -> Declare (Definitions Schema) NamedSchema | |
ToSchema BlockId Source # | |
declareNamedSchema :: Proxy BlockId -> Declare (Definitions Schema) NamedSchema | |
ToSchema Slot Source # | |
declareNamedSchema :: Proxy Slot -> Declare (Definitions Schema) NamedSchema | |
ToSchema CardanoTx Source # | |
declareNamedSchema :: Proxy CardanoTx -> Declare (Definitions Schema) NamedSchema | |
ToSchema Datum Source # | |
declareNamedSchema :: Proxy Datum -> Declare (Definitions Schema) NamedSchema | |
ToSchema DatumHash Source # | |
declareNamedSchema :: Proxy DatumHash -> Declare (Definitions Schema) NamedSchema | |
ToSchema Redeemer Source # | |
declareNamedSchema :: Proxy Redeemer -> Declare (Definitions Schema) NamedSchema | |
ToSchema Script Source # | |
declareNamedSchema :: Proxy Script -> Declare (Definitions Schema) NamedSchema | |
ToSchema ScriptHash Source # | |
declareNamedSchema :: Proxy ScriptHash -> Declare (Definitions Schema) NamedSchema | |
ToSchema Validator Source # | |
declareNamedSchema :: Proxy Validator -> Declare (Definitions Schema) NamedSchema | |
ToSchema RedeemerPtr Source # | |
declareNamedSchema :: Proxy RedeemerPtr -> Declare (Definitions Schema) NamedSchema | |
ToSchema ScriptTag Source # | |
declareNamedSchema :: Proxy ScriptTag -> Declare (Definitions Schema) NamedSchema | |
ToSchema TxOutRef Source # | |
declareNamedSchema :: Proxy TxOutRef -> Declare (Definitions Schema) NamedSchema | |
ToSchema BuiltinData Source # | |
declareNamedSchema :: Proxy BuiltinData -> Declare (Definitions Schema) NamedSchema | |
ToSchema BuiltinByteString Source # | |
declareNamedSchema :: Proxy BuiltinByteString -> Declare (Definitions Schema) NamedSchema | |
ToSchema Data Source # | |
declareNamedSchema :: Proxy Data -> Declare (Definitions Schema) NamedSchema | |
ToSchema TxId Source # | |
declareNamedSchema :: Proxy TxId -> Declare (Definitions Schema) NamedSchema | |
ToSchema CurrencySymbol Source # | |
declareNamedSchema :: Proxy CurrencySymbol -> Declare (Definitions Schema) NamedSchema | |
ToSchema TokenName Source # | |
declareNamedSchema :: Proxy TokenName -> Declare (Definitions Schema) NamedSchema | |
ToSchema Value Source # | |
declareNamedSchema :: Proxy Value -> Declare (Definitions Schema) NamedSchema | |
ToSchema OutputDatum Source # | |
declareNamedSchema :: Proxy OutputDatum -> Declare (Definitions Schema) NamedSchema | |
ToSchema (AddressInEra BabbageEra) Source # | |
declareNamedSchema :: Proxy (AddressInEra BabbageEra) -> Declare (Definitions Schema) NamedSchema | |
Typeable era => ToSchema (Tx era) Source # | |
declareNamedSchema :: Proxy (Tx era) -> Declare (Definitions Schema) NamedSchema | |
ToSchema a => ToSchema (Extended a) Source # | |
declareNamedSchema :: Proxy (Extended a) -> Declare (Definitions Schema) NamedSchema | |
ToSchema a => ToSchema (Interval a) Source # | |
declareNamedSchema :: Proxy (Interval a) -> Declare (Definitions Schema) NamedSchema | |
ToSchema a => ToSchema (LowerBound a) Source # | |
declareNamedSchema :: Proxy (LowerBound a) -> Declare (Definitions Schema) NamedSchema | |
ToSchema a => ToSchema (UpperBound a) Source # | |
declareNamedSchema :: Proxy (UpperBound a) -> Declare (Definitions Schema) NamedSchema | |
ToSchema script => ToSchema (Versioned script) Source # | |
declareNamedSchema :: Proxy (Versioned script) -> Declare (Definitions Schema) NamedSchema | |
(Typeable era, Typeable mode) => ToSchema (EraInMode era mode) Source # | |
declareNamedSchema :: Proxy (EraInMode era mode) -> Declare (Definitions Schema) NamedSchema | |
(ToSchema k, ToSchema v) => ToSchema (Map k v) Source # | |
declareNamedSchema :: Proxy (Map k v) -> Declare (Definitions Schema) NamedSchema |