marconi-mamba-1.1.0.0
Safe HaskellNone
LanguageHaskell2010

Marconi.Api.UtxoIndexersQuery

Synopsis

Documentation

bootstrap Source #

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

findByCardanoAddress Source #

Arguments

:: DBQueryEnv

Query run time environment

-> AddressAny

Cardano address to query

-> IO [UtxoRow] 

Query utxos by Cardano Address To Cardano error may occure

findByAddress Source #

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

findAll Source #

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

data UtxoRow Source #

Instances

Instances details
Eq UtxoRow 
Instance details

Defined in Marconi.Index.Utxo

Ord UtxoRow 
Instance details

Defined in Marconi.Index.Utxo

Show UtxoRow 
Instance details

Defined in Marconi.Index.Utxo

Generic UtxoRow 
Instance details

Defined in Marconi.Index.Utxo

Associated Types

type Rep UtxoRow :: Type -> Type Source #

ToJSON UtxoRow Source # 
Instance details

Defined in Marconi.Api.Types

FromRow UtxoRow 
Instance details

Defined in Marconi.Index.Utxo

ToRow UtxoRow 
Instance details

Defined in Marconi.Index.Utxo

Methods

toRow :: UtxoRow -> [SQLData] Source #

type Rep UtxoRow 
Instance details

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))))

withQueryAction 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

writeTMVar :: TMVar a -> a -> STM () Source #

Non-blocking write of a new value to a TMVar Puts if empty. Replaces if populated.