marconi-cardano-indexers-1.2.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Marconi.Cardano.Indexers.MintTokenEvent

Description

Mint/burn event indexer, the result of which is an sqlite database 'minttokenevent.db' which has a table minting_policy_events with the following fields:

( slotNo INT NOT NULL
, blockHeaderHash BLOB NOT NULL
, blockNo INT NOT NULL
, txId BLOB NOT NULL
, txIndexInBlock INT NOT NULL
, policyId BLOB NOT NULL
, assetName TEXT NOT NULL
, quantity INT NOT NULL
, redeemerHash BLOB
, redeemerData BLOB
)
Synopsis

Events

newtype MintTokenBlockEvents #

Minting events given for each block.

Instances

Instances details
Show MintTokenBlockEvents # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Eq MintTokenBlockEvents # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Ord MintTokenBlockEvents # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

MonadError (QueryError (MintTokenEventsMatchingQuery MintTokenBlockEvents)) m => Queryable m MintTokenBlockEvents (MintTokenEventsMatchingQuery MintTokenBlockEvents) ListIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

(MonadIO m, MonadError (QueryError (MintTokenEventsMatchingQuery MintTokenBlockEvents)) m) => Queryable m MintTokenBlockEvents (MintTokenEventsMatchingQuery MintTokenBlockEvents) SQLiteIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

(MonadIO m, MonadError (QueryError (QueryByAssetId MintTokenBlockEvents)) m) => Queryable m MintTokenBlockEvents (QueryByAssetId MintTokenBlockEvents) ListIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

(MonadIO m, MonadError (QueryError (QueryByAssetId MintTokenBlockEvents)) m) => Queryable m MintTokenBlockEvents (QueryByAssetId MintTokenBlockEvents) SQLiteIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

(MonadIO m, IsSync m MintTokenBlockEvents SQLiteIndexer, IsSync (ExceptT (QueryError (BlockInfoBySlotNoQuery BlockInfo)) m) BlockInfo SQLiteIndexer, MonadError (QueryError (WithStability (QueryByAssetId MintTokenBlockEvents))) m) => Queryable m MintTokenBlockEvents (WithStability (QueryByAssetId MintTokenBlockEvents)) MintTokenEventIndexerQuery # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEventQuery

(MonadIO m, MonadError (QueryError (WithStability (QueryByAssetId MintTokenBlockEvents))) m) => Queryable m MintTokenBlockEvents (WithStability (QueryByAssetId MintTokenBlockEvents)) ListIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Point MintTokenBlockEvents # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

data MintTokenEvent #

Single minting event. This is the datatype was will be used to store the events in the database (not MintTokenBlockEvents). More specifically, we will store 'Core.Timed (Core.Point MintTokenEvent) MintTokenEvent)'.

Instances

Instances details
Generic MintTokenEvent # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Associated Types

type Rep MintTokenEvent :: Type -> Type Source #

Show MintTokenEvent # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Eq MintTokenEvent # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Ord MintTokenEvent # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

FromRow MintTokenEvent # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Methods

fromRow :: RowParser MintTokenEvent

ToRow MintTokenEvent # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Methods

toRow :: MintTokenEvent -> [SQLData] #

FromRow (Timed ChainPoint MintTokenEvent) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Methods

fromRow :: RowParser (Timed ChainPoint MintTokenEvent)

ToRow (Timed ChainPoint MintTokenEvent) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Methods

toRow :: Timed ChainPoint MintTokenEvent -> [SQLData] #

type Rep MintTokenEvent # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Rep MintTokenEvent = D1 ('MetaData "MintTokenEvent" "Marconi.Cardano.Indexers.MintTokenEvent" "marconi-cardano-indexers-1.2.0.0-inplace" 'False) (C1 ('MetaCons "MintTokenEvent" 'PrefixI 'True) (S1 ('MetaSel ('Just "_mintTokenEventLocation") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MintTokenEventLocation) :*: S1 ('MetaSel ('Just "_mintTokenEventAsset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MintAsset)))

data MintTokenEventLocation #

Instances

Instances details
Generic MintTokenEventLocation # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Associated Types

type Rep MintTokenEventLocation :: Type -> Type Source #

Show MintTokenEventLocation # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Eq MintTokenEventLocation # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Ord MintTokenEventLocation # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

FromRow MintTokenEventLocation # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Methods

fromRow :: RowParser MintTokenEventLocation

ToRow MintTokenEventLocation # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Methods

toRow :: MintTokenEventLocation -> [SQLData] #

type Rep MintTokenEventLocation # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Rep MintTokenEventLocation = D1 ('MetaData "MintTokenEventLocation" "Marconi.Cardano.Indexers.MintTokenEvent" "marconi-cardano-indexers-1.2.0.0-inplace" 'False) (C1 ('MetaCons "MintTokenEventLocation" 'PrefixI 'True) (S1 ('MetaSel ('Just "_mintTokenEventBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo) :*: (S1 ('MetaSel ('Just "_mintTokenEventTxId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxId) :*: S1 ('MetaSel ('Just "_mintTokenEventIndexInBlock") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxIndexInBlock))))

data MintAsset #

Instances

Instances details
Generic MintAsset # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Associated Types

type Rep MintAsset :: Type -> Type Source #

Show MintAsset # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Eq MintAsset # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Ord MintAsset # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

FromRow MintAsset # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Methods

fromRow :: RowParser MintAsset

ToRow MintAsset # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Methods

toRow :: MintAsset -> [SQLData] #

type Rep MintAsset # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Rep MintAsset = D1 ('MetaData "MintAsset" "Marconi.Cardano.Indexers.MintTokenEvent" "marconi-cardano-indexers-1.2.0.0-inplace" 'False) (C1 ('MetaCons "MintAsset" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_mintAssetPolicyId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PolicyId) :*: S1 ('MetaSel ('Just "_mintAssetAssetName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AssetName)) :*: (S1 ('MetaSel ('Just "_mintAssetQuantity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Quantity) :*: S1 ('MetaSel ('Just "_mintAssetRedeemer") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe MintAssetRedeemer)))))

Indexer and worker

newtype MintTokenEventConfig #

MintTokenEventConfig allows for specifying a list of C.PolicyIds and possibly C.AssetNames by which to filter a query. Nothing represents the case in which no filtering should occur.

catchupConfigEventHook :: Text -> Trace IO Text -> FilePath -> CatchupEvent -> IO () #

mintTokenEventWorker #

Arguments

:: (MonadIO n, MonadError IndexerError n, MonadIO m) 
=> StandardWorkerConfig m input MintTokenBlockEvents

General configuration of the indexer (mostly for logging purpose)

-> MintTokenEventConfig

Specific configuration of the indexer (mostly for logging purpose and filtering for target asset ids)

-> SQLiteDBLocation 
-> n (StandardWorker m input MintTokenBlockEvents SQLiteIndexer) 

Create a worker for the MintTokenEvent indexer

mintTokenEventBuilder :: (MonadIO n, MonadError IndexerError n) => SecurityParam -> CatchupConfig -> MintTokenEventConfig -> Trace IO Text -> FilePath -> n (StandardWorker IO [AnyTxBody] MintTokenBlockEvents SQLiteIndexer) #

Convenience wrapper around mkMintTokenEventWorker with some defaults for creating StandardWorkerConfig, including a preprocessor.

filterByTargetAssetIds :: NonEmpty (PolicyId, Maybe AssetName) -> MintTokenBlockEvents -> Maybe MintTokenBlockEvents #

Only keep the MintTokenEvents at a block if they mint a target AssetId.

Extract events

Queries

data MintTokenEventsMatchingQuery event #

Defunctionalisation of queries

Instances

Instances details
MonadError (QueryError (MintTokenEventsMatchingQuery MintTokenBlockEvents)) m => Queryable m MintTokenBlockEvents (MintTokenEventsMatchingQuery MintTokenBlockEvents) ListIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

(MonadIO m, MonadError (QueryError (MintTokenEventsMatchingQuery MintTokenBlockEvents)) m) => Queryable m MintTokenBlockEvents (MintTokenEventsMatchingQuery MintTokenBlockEvents) SQLiteIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Show (MintTokenEventsMatchingQuery event) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Eq (MintTokenEventsMatchingQuery event) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Ord (MintTokenEventsMatchingQuery event) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Result (MintTokenEventsMatchingQuery event) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Result (MintTokenEventsMatchingQuery event) = [Timed (Point event) event]

data QueryByAssetId event #

Instances

Instances details
(MonadIO m, MonadError (QueryError (QueryByAssetId MintTokenBlockEvents)) m) => Queryable m MintTokenBlockEvents (QueryByAssetId MintTokenBlockEvents) ListIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

(MonadIO m, MonadError (QueryError (QueryByAssetId MintTokenBlockEvents)) m) => Queryable m MintTokenBlockEvents (QueryByAssetId MintTokenBlockEvents) SQLiteIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

(MonadIO m, IsSync m MintTokenBlockEvents SQLiteIndexer, IsSync (ExceptT (QueryError (BlockInfoBySlotNoQuery BlockInfo)) m) BlockInfo SQLiteIndexer, MonadError (QueryError (WithStability (QueryByAssetId MintTokenBlockEvents))) m) => Queryable m MintTokenBlockEvents (WithStability (QueryByAssetId MintTokenBlockEvents)) MintTokenEventIndexerQuery # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEventQuery

(MonadIO m, MonadError (QueryError (WithStability (QueryByAssetId MintTokenBlockEvents))) m) => Queryable m MintTokenBlockEvents (WithStability (QueryByAssetId MintTokenBlockEvents)) ListIndexer # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

Show (QueryByAssetId event) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Result (QueryByAssetId event) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Result (QueryByAssetId event) = [Timed (Point event) event]
type Result (WithStability (QueryByAssetId event)) # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent

type Result (WithStability (QueryByAssetId event)) = [Stability (Timed (Point event) event)]

queryByAssetIdPolicyId :: forall event event. Lens (QueryByAssetId event) (QueryByAssetId event) PolicyId PolicyId #

queryByAssetIdAssetName :: forall event event. Lens (QueryByAssetId event) (QueryByAssetId event) (Maybe AssetName) (Maybe AssetName) #

queryByAssetIdEventType :: forall event event. Lens (QueryByAssetId event) (QueryByAssetId event) (Maybe EventType) (Maybe EventType) #

queryByAssetIdUpperSlotNo :: forall event event. Lens (QueryByAssetId event) (QueryByAssetId event) (Maybe SlotNo) (Maybe SlotNo) #

queryByAssetIdLowerTxId :: forall event event. Lens (QueryByAssetId event) (QueryByAssetId event) (Maybe TxId) (Maybe TxId) #

data EventType #

Instances

Instances details
Show EventType # 
Instance details

Defined in Marconi.Cardano.Indexers.MintTokenEvent