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.

readGenesisMethod :: MonadRpc e m => Proto ReadGenesisRequest -> m (Proto ReadGenesisResponse) Source #

Handle the ReadGenesis RPC method. Returns the chain's identity - the Shelley genesis hash and the CAIP-2 chain identifier - together with the cardano config, the Byron, Shelley, Alonzo and Conway genesis parameters mapped by genesisBundleToProto.

The whole Shelley genesis comes from the bundle's cache, so the file is only read on a cache miss. The FAILED_PRECONDITION that readShelleyGenesisWithInitialFunds raises for a genesis file that has changed since the node started is therefore raised on cache misses only: a file edited while the cache is warm goes unnoticed until the cache next empties, which is at most five idle minutes later.

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.