Skip to content

Commit bb053ef

Browse files
committed
add docs for NodeQuery
1 parent e912460 commit bb053ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/BotPlutusInterface/CardanoNode/Effects.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@ import Ledger.Tx.CardanoAPI qualified as TxApi
4848
import Plutus.V2.Ledger.Tx qualified as V2
4949
import Prelude
5050

51+
{- | 'NodeQuery' effect is used to query local node,
52+
this is achieved by using 'Cardano.Api'.
53+
-}
5154
data NodeQuery a where
55+
-- | 'UtxosAt' queries local node to get all the utxos at particular address.
5256
UtxosAt :: Address -> NodeQuery (Either NodeQueryError (Map V2.TxOutRef ChainIndexTxOut))
57+
-- | 'PParams' queries local node to get it's 'ProtocolParameters'.
5358
PParams :: NodeQuery (Either NodeQueryError CApi.S.ProtocolParameters)
5459

5560
utxosAt ::
@@ -103,6 +108,7 @@ handleUtxosAt addr = runEitherT $ do
103108

104109
return $ Map.fromList $ zip txOutRefs chainIndexTxOuts
105110

111+
-- | 'runNodeQuery' runs executes the 'NodeQuery' effects.
106112
runNodeQuery :: PABConfig -> Eff '[NodeQuery, Reader NodeConn, IO] ~> IO
107113
runNodeQuery conf effs = do
108114
conn <- connectionInfo conf

0 commit comments

Comments
 (0)