| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Marconi.Api.UtxoIndexersQuery
Synopsis
- bootstrap :: TargetAddresses -> IO DBQueryEnv
- findByCardanoAddress :: DBQueryEnv -> AddressAny -> IO [UtxoRow]
- findByAddress :: DBQueryEnv -> Text -> IO (Either QueryExceptions UtxoTxOutReport)
- findAll :: DBQueryEnv -> IO [UtxoTxOutReport]
- reportQueryAddresses :: DBQueryEnv -> IO [Address ShelleyAddr]
- data UtxoRow = UtxoRow {}
- type UtxoIndex = SqliteIndex UtxoEvent Notification AddressAny Result
- reportQueryCardanoAddresses :: DBQueryEnv -> Text
- reportBech32Addresses :: DBQueryEnv -> [Text]
- withQueryAction :: DBQueryEnv -> AddressAny -> IO [UtxoRow]
- writeTMVar :: TMVar a -> a -> STM ()
Documentation
Arguments
| :: TargetAddresses | user provided target addresses |
| -> IO DBQueryEnv | returns Query runtime environment |
Bootstraps the utxo query environment. The module is responsible for accessing SQLite for quries. The main issue we try to avoid here is mixing inserts and quries in SQLite to avoid locking the database
Arguments
| :: DBQueryEnv | Query run time environment |
| -> AddressAny | Cardano address to query |
| -> IO [UtxoRow] |
Query utxos by Cardano Address To Cardano error may occure
Arguments
| :: DBQueryEnv | Query run time environment |
| -> Text | Bech32 Address |
| -> IO (Either QueryExceptions UtxoTxOutReport) | To Plutus address conversion error may occure |
Retrieve a Set of TxOutRefs associated with the given Cardano Era address We return an empty Set if no address is found
Arguments
| :: DBQueryEnv | Query run time environment |
| -> IO [UtxoTxOutReport] | set of corresponding TxOutRefs |
finds reports for all user-provided addresses. TODO consider sqlite streaming, https://hackage.haskell.org/package/sqlite-simple-0.4.18.2/docs/Database-SQLite-Simple.html#g:14
reportQueryAddresses :: DBQueryEnv -> IO [Address ShelleyAddr] Source #
report target addresses Used by JSON-RPC
Constructors
| UtxoRow | |
Fields
| |
Instances
| Eq UtxoRow | |
| Ord UtxoRow | |
Defined in Marconi.Index.Utxo | |
| Show UtxoRow | |
| Generic UtxoRow | |
| ToJSON UtxoRow Source # | |
| FromRow UtxoRow | |
| ToRow UtxoRow | |
| type Rep UtxoRow | |
Defined in Marconi.Index.Utxo type Rep UtxoRow = D1 ('MetaData "UtxoRow" "Marconi.Index.Utxo" "marconi-1.1.0.0-BO2L0UwGwl69Jz9Y6geoz2" 'False) (C1 ('MetaCons "UtxoRow" 'PrefixI 'True) (S1 ('MetaSel ('Just "_utxoRowUtxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Utxo) :*: (S1 ('MetaSel ('Just "_utxoRowSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "_utxoRowBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 BlockNo)))) | |
type UtxoIndex = SqliteIndex UtxoEvent Notification AddressAny Result Source #
reportBech32Addresses :: DBQueryEnv -> [Text] Source #
Arguments
| :: DBQueryEnv | Query run time environment |
| -> AddressAny | Cardano address to query |
| -> IO [UtxoRow] |
Execute the query function We must stop the utxo inserts before doing the query