cardano-rpc
Safe HaskellNone
LanguageHaskell2010

Cardano.Rpc.Server.Internal.UtxoRpc.Query

Synopsis

Documentation

readParamsMethod :: MonadRpc e m => Proto ReadParamsRequest -> m (Proto ReadParamsResponse) Source #

Handle the ReadParams RPC method. Queries the node for current protocol parameters and returns them along with the ledger tip.

readUtxosMethod :: MonadRpc e m => Proto ReadUtxosRequest -> m (Proto ReadUtxosResponse) Source #

Handle the ReadUtxos RPC method. Looks up specific UTxO entries by their TxIn keys and returns them along with the ledger tip. Returns an empty response when no keys are provided, matching other UTxO RPC implementations (Dolos, cardano-node-api, Dingo).

searchUtxosMethod :: MonadRpc e m => Proto SearchUtxosRequest -> m (Proto SearchUtxosResponse) Source #

Handle the SearchUtxos RPC method. Filters the UTxO set by a predicate and returns a paginated result. The predicate must contain exact address matches so the query can be narrowed; broad predicates are rejected with INVALID_ARGUMENT.

paginateByTxIn Source #

Arguments

:: [(TxIn, a)]

UTxO entries to paginate

-> Maybe Text

start token: the renderTxIn of the last TxIn from the previous page, or Nothing for the first page

-> Int32

maximum number of items per page (0 defaults to defaultPageSize, capped at maxPageSize)

-> ([(TxIn, a)], Maybe Text)

page of results and the next start token (Nothing when there are no more pages)

Paginate a list of UTxO entries using cursor-based pagination. Items are sorted by TxIn's Ord instance (lexicographic on TxId, then numeric on TxIx). The start token is the renderTxIn of the last item on the previous page; all items up to and including it are skipped, so the next page begins immediately after that cursor.