Skip to main content

Module request

Module request 

Source
Expand description

Typed request builders for the client’s read paths.

The plain client methods (CantonClient::updates, CantonClient::completions) cover the common case — wildcard filters, ledger-effects shape, an unbounded stream — with a two-argument call. These builders open up the rest of the request surface without touching those signatures: a bounded stream for catch-up reads (until), template and interface filters, the ACS-delta shape, created-event blobs, and the completion stream’s user_id.

Defaults match the plain methods exactly, so client.updates_with(UpdatesRequest::new(parties, 0)) and client.updates(parties, 0) issue the same wire request.

use canton_ledger::request::UpdatesRequest;
use tokio_stream::StreamExt as _;

// A bounded catch-up read: everything between two offsets, one template.
let stream = client
    .updates_with(
        UpdatesRequest::new(vec![party], 0)
            .until(41_000)
            .for_templates(["#my-app:My.Module:Asset"])?,
    )
    .await?;
tokio::pin!(stream);
while let Some(update) = stream.next().await {
    println!("{:?}", update?);
}

Structs§

ActiveContractsRequest
A builder for the Active Contract Set reads (CantonClient::active_contracts_with, CantonClient::active_contracts_page_with, CantonClient::active_contracts_resumable_with): the snapshot with the full request surface exposed.
CompletionsRequest
A builder for CantonClient::completions_with: the command-completion stream with the full request surface exposed.
UpdatesRequest
A builder for CantonClient::updates_with / CantonClient::updates_resumable_with: the update stream with the full request surface exposed.

Enums§

TransactionShape
The shape of transactions in an update stream — which events are returned and who has to see them (see the Ledger API’s TransactionShape).