plutus-chain-index-core-0.1.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 Validator)

Get the validator from a validator hash (if available)

MintingPolicyFromHash :: MintingPolicyHash -> ChainIndexQueryEffect (Maybe 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 StakeValidator)

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

UnspentTxOutFromRef :: TxOutRef -> ChainIndexQueryEffect (Maybe ChainIndexTxOut)

Get the TxOut from a TxOutRef (if available)

UtxoSetMembership :: TxOutRef -> ChainIndexQueryEffect IsUtxoResponse

Whether a tx output is part of the UTXO set

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

Unspent outputs located at addresses with the given credential.

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.

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

Outputs located at addresses with the given credential.

GetTip :: ChainIndexQueryEffect Tip

Get the tip of the chain index

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 

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 #