import type { PackageServiceClient } from "../../services/package/package-service-client.js"; import type { StateServiceClient } from "../../services/state/state-service-client.js"; import type { UpdateServiceClient } from "../../services/update/update-service-client.js"; import type { CantonLogger } from "../../core/types/canton-logger.js"; import { type QueryDataset } from "../canonical/query-dataset.js"; import type { NormalizedAggregateQuery, NormalizedCountQuery, NormalizedFindManyQuery, NormalizedFindUniqueQuery, NormalizedGroupByQuery } from "../canonical/query-ast.js"; import type { ContractCacheArgs, ContractCacheInspection, ContractCacheResult, QueryClient } from "../query-client.js"; import { QuerySource } from "../query-source.js"; import { GrpcContractCache } from "./grpc-contract-cache.js"; type NormalizedQuery = NormalizedFindManyQuery | NormalizedFindUniqueQuery | NormalizedCountQuery | NormalizedAggregateQuery | NormalizedGroupByQuery; /** The sole transport boundary used by every typed gRPC query delegate. */ interface GrpcQueryDataProvider { readDatasetAsync(query: NormalizedQuery): Promise; } export interface GrpcQueryClientOptions { readonly stateService: Pick; readonly updateService: Pick; readonly packageService: Pick; readonly contractCache?: GrpcContractCache; readonly endpointScope?: string; /** * Opt-in: after the first history replay, keep the materialized window in memory and only fetch offsets * past it on later history queries — turning repeat full replays into delta reads. Off by default because * the retained window lives for this client's lifetime and its RAM cost is the full replayed history. */ readonly incrementalHistory?: boolean; /** * Opt-in: permit queries that replay ledger history (transactions/events/exercises, and contracts * queries reaching archived state). Off by default — such queries throw HistoryWalkRequiredError so the * replay cost is never paid implicitly. */ readonly walkHistory?: boolean; /** Receives SDK diagnostics (e.g. the once-per-relation full-replay warning); defaults to console. */ readonly logger?: CantonLogger; } export declare class GrpcQueryClient implements QueryClient { private readonly options; readonly source = QuerySource.grpc; private readonly evaluator; private readonly dataProvider; readonly contracts: QueryClient["contracts"]; readonly contractTypes: QueryClient["contractTypes"]; readonly events: QueryClient["events"]; readonly exercises: QueryClient["exercises"]; readonly exerciseTypes: QueryClient["exerciseTypes"]; readonly packages: QueryClient["packages"]; readonly transactions: QueryClient["transactions"]; readonly watermark: QueryClient["watermark"]; constructor(options: GrpcQueryClientOptions, dataProvider?: GrpcQueryDataProvider); $queryRaw(_sql: string, _values?: readonly unknown[]): Promise; cacheContracts(args?: ContractCacheArgs): Promise; invalidateContractsCache(args?: ContractCacheArgs): Promise; inspectContractsCache(args?: ContractCacheArgs): Promise; private delegate; private collectionDelegate; private execute; } export {};