Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Indexer for mint and burn events.
The implementation for converting blocks to events and persisting these into sqlite is outsourced from marconi.
This just provides the CLI interface and a streaming runtime.
Synopsis
- data MintBurn = MintBurn {
- chainsync :: LocalChainsyncConfig_
- dbPathAndTableName :: DbPathAndTableName
- maybePolicyIdAndAssetName :: Maybe (PolicyId, Maybe AssetName)
- toEventsPrim :: (PolicyId -> AssetName -> Bool) -> BlockInMode CardanoMode -> [Event MintBurn]
- sqliteInit :: Connection -> String -> IO ()
- persistManySqlite :: Connection -> String -> [Event MintBurn] -> IO ()
- getPolicyData :: forall era. (Era (ShelleyLedgerEra era), EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto) => TxBody era -> MultiAsset StandardCrypto -> [(PolicyId, AssetName, Quantity, Maybe (ScriptData, Hash ScriptData))]
Documentation
Configuration data type which does double-duty as the tag for the indexer.
MintBurn | |
|
Instances
Show MintBurn # | |
Indexer MintBurn # | |
Defined in Mafoc.Indexers.MintBurn description :: Text # toEvents :: Runtime MintBurn -> State MintBurn -> BlockInMode CardanoMode -> (State MintBurn, [Event MintBurn]) # initialize :: MintBurn -> Trace IO Text -> IO (State MintBurn, LocalChainsyncRuntime, Runtime MintBurn) # persistMany :: Runtime MintBurn -> [Event MintBurn] -> IO () # checkpoint :: Runtime MintBurn -> State MintBurn -> (SlotNo, Hash BlockHeader) -> IO () # | |
Show (Event MintBurn) # | |
ToRow (Event MintBurn) # | |
Defined in Mafoc.Indexers.MintBurn | |
data Event MintBurn # | |
Defined in Mafoc.Indexers.MintBurn | |
data Runtime MintBurn # | |
Defined in Mafoc.Indexers.MintBurn data Runtime MintBurn = Runtime {
| |
data State MintBurn # | |
Defined in Mafoc.Indexers.MintBurn |
toEventsPrim :: (PolicyId -> AssetName -> Bool) -> BlockInMode CardanoMode -> [Event MintBurn] #
Separate from class for reuse: this way we don't need to add dummy runtime and state when we want to call create MintBurn events outside of this indexer.
SQLite
sqliteInit :: Connection -> String -> IO () #
Get policy data
getPolicyData :: forall era. (Era (ShelleyLedgerEra era), EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto) => TxBody era -> MultiAsset StandardCrypto -> [(PolicyId, AssetName, Quantity, Maybe (ScriptData, Hash ScriptData))] #