Skip to main content

canton_proto/
lib.rs

1//! Generated Canton Ledger API v2 gRPC types and client stubs.
2//!
3//! This crate is internal SDK plumbing: the modules mirror the proto package
4//! tree (`com.daml.ledger.api.v2` and friends, plus `google.rpc`). Generated
5//! code is not held to the workspace lint set.
6//!
7//! # Stability policy
8//!
9//! The generated types are **exempt from the SDK's SemVer guarantees**: their
10//! shape is owned by the wire protocol, not this SDK. They track the vendored
11//! `.proto` files, which are **pinned to a Canton release** (currently 3.5.7)
12//! and re-vendored when the supported Canton range moves — such re-vendoring
13//! (and `prost`/`tonic` major bumps) may change these types in any release.
14//! Until the M2 typed bindings land, client crates intentionally expose these
15//! wire types on the dynamic path (re-exported as `canton_ledger::proto` and
16//! friends); treat that surface as *protocol-stable* (stable while the pinned
17//! Canton release line is stable) rather than *SemVer-stable*. The hand-written
18//! SDK types (`Config`, `Error`, builders, clients) carry the SemVer promise.
19#![allow(missing_docs, clippy::all, clippy::pedantic, clippy::nursery)]
20#![allow(clippy::large_enum_variant, clippy::doc_lazy_continuation)]
21#![allow(rustdoc::all)]
22
23/// `google.rpc` types imported by the Ledger API (e.g. `Status` in completions).
24pub mod google {
25    pub mod rpc {
26        tonic::include_proto!("google.rpc");
27    }
28}
29
30/// The canonical gRPC health-checking service (`grpc.health.v1`), which Canton
31/// serves on the Ledger API port for node health probes.
32pub mod grpc {
33    pub mod health {
34        pub mod v1 {
35            tonic::include_proto!("grpc.health.v1");
36        }
37    }
38}
39
40/// ScalaPB custom-options types imported by the Canton admin-api protos.
41pub mod scalapb {
42    tonic::include_proto!("scalapb");
43}
44
45/// The Canton / Daml proto package tree (`com.daml.*` Ledger API and
46/// `com.digitalasset.canton.*` admin API).
47pub mod com {
48    pub mod daml {
49        pub mod ledger {
50            pub mod api {
51                pub mod v2 {
52                    tonic::include_proto!("com.daml.ledger.api.v2");
53
54                    pub mod admin {
55                        tonic::include_proto!("com.daml.ledger.api.v2.admin");
56                    }
57
58                    pub mod interactive {
59                        tonic::include_proto!("com.daml.ledger.api.v2.interactive");
60
61                        pub mod transaction {
62                            pub mod v1 {
63                                tonic::include_proto!(
64                                    "com.daml.ledger.api.v2.interactive.transaction.v1"
65                                );
66                            }
67                        }
68                    }
69
70                    pub mod testing {
71                        tonic::include_proto!("com.daml.ledger.api.v2.testing");
72                    }
73                }
74            }
75        }
76    }
77
78    /// Canton admin-api proto tree (topology read service + its dependencies).
79    pub mod digitalasset {
80        pub mod canton {
81            pub mod crypto {
82                pub mod v30 {
83                    tonic::include_proto!("com.digitalasset.canton.crypto.v30");
84                }
85            }
86            pub mod protocol {
87                pub mod v30 {
88                    tonic::include_proto!("com.digitalasset.canton.protocol.v30");
89                }
90            }
91            pub mod topology {
92                pub mod admin {
93                    pub mod v30 {
94                        tonic::include_proto!("com.digitalasset.canton.topology.admin.v30");
95                    }
96                }
97            }
98        }
99    }
100}