plutus-chain-index-core-1.2.0.0
Safe Haskell None
Language Haskell2010

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 -> Credential -> ChainIndexQueryEffect UtxosResponse

Unspent outputs located at addresses with the given credential.

UnspentTxOutSetAtAddress :: PageQuery TxOutRef -> Credential -> 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 -> Credential -> ChainIndexQueryEffect ( QueryResponse [ Datum ])

get the datums 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.

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

Get the transactions for a list of tx IDs.

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

Outputs located at addresses with the given credential.

GetTip :: ChainIndexQueryEffect Tip

Get the tip of the chain index

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