| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Rpc.Server.Internal.UtxoRpc.Query
Synopsis
- readParamsMethod :: MonadRpc e m => Proto ReadParamsRequest -> m (Proto ReadParamsResponse)
- readUtxosMethod :: MonadRpc e m => Proto ReadUtxosRequest -> m (Proto ReadUtxosResponse)
- searchUtxosMethod :: MonadRpc e m => Proto SearchUtxosRequest -> m (Proto SearchUtxosResponse)
- readGenesisMethod :: MonadRpc e m => Proto ReadGenesisRequest -> m (Proto ReadGenesisResponse)
- readEraSummaryMethod :: MonadRpc e m => Proto ReadEraSummaryRequest -> m (Proto ReadEraSummaryResponse)
- paginateByTxIn :: (a -> Bool) -> Map TxIn a -> Maybe Text -> Int32 -> ([(TxIn, a)], Maybe Text)
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.
readEraSummaryMethod :: MonadRpc e m => Proto ReadEraSummaryRequest -> m (Proto ReadEraSummaryResponse) Source #
Handle the ReadEraSummary RPC method.
Returns the node's hard-fork era summary: one entry per era the node's
ledger state has seen so far, with name and start/end boundaries. See
eraSummariesToProto for exactly which fields are populated.
Arguments
| :: (a -> Bool) | keep only entries whose value satisfies the predicate |
| -> Map TxIn a | UTxO entries to paginate, in the map's key order |
| -> Maybe Text | start token: the |
| -> Int32 | maximum number of items per page (0 defaults to |
| -> ([(TxIn, a)], Maybe Text) | page of results and the next start token ( |
Paginate a Map of UTxO entries using cursor-based pagination.
The map is already ordered by TxIn's Ord instance (lexicographic on TxId, then numeric
on TxIx), so no sort is needed.
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.