plutus-chain-index-core-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.ChainIndex.Effects

Description

Freer effects for querying and updating the chain index state.

Synopsis

Query effect

data ChainIndexQueryEffect r where Source #

Constructors

DatumFromHash :: DatumHash -> ChainIndexQueryEffect (Maybe Datum)

Get the datum from a datum hash (if available)

ValidatorFromHash :: ValidatorHash -> ChainIndexQueryEffect (Maybe (Versioned Validator))

Get the validator from a validator hash (if available)

MintingPolicyFromHash :: MintingPolicyHash -> ChainIndexQueryEffect (Maybe (Versioned MintingPolicy))

Get the monetary policy from an MPS hash (if available)

RedeemerFromHash :: RedeemerHash -> ChainIndexQueryEffect (Maybe Redeemer)

Get the redeemer from a redeemer hash (if available)

StakeValidatorFromHash :: StakeValidatorHash -> ChainIndexQueryEffect (Maybe (Versioned StakeValidator))

Get the stake validator from a stake validator hash (if available)

UnspentTxOutFromRef :: TxOutRef -> ChainIndexQueryEffect (Maybe DecoratedTxOut)

Get the TxOut from a TxOutRef (if available)

TxOutFromRef :: TxOutRef -> ChainIndexQueryEffect (Maybe DecoratedTxOut)

Get the TxOut from a TxOutRef (if available)

TxFromTxId :: TxId -> ChainIndexQueryEffect (Maybe ChainIndexTx)

Get the transaction for a tx ID

UtxoSetMembership :: TxOutRef -> ChainIndexQueryEffect IsUtxoResponse

Whether a tx output is part of the UTXO set

UtxoSetAtAddress :: PageQuery TxOutRef -> CardanoAddress -> ChainIndexQueryEffect UtxosResponse

Unspent outputs located at addresses with the given address.

UnspentTxOutSetAtAddress :: PageQuery TxOutRef -> CardanoAddress -> ChainIndexQueryEffect (QueryResponse [(TxOutRef, DecoratedTxOut)])

Get the unspent txouts located at an address This is to avoid multiple queries from chain-index when using utxosAt

DatumsAtAddress :: PageQuery TxOutRef -> CardanoAddress -> ChainIndexQueryEffect (QueryResponse [Datum])

get the datums located at addresses with the given address.

UtxoSetWithCurrency :: PageQuery TxOutRef -> AssetClass -> ChainIndexQueryEffect UtxosResponse

Unspent outputs containing a specific currency (AssetClass).

Note that requesting unspent outputs containing Ada should not return anything, as this request will always return all unspent outputs.

TxsFromTxIds :: [TxId] -> ChainIndexQueryEffect [ChainIndexTx]

Get the transactions for a list of tx IDs.

TxoSetAtAddress :: PageQuery TxOutRef -> CardanoAddress -> ChainIndexQueryEffect TxosResponse

Outputs located at addresses with the given address.

GetTip :: ChainIndexQueryEffect Tip

Get the tip of the chain index

datumFromHash :: forall effs. Member ChainIndexQueryEffect effs => DatumHash -> Eff effs (Maybe Datum) Source #

validatorFromHash :: forall effs. Member ChainIndexQueryEffect effs => ValidatorHash -> Eff effs (Maybe (Versioned Validator)) Source #

mintingPolicyFromHash :: forall effs. Member ChainIndexQueryEffect effs => MintingPolicyHash -> Eff effs (Maybe (Versioned MintingPolicy)) Source #

stakeValidatorFromHash :: forall effs. Member ChainIndexQueryEffect effs => StakeValidatorHash -> Eff effs (Maybe (Versioned StakeValidator)) Source #

redeemerFromHash :: forall effs. Member ChainIndexQueryEffect effs => RedeemerHash -> Eff effs (Maybe Redeemer) Source #

txOutFromRef :: forall effs. Member ChainIndexQueryEffect effs => TxOutRef -> Eff effs (Maybe DecoratedTxOut) Source #

unspentTxOutFromRef :: forall effs. Member ChainIndexQueryEffect effs => TxOutRef -> Eff effs (Maybe DecoratedTxOut) Source #

txFromTxId :: forall effs. Member ChainIndexQueryEffect effs => TxId -> Eff effs (Maybe ChainIndexTx) Source #

utxoSetMembership :: forall effs. Member ChainIndexQueryEffect effs => TxOutRef -> Eff effs IsUtxoResponse Source #

utxoSetAtAddress :: forall effs. Member ChainIndexQueryEffect effs => PageQuery TxOutRef -> CardanoAddress -> Eff effs UtxosResponse Source #

unspentTxOutSetAtAddress :: forall effs. Member ChainIndexQueryEffect effs => PageQuery TxOutRef -> CardanoAddress -> Eff effs (QueryResponse [(TxOutRef, DecoratedTxOut)]) Source #

datumsAtAddress :: forall effs. Member ChainIndexQueryEffect effs => PageQuery TxOutRef -> CardanoAddress -> Eff effs (QueryResponse [Datum]) Source #

utxoSetWithCurrency :: forall effs. Member ChainIndexQueryEffect effs => PageQuery TxOutRef -> AssetClass -> Eff effs UtxosResponse Source #

txoSetAtAddress :: forall effs. Member ChainIndexQueryEffect effs => PageQuery TxOutRef -> CardanoAddress -> Eff effs TxosResponse Source #

txsFromTxIds :: forall effs. Member ChainIndexQueryEffect effs => [TxId] -> Eff effs [ChainIndexTx] Source #

getTip :: forall effs. Member ChainIndexQueryEffect effs => Eff effs Tip Source #

Control effect

data ChainIndexControlEffect r where Source #

Constructors

AppendBlocks :: [ChainSyncBlock] -> ChainIndexControlEffect ()

Add new blocks to the chain index.

Rollback :: Point -> ChainIndexControlEffect ()

Roll back to a previous state (previous tip)

ResumeSync :: Point -> ChainIndexControlEffect ()

Resume syncing from a certain point

CollectGarbage :: ChainIndexControlEffect ()

Delete all data that is not covered by current UTxOs.

GetDiagnostics :: ChainIndexControlEffect Diagnostics 

appendBlocks :: forall effs. Member ChainIndexControlEffect effs => [ChainSyncBlock] -> Eff effs () Source #

rollback :: forall effs. Member ChainIndexControlEffect effs => Point -> Eff effs () Source #

resumeSync :: forall effs. Member ChainIndexControlEffect effs => Point -> Eff effs () Source #

collectGarbage :: forall effs. Member ChainIndexControlEffect effs => Eff effs () Source #

getDiagnostics :: forall effs. Member ChainIndexControlEffect effs => Eff effs Diagnostics Source #