File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/BotPlutusInterface/CardanoNode Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,13 @@ import Ledger.Tx.CardanoAPI qualified as TxApi
4848import Plutus.V2.Ledger.Tx qualified as V2
4949import Prelude
5050
51+ {- | 'NodeQuery' effect is used to query local node,
52+ this is achieved by using 'Cardano.Api'.
53+ -}
5154data 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
5560utxosAt ::
@@ -103,6 +108,7 @@ handleUtxosAt addr = runEitherT $ do
103108
104109 return $ Map. fromList $ zip txOutRefs chainIndexTxOuts
105110
111+ -- | 'runNodeQuery' runs executes the 'NodeQuery' effects.
106112runNodeQuery :: PABConfig -> Eff '[NodeQuery , Reader NodeConn , IO ] ~> IO
107113runNodeQuery conf effs = do
108114 conn <- connectionInfo conf
You can’t perform that action at this time.
0 commit comments