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//! Client crates expose these wire types on the **dynamic** command path
15//! (re-exported as `canton_ledger::proto` and friends); treat that surface as
16//! *protocol-stable* (stable while the pinned Canton release line is stable)
17//! rather than *SemVer-stable*. The hand-written SDK types (`Config`, `Error`,
18//! builders, clients) carry the SemVer promise. For typed payloads generated
19//! from a DAR, use `canton-codegen` with the `canton-daml` runtime instead.
20#![allow(missing_docs, clippy::all, clippy::pedantic, clippy::nursery)]
21#![allow(clippy::large_enum_variant, clippy::doc_lazy_continuation)]
22#![allow(rustdoc::all)]
23
24/// `google.rpc` types imported by the Ledger API (e.g. `Status` in completions).
25pub mod google {
26    pub mod rpc {
27        tonic::include_proto!("google.rpc");
28    }
29}
30
31/// The canonical gRPC health-checking service (`grpc.health.v1`), which Canton
32/// serves on the Ledger API port for node health probes.
33pub mod grpc {
34    pub mod health {
35        pub mod v1 {
36            tonic::include_proto!("grpc.health.v1");
37        }
38    }
39}
40
41/// ScalaPB custom-options types imported by the Canton admin-api protos.
42pub mod scalapb {
43    tonic::include_proto!("scalapb");
44}
45
46/// The Canton / Daml proto package tree (`com.daml.*` Ledger API and
47/// `com.digitalasset.canton.*` admin API).
48pub mod com {
49    pub mod daml {
50        pub mod ledger {
51            pub mod api {
52                pub mod v2 {
53                    tonic::include_proto!("com.daml.ledger.api.v2");
54
55                    pub mod admin {
56                        tonic::include_proto!("com.daml.ledger.api.v2.admin");
57                    }
58
59                    pub mod interactive {
60                        tonic::include_proto!("com.daml.ledger.api.v2.interactive");
61
62                        pub mod transaction {
63                            pub mod v1 {
64                                tonic::include_proto!(
65                                    "com.daml.ledger.api.v2.interactive.transaction.v1"
66                                );
67                            }
68                        }
69                    }
70
71                    pub mod testing {
72                        tonic::include_proto!("com.daml.ledger.api.v2.testing");
73                    }
74                }
75            }
76        }
77    }
78
79    /// Canton admin-api proto tree (topology read service + its dependencies).
80    pub mod digitalasset {
81        pub mod canton {
82            pub mod crypto {
83                pub mod v30 {
84                    tonic::include_proto!("com.digitalasset.canton.crypto.v30");
85                }
86            }
87            pub mod protocol {
88                pub mod v30 {
89                    tonic::include_proto!("com.digitalasset.canton.protocol.v30");
90                }
91            }
92            pub mod topology {
93                pub mod admin {
94                    pub mod v30 {
95                        tonic::include_proto!("com.digitalasset.canton.topology.admin.v30");
96                    }
97                }
98            }
99        }
100    }
101}