Skip to main content

xmtp_proto/gen/
xmtp.xmtpv4.message_api.rs

1// This file is @generated by prost-build.
2/// Query for envelopes, shared by query and subscribe endpoints
3/// Either topics or originator_node_ids may be set, but not both
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct EnvelopesQuery {
6    /// Client queries
7    #[prost(bytes = "vec", repeated, tag = "1")]
8    pub topics: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
9    /// Node queries
10    #[prost(uint32, repeated, tag = "2")]
11    pub originator_node_ids: ::prost::alloc::vec::Vec<u32>,
12    #[prost(message, optional, tag = "3")]
13    pub last_seen: ::core::option::Option<super::envelopes::Cursor>,
14}
15impl ::prost::Name for EnvelopesQuery {
16    const NAME: &'static str = "EnvelopesQuery";
17    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
18    fn full_name() -> ::prost::alloc::string::String {
19        "xmtp.xmtpv4.message_api.EnvelopesQuery".into()
20    }
21    fn type_url() -> ::prost::alloc::string::String {
22        "/xmtp.xmtpv4.message_api.EnvelopesQuery".into()
23    }
24}
25/// Batch subscribe to envelopes
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct SubscribeEnvelopesRequest {
28    #[prost(message, optional, tag = "1")]
29    pub query: ::core::option::Option<EnvelopesQuery>,
30}
31impl ::prost::Name for SubscribeEnvelopesRequest {
32    const NAME: &'static str = "SubscribeEnvelopesRequest";
33    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
34    fn full_name() -> ::prost::alloc::string::String {
35        "xmtp.xmtpv4.message_api.SubscribeEnvelopesRequest".into()
36    }
37    fn type_url() -> ::prost::alloc::string::String {
38        "/xmtp.xmtpv4.message_api.SubscribeEnvelopesRequest".into()
39    }
40}
41/// Request to subscribe to a series of topics, with a separate cursor for each topic
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct SubscribeTopicsRequest {
44    #[prost(message, repeated, tag = "1")]
45    pub filters: ::prost::alloc::vec::Vec<subscribe_topics_request::TopicFilter>,
46}
47/// Nested message and enum types in `SubscribeTopicsRequest`.
48pub mod subscribe_topics_request {
49    #[derive(Clone, PartialEq, ::prost::Message)]
50    pub struct TopicFilter {
51        #[prost(bytes = "vec", tag = "1")]
52        pub topic: ::prost::alloc::vec::Vec<u8>,
53        #[prost(message, optional, tag = "2")]
54        pub last_seen: ::core::option::Option<super::super::envelopes::Cursor>,
55    }
56    impl ::prost::Name for TopicFilter {
57        const NAME: &'static str = "TopicFilter";
58        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
59        fn full_name() -> ::prost::alloc::string::String {
60            "xmtp.xmtpv4.message_api.SubscribeTopicsRequest.TopicFilter".into()
61        }
62        fn type_url() -> ::prost::alloc::string::String {
63            "/xmtp.xmtpv4.message_api.SubscribeTopicsRequest.TopicFilter".into()
64        }
65    }
66}
67impl ::prost::Name for SubscribeTopicsRequest {
68    const NAME: &'static str = "SubscribeTopicsRequest";
69    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
70    fn full_name() -> ::prost::alloc::string::String {
71        "xmtp.xmtpv4.message_api.SubscribeTopicsRequest".into()
72    }
73    fn type_url() -> ::prost::alloc::string::String {
74        "/xmtp.xmtpv4.message_api.SubscribeTopicsRequest".into()
75    }
76}
77/// Response to SubscribeTopics
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct SubscribeTopicsResponse {
80    #[prost(oneof = "subscribe_topics_response::Response", tags = "1, 2")]
81    pub response: ::core::option::Option<subscribe_topics_response::Response>,
82}
83/// Nested message and enum types in `SubscribeTopicsResponse`.
84pub mod subscribe_topics_response {
85    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
86    pub struct StatusUpdate {
87        #[prost(enumeration = "SubscriptionStatus", tag = "1")]
88        pub status: i32,
89    }
90    impl ::prost::Name for StatusUpdate {
91        const NAME: &'static str = "StatusUpdate";
92        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
93        fn full_name() -> ::prost::alloc::string::String {
94            "xmtp.xmtpv4.message_api.SubscribeTopicsResponse.StatusUpdate".into()
95        }
96        fn type_url() -> ::prost::alloc::string::String {
97            "/xmtp.xmtpv4.message_api.SubscribeTopicsResponse.StatusUpdate".into()
98        }
99    }
100    #[derive(Clone, PartialEq, ::prost::Message)]
101    pub struct Envelopes {
102        #[prost(message, repeated, tag = "1")]
103        pub envelopes: ::prost::alloc::vec::Vec<
104            super::super::envelopes::OriginatorEnvelope,
105        >,
106    }
107    impl ::prost::Name for Envelopes {
108        const NAME: &'static str = "Envelopes";
109        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
110        fn full_name() -> ::prost::alloc::string::String {
111            "xmtp.xmtpv4.message_api.SubscribeTopicsResponse.Envelopes".into()
112        }
113        fn type_url() -> ::prost::alloc::string::String {
114            "/xmtp.xmtpv4.message_api.SubscribeTopicsResponse.Envelopes".into()
115        }
116    }
117    #[derive(
118        Clone,
119        Copy,
120        Debug,
121        PartialEq,
122        Eq,
123        Hash,
124        PartialOrd,
125        Ord,
126        ::prost::Enumeration
127    )]
128    #[repr(i32)]
129    pub enum SubscriptionStatus {
130        Unspecified = 0,
131        Started = 1,
132        CatchupComplete = 2,
133        Waiting = 3,
134    }
135    impl SubscriptionStatus {
136        /// String value of the enum field names used in the ProtoBuf definition.
137        ///
138        /// The values are not transformed in any way and thus are considered stable
139        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
140        pub fn as_str_name(&self) -> &'static str {
141            match self {
142                Self::Unspecified => "SUBSCRIPTION_STATUS_UNSPECIFIED",
143                Self::Started => "SUBSCRIPTION_STATUS_STARTED",
144                Self::CatchupComplete => "SUBSCRIPTION_STATUS_CATCHUP_COMPLETE",
145                Self::Waiting => "SUBSCRIPTION_STATUS_WAITING",
146            }
147        }
148        /// Creates an enum from field names used in the ProtoBuf definition.
149        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
150            match value {
151                "SUBSCRIPTION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
152                "SUBSCRIPTION_STATUS_STARTED" => Some(Self::Started),
153                "SUBSCRIPTION_STATUS_CATCHUP_COMPLETE" => Some(Self::CatchupComplete),
154                "SUBSCRIPTION_STATUS_WAITING" => Some(Self::Waiting),
155                _ => None,
156            }
157        }
158    }
159    #[derive(Clone, PartialEq, ::prost::Oneof)]
160    pub enum Response {
161        #[prost(message, tag = "1")]
162        Envelopes(Envelopes),
163        #[prost(message, tag = "2")]
164        StatusUpdate(StatusUpdate),
165    }
166}
167impl ::prost::Name for SubscribeTopicsResponse {
168    const NAME: &'static str = "SubscribeTopicsResponse";
169    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
170    fn full_name() -> ::prost::alloc::string::String {
171        "xmtp.xmtpv4.message_api.SubscribeTopicsResponse".into()
172    }
173    fn type_url() -> ::prost::alloc::string::String {
174        "/xmtp.xmtpv4.message_api.SubscribeTopicsResponse".into()
175    }
176}
177/// Streamed response for batch subscribe - can be multiple envelopes at once
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct SubscribeEnvelopesResponse {
180    #[prost(message, repeated, tag = "1")]
181    pub envelopes: ::prost::alloc::vec::Vec<super::envelopes::OriginatorEnvelope>,
182}
183impl ::prost::Name for SubscribeEnvelopesResponse {
184    const NAME: &'static str = "SubscribeEnvelopesResponse";
185    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
186    fn full_name() -> ::prost::alloc::string::String {
187        "xmtp.xmtpv4.message_api.SubscribeEnvelopesResponse".into()
188    }
189    fn type_url() -> ::prost::alloc::string::String {
190        "/xmtp.xmtpv4.message_api.SubscribeEnvelopesResponse".into()
191    }
192}
193/// Client -> node. Sent one or more times over the life of the stream.
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct SubscribeRequest {
196    #[prost(oneof = "subscribe_request::Version", tags = "1")]
197    pub version: ::core::option::Option<subscribe_request::Version>,
198}
199/// Nested message and enum types in `SubscribeRequest`.
200pub mod subscribe_request {
201    #[derive(Clone, PartialEq, ::prost::Message)]
202    pub struct V1 {
203        /// Each frame is exactly one of: a mutation, a Ping, or a Pong.
204        #[prost(oneof = "v1::Request", tags = "1, 2, 3")]
205        pub request: ::core::option::Option<v1::Request>,
206    }
207    /// Nested message and enum types in `V1`.
208    pub mod v1 {
209        /// Add and/or remove subscriptions in place (applied atomically per frame).
210        /// Topics use the kind-prefixed binary representation (XIP-49 §3.3.2): the
211        /// first byte is the topic kind, the remainder is the identifier. A topic
212        /// whose kind the node does not serve fails the stream with INVALID_ARGUMENT.
213        #[derive(Clone, PartialEq, ::prost::Message)]
214        pub struct Mutate {
215            /// begin delivering these topics
216            #[prost(message, repeated, tag = "1")]
217            pub adds: ::prost::alloc::vec::Vec<mutate::Subscription>,
218            /// topics to stop delivering
219            #[prost(bytes = "vec", repeated, tag = "2")]
220            pub removes: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
221            /// Catch this Mutate's adds up to the live edge — history, TopicsLive
222            /// markers, and the wave's CatchupComplete — but do NOT register them for
223            /// live delivery. The markers then mean "you have everything as of now".
224            /// Combined with half-closing the request stream, this is the bounded
225            /// catch-up ("sync") mode: the node finishes the wave then closes the
226            /// stream itself. Removals in the Mutate are unaffected.
227            #[prost(bool, tag = "3")]
228            pub history_only: bool,
229            /// Client-chosen correlation id, echoed on this wave's CatchupComplete so
230            /// completions are attributable when waves overlap. SHOULD be unique per
231            /// stream; 0 = no correlation requested (still echoed as 0).
232            #[prost(uint64, tag = "4")]
233            pub mutate_id: u64,
234        }
235        /// Nested message and enum types in `Mutate`.
236        pub mod mutate {
237            /// A topic to subscribe, with the vector cursor to resume from.
238            #[derive(Clone, PartialEq, ::prost::Message)]
239            pub struct Subscription {
240                #[prost(bytes = "vec", tag = "1")]
241                pub topic: ::prost::alloc::vec::Vec<u8>,
242                /// Resume point: deliver envelopes beyond this per-originator vector
243                /// cursor. Omitted/empty = from the beginning. Originators absent from
244                /// the cursor map are treated as sequence 0 (the node fills them in),
245                /// mirroring SubscribeTopics.TopicFilter.last_seen.
246                #[prost(message, optional, tag = "2")]
247                pub last_seen: ::core::option::Option<
248                    super::super::super::super::envelopes::Cursor,
249                >,
250            }
251            impl ::prost::Name for Subscription {
252                const NAME: &'static str = "Subscription";
253                const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
254                fn full_name() -> ::prost::alloc::string::String {
255                    "xmtp.xmtpv4.message_api.SubscribeRequest.V1.Mutate.Subscription"
256                        .into()
257                }
258                fn type_url() -> ::prost::alloc::string::String {
259                    "/xmtp.xmtpv4.message_api.SubscribeRequest.V1.Mutate.Subscription"
260                        .into()
261                }
262            }
263        }
264        impl ::prost::Name for Mutate {
265            const NAME: &'static str = "Mutate";
266            const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
267            fn full_name() -> ::prost::alloc::string::String {
268                "xmtp.xmtpv4.message_api.SubscribeRequest.V1.Mutate".into()
269            }
270            fn type_url() -> ::prost::alloc::string::String {
271                "/xmtp.xmtpv4.message_api.SubscribeRequest.V1.Mutate".into()
272            }
273        }
274        /// Each frame is exactly one of: a mutation, a Ping, or a Pong.
275        #[derive(Clone, PartialEq, ::prost::Oneof)]
276        pub enum Request {
277            #[prost(message, tag = "1")]
278            Mutate(Mutate),
279            /// liveness challenge (e.g. probe the link after resuming)
280            #[prost(message, tag = "2")]
281            Ping(super::super::Ping),
282            /// answer to a node Ping
283            #[prost(message, tag = "3")]
284            Pong(super::super::Pong),
285        }
286    }
287    impl ::prost::Name for V1 {
288        const NAME: &'static str = "V1";
289        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
290        fn full_name() -> ::prost::alloc::string::String {
291            "xmtp.xmtpv4.message_api.SubscribeRequest.V1".into()
292        }
293        fn type_url() -> ::prost::alloc::string::String {
294            "/xmtp.xmtpv4.message_api.SubscribeRequest.V1".into()
295        }
296    }
297    #[derive(Clone, PartialEq, ::prost::Oneof)]
298    pub enum Version {
299        #[prost(message, tag = "1")]
300        V1(V1),
301    }
302}
303impl ::prost::Name for SubscribeRequest {
304    const NAME: &'static str = "SubscribeRequest";
305    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
306    fn full_name() -> ::prost::alloc::string::String {
307        "xmtp.xmtpv4.message_api.SubscribeRequest".into()
308    }
309    fn type_url() -> ::prost::alloc::string::String {
310        "/xmtp.xmtpv4.message_api.SubscribeRequest".into()
311    }
312}
313/// Node -> client.
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct SubscribeResponse {
316    #[prost(oneof = "subscribe_response::Version", tags = "1")]
317    pub version: ::core::option::Option<subscribe_response::Version>,
318}
319/// Nested message and enum types in `SubscribeResponse`.
320pub mod subscribe_response {
321    #[derive(Clone, PartialEq, ::prost::Message)]
322    pub struct V1 {
323        #[prost(oneof = "v1::Response", tags = "1, 2, 3, 4, 5, 6")]
324        pub response: ::core::option::Option<v1::Response>,
325    }
326    /// Nested message and enum types in `V1`.
327    pub mod v1 {
328        /// A batch of envelopes across the active subscriptions; the client demuxes
329        /// by each envelope's target topic.
330        #[derive(Clone, PartialEq, ::prost::Message)]
331        pub struct Envelopes {
332            #[prost(message, repeated, tag = "1")]
333            pub envelopes: ::prost::alloc::vec::Vec<
334                super::super::super::envelopes::OriginatorEnvelope,
335            >,
336        }
337        impl ::prost::Name for Envelopes {
338            const NAME: &'static str = "Envelopes";
339            const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
340            fn full_name() -> ::prost::alloc::string::String {
341                "xmtp.xmtpv4.message_api.SubscribeResponse.V1.Envelopes".into()
342            }
343            fn type_url() -> ::prost::alloc::string::String {
344                "/xmtp.xmtpv4.message_api.SubscribeResponse.V1.Envelopes".into()
345            }
346        }
347        /// The first frame on every stream.
348        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
349        pub struct Started {
350            /// The node's ping cadence (ms): the basis for the client's staleness
351            /// threshold and the node's reap deadline.
352            #[prost(uint32, tag = "1")]
353            pub keepalive_interval_ms: u32,
354            /// Optional protocol features the node supports on this stream. The node
355            /// silently ignores request types it does not understand, so a client MUST
356            /// NOT send an optional request type whose capability the node did not
357            /// advertise (it would hang waiting on a response that never comes).
358            #[prost(enumeration = "Capability", repeated, tag = "2")]
359            pub capabilities: ::prost::alloc::vec::Vec<i32>,
360        }
361        impl ::prost::Name for Started {
362            const NAME: &'static str = "Started";
363            const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
364            fn full_name() -> ::prost::alloc::string::String {
365                "xmtp.xmtpv4.message_api.SubscribeResponse.V1.Started".into()
366            }
367            fn type_url() -> ::prost::alloc::string::String {
368                "/xmtp.xmtpv4.message_api.SubscribeResponse.V1.Started".into()
369            }
370        }
371        /// Sent once per Mutate that adds subscriptions (a catch-up "wave"), after
372        /// the wave's last TopicsLive: everything the Mutate asked for is delivered.
373        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
374        pub struct CatchupComplete {
375            /// echoes the Mutate that started this wave (0 if none given)
376            #[prost(uint64, tag = "1")]
377            pub mutate_id: u64,
378        }
379        impl ::prost::Name for CatchupComplete {
380            const NAME: &'static str = "CatchupComplete";
381            const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
382            fn full_name() -> ::prost::alloc::string::String {
383                "xmtp.xmtpv4.message_api.SubscribeResponse.V1.CatchupComplete".into()
384            }
385            fn type_url() -> ::prost::alloc::string::String {
386                "/xmtp.xmtpv4.message_api.SubscribeResponse.V1.CatchupComplete".into()
387            }
388        }
389        /// Emitted when topics finish catch-up, AFTER the last history frame for
390        /// them — including any live envelopes that queued behind the catch-up,
391        /// which were equally historical from the client's perspective — so every
392        /// later frame for a listed topic is live tail. Informational only: delivery
393        /// correctness (no duplicates, no gaps) never depends on it. Re-adding a
394        /// topic re-runs catch-up and re-emits it; receivers treat it idempotently.
395        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
396        pub struct TopicsLive {
397            /// kind-prefixed topics now tailing live
398            #[prost(bytes = "vec", repeated, tag = "1")]
399            pub topics: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
400        }
401        impl ::prost::Name for TopicsLive {
402            const NAME: &'static str = "TopicsLive";
403            const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
404            fn full_name() -> ::prost::alloc::string::String {
405                "xmtp.xmtpv4.message_api.SubscribeResponse.V1.TopicsLive".into()
406            }
407            fn type_url() -> ::prost::alloc::string::String {
408                "/xmtp.xmtpv4.message_api.SubscribeResponse.V1.TopicsLive".into()
409            }
410        }
411        /// Optional per-stream protocol features (none defined yet; future revisions
412        /// add values, e.g. fetch-over-stream lookups answered with the same read
413        /// view that feeds the stream, or new streamable topic kinds).
414        #[derive(
415            Clone,
416            Copy,
417            Debug,
418            PartialEq,
419            Eq,
420            Hash,
421            PartialOrd,
422            Ord,
423            ::prost::Enumeration
424        )]
425        #[repr(i32)]
426        pub enum Capability {
427            Unspecified = 0,
428        }
429        impl Capability {
430            /// String value of the enum field names used in the ProtoBuf definition.
431            ///
432            /// The values are not transformed in any way and thus are considered stable
433            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
434            pub fn as_str_name(&self) -> &'static str {
435                match self {
436                    Self::Unspecified => "CAPABILITY_UNSPECIFIED",
437                }
438            }
439            /// Creates an enum from field names used in the ProtoBuf definition.
440            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
441                match value {
442                    "CAPABILITY_UNSPECIFIED" => Some(Self::Unspecified),
443                    _ => None,
444                }
445            }
446        }
447        #[derive(Clone, PartialEq, ::prost::Oneof)]
448        pub enum Response {
449            #[prost(message, tag = "1")]
450            Envelopes(Envelopes),
451            /// sent once, immediately on open, before any catch-up
452            #[prost(message, tag = "2")]
453            Started(Started),
454            /// idle liveness challenge; receiver MUST answer with Pong
455            #[prost(message, tag = "3")]
456            Ping(super::super::Ping),
457            /// answer to a client Ping
458            #[prost(message, tag = "4")]
459            Pong(super::super::Pong),
460            /// these topics just crossed from catch-up to live
461            #[prost(message, tag = "5")]
462            TopicsLive(TopicsLive),
463            /// a Mutate's adds are fully delivered
464            #[prost(message, tag = "6")]
465            CatchupComplete(CatchupComplete),
466        }
467    }
468    impl ::prost::Name for V1 {
469        const NAME: &'static str = "V1";
470        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
471        fn full_name() -> ::prost::alloc::string::String {
472            "xmtp.xmtpv4.message_api.SubscribeResponse.V1".into()
473        }
474        fn type_url() -> ::prost::alloc::string::String {
475            "/xmtp.xmtpv4.message_api.SubscribeResponse.V1".into()
476        }
477    }
478    #[derive(Clone, PartialEq, ::prost::Oneof)]
479    pub enum Version {
480        #[prost(message, tag = "1")]
481        V1(V1),
482    }
483}
484impl ::prost::Name for SubscribeResponse {
485    const NAME: &'static str = "SubscribeResponse";
486    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
487    fn full_name() -> ::prost::alloc::string::String {
488        "xmtp.xmtpv4.message_api.SubscribeResponse".into()
489    }
490    fn type_url() -> ::prost::alloc::string::String {
491        "/xmtp.xmtpv4.message_api.SubscribeResponse".into()
492    }
493}
494/// Liveness challenge/response for Subscribe, shared across versions. Either peer
495/// MAY send a Ping; the receiver MUST reply with a Pong echoing the nonce. The
496/// sender closes the stream if no Pong arrives within its deadline — how a node
497/// reaps a vanished peer (e.g. a mobile client the OS suspended behind a proxy
498/// that still ACKs the transport).
499#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
500pub struct Ping {
501    #[prost(uint64, tag = "1")]
502    pub nonce: u64,
503}
504impl ::prost::Name for Ping {
505    const NAME: &'static str = "Ping";
506    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
507    fn full_name() -> ::prost::alloc::string::String {
508        "xmtp.xmtpv4.message_api.Ping".into()
509    }
510    fn type_url() -> ::prost::alloc::string::String {
511        "/xmtp.xmtpv4.message_api.Ping".into()
512    }
513}
514#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
515pub struct Pong {
516    /// echoes the nonce of the Ping it answers
517    #[prost(uint64, tag = "1")]
518    pub nonce: u64,
519}
520impl ::prost::Name for Pong {
521    const NAME: &'static str = "Pong";
522    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
523    fn full_name() -> ::prost::alloc::string::String {
524        "xmtp.xmtpv4.message_api.Pong".into()
525    }
526    fn type_url() -> ::prost::alloc::string::String {
527        "/xmtp.xmtpv4.message_api.Pong".into()
528    }
529}
530/// Batch subscribe to all envelopes
531#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
532pub struct SubscribeAllEnvelopesRequest {}
533impl ::prost::Name for SubscribeAllEnvelopesRequest {
534    const NAME: &'static str = "SubscribeAllEnvelopesRequest";
535    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
536    fn full_name() -> ::prost::alloc::string::String {
537        "xmtp.xmtpv4.message_api.SubscribeAllEnvelopesRequest".into()
538    }
539    fn type_url() -> ::prost::alloc::string::String {
540        "/xmtp.xmtpv4.message_api.SubscribeAllEnvelopesRequest".into()
541    }
542}
543/// Query envelopes request
544#[derive(Clone, PartialEq, ::prost::Message)]
545pub struct QueryEnvelopesRequest {
546    #[prost(message, optional, tag = "1")]
547    pub query: ::core::option::Option<EnvelopesQuery>,
548    #[prost(uint32, tag = "2")]
549    pub limit: u32,
550}
551impl ::prost::Name for QueryEnvelopesRequest {
552    const NAME: &'static str = "QueryEnvelopesRequest";
553    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
554    fn full_name() -> ::prost::alloc::string::String {
555        "xmtp.xmtpv4.message_api.QueryEnvelopesRequest".into()
556    }
557    fn type_url() -> ::prost::alloc::string::String {
558        "/xmtp.xmtpv4.message_api.QueryEnvelopesRequest".into()
559    }
560}
561/// Query envelopes response
562#[derive(Clone, PartialEq, ::prost::Message)]
563pub struct QueryEnvelopesResponse {
564    #[prost(message, repeated, tag = "1")]
565    pub envelopes: ::prost::alloc::vec::Vec<super::envelopes::OriginatorEnvelope>,
566}
567impl ::prost::Name for QueryEnvelopesResponse {
568    const NAME: &'static str = "QueryEnvelopesResponse";
569    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
570    fn full_name() -> ::prost::alloc::string::String {
571        "xmtp.xmtpv4.message_api.QueryEnvelopesResponse".into()
572    }
573    fn type_url() -> ::prost::alloc::string::String {
574        "/xmtp.xmtpv4.message_api.QueryEnvelopesResponse".into()
575    }
576}
577#[derive(Clone, PartialEq, ::prost::Message)]
578pub struct PublishPayerEnvelopesRequest {
579    #[prost(message, repeated, tag = "1")]
580    pub payer_envelopes: ::prost::alloc::vec::Vec<super::envelopes::PayerEnvelope>,
581}
582impl ::prost::Name for PublishPayerEnvelopesRequest {
583    const NAME: &'static str = "PublishPayerEnvelopesRequest";
584    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
585    fn full_name() -> ::prost::alloc::string::String {
586        "xmtp.xmtpv4.message_api.PublishPayerEnvelopesRequest".into()
587    }
588    fn type_url() -> ::prost::alloc::string::String {
589        "/xmtp.xmtpv4.message_api.PublishPayerEnvelopesRequest".into()
590    }
591}
592#[derive(Clone, PartialEq, ::prost::Message)]
593pub struct PublishPayerEnvelopesResponse {
594    #[prost(message, repeated, tag = "1")]
595    pub originator_envelopes: ::prost::alloc::vec::Vec<
596        super::envelopes::OriginatorEnvelope,
597    >,
598}
599impl ::prost::Name for PublishPayerEnvelopesResponse {
600    const NAME: &'static str = "PublishPayerEnvelopesResponse";
601    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
602    fn full_name() -> ::prost::alloc::string::String {
603        "xmtp.xmtpv4.message_api.PublishPayerEnvelopesResponse".into()
604    }
605    fn type_url() -> ::prost::alloc::string::String {
606        "/xmtp.xmtpv4.message_api.PublishPayerEnvelopesResponse".into()
607    }
608}
609/// Request to retrieve the XIDs for the given addresses
610#[derive(Clone, PartialEq, ::prost::Message)]
611pub struct GetInboxIdsRequest {
612    #[prost(message, repeated, tag = "1")]
613    pub requests: ::prost::alloc::vec::Vec<get_inbox_ids_request::Request>,
614}
615/// Nested message and enum types in `GetInboxIdsRequest`.
616pub mod get_inbox_ids_request {
617    /// A single request for a given address
618    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
619    pub struct Request {
620        #[prost(string, tag = "1")]
621        pub identifier: ::prost::alloc::string::String,
622        #[prost(
623            enumeration = "super::super::super::identity::associations::IdentifierKind",
624            tag = "2"
625        )]
626        pub identifier_kind: i32,
627    }
628    impl ::prost::Name for Request {
629        const NAME: &'static str = "Request";
630        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
631        fn full_name() -> ::prost::alloc::string::String {
632            "xmtp.xmtpv4.message_api.GetInboxIdsRequest.Request".into()
633        }
634        fn type_url() -> ::prost::alloc::string::String {
635            "/xmtp.xmtpv4.message_api.GetInboxIdsRequest.Request".into()
636        }
637    }
638}
639impl ::prost::Name for GetInboxIdsRequest {
640    const NAME: &'static str = "GetInboxIdsRequest";
641    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
642    fn full_name() -> ::prost::alloc::string::String {
643        "xmtp.xmtpv4.message_api.GetInboxIdsRequest".into()
644    }
645    fn type_url() -> ::prost::alloc::string::String {
646        "/xmtp.xmtpv4.message_api.GetInboxIdsRequest".into()
647    }
648}
649/// Response with the XIDs for the requested addresses
650#[derive(Clone, PartialEq, ::prost::Message)]
651pub struct GetInboxIdsResponse {
652    #[prost(message, repeated, tag = "1")]
653    pub responses: ::prost::alloc::vec::Vec<get_inbox_ids_response::Response>,
654}
655/// Nested message and enum types in `GetInboxIdsResponse`.
656pub mod get_inbox_ids_response {
657    /// A single response for a given address
658    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
659    pub struct Response {
660        #[prost(string, tag = "1")]
661        pub identifier: ::prost::alloc::string::String,
662        #[prost(string, optional, tag = "2")]
663        pub inbox_id: ::core::option::Option<::prost::alloc::string::String>,
664        #[prost(
665            enumeration = "super::super::super::identity::associations::IdentifierKind",
666            tag = "3"
667        )]
668        pub identifier_kind: i32,
669    }
670    impl ::prost::Name for Response {
671        const NAME: &'static str = "Response";
672        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
673        fn full_name() -> ::prost::alloc::string::String {
674            "xmtp.xmtpv4.message_api.GetInboxIdsResponse.Response".into()
675        }
676        fn type_url() -> ::prost::alloc::string::String {
677            "/xmtp.xmtpv4.message_api.GetInboxIdsResponse.Response".into()
678        }
679    }
680}
681impl ::prost::Name for GetInboxIdsResponse {
682    const NAME: &'static str = "GetInboxIdsResponse";
683    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
684    fn full_name() -> ::prost::alloc::string::String {
685        "xmtp.xmtpv4.message_api.GetInboxIdsResponse".into()
686    }
687    fn type_url() -> ::prost::alloc::string::String {
688        "/xmtp.xmtpv4.message_api.GetInboxIdsResponse".into()
689    }
690}
691/// Request to get the newest envelope for a given topic
692#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
693pub struct GetNewestEnvelopeRequest {
694    #[prost(bytes = "vec", repeated, tag = "1")]
695    pub topics: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
696}
697impl ::prost::Name for GetNewestEnvelopeRequest {
698    const NAME: &'static str = "GetNewestEnvelopeRequest";
699    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
700    fn full_name() -> ::prost::alloc::string::String {
701        "xmtp.xmtpv4.message_api.GetNewestEnvelopeRequest".into()
702    }
703    fn type_url() -> ::prost::alloc::string::String {
704        "/xmtp.xmtpv4.message_api.GetNewestEnvelopeRequest".into()
705    }
706}
707/// Response to GetNewestEnvelopeRequest
708#[derive(Clone, PartialEq, ::prost::Message)]
709pub struct GetNewestEnvelopeResponse {
710    /// The newest envelope for the given topic OR null if there are no envelopes on the topic
711    #[prost(message, repeated, tag = "1")]
712    pub results: ::prost::alloc::vec::Vec<get_newest_envelope_response::Response>,
713}
714/// Nested message and enum types in `GetNewestEnvelopeResponse`.
715pub mod get_newest_envelope_response {
716    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
717    pub struct Response {
718        #[prost(message, optional, tag = "1")]
719        pub originator_envelope: ::core::option::Option<
720            super::super::envelopes::OriginatorEnvelope,
721        >,
722    }
723    impl ::prost::Name for Response {
724        const NAME: &'static str = "Response";
725        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
726        fn full_name() -> ::prost::alloc::string::String {
727            "xmtp.xmtpv4.message_api.GetNewestEnvelopeResponse.Response".into()
728        }
729        fn type_url() -> ::prost::alloc::string::String {
730            "/xmtp.xmtpv4.message_api.GetNewestEnvelopeResponse.Response".into()
731        }
732    }
733}
734impl ::prost::Name for GetNewestEnvelopeResponse {
735    const NAME: &'static str = "GetNewestEnvelopeResponse";
736    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
737    fn full_name() -> ::prost::alloc::string::String {
738        "xmtp.xmtpv4.message_api.GetNewestEnvelopeResponse".into()
739    }
740    fn type_url() -> ::prost::alloc::string::String {
741        "/xmtp.xmtpv4.message_api.GetNewestEnvelopeResponse".into()
742    }
743}
744/// Subscribe to envelopes from specific originator nodes
745#[derive(Clone, PartialEq, ::prost::Message)]
746pub struct SubscribeOriginatorsRequest {
747    #[prost(message, optional, tag = "1")]
748    pub filter: ::core::option::Option<subscribe_originators_request::OriginatorFilter>,
749}
750/// Nested message and enum types in `SubscribeOriginatorsRequest`.
751pub mod subscribe_originators_request {
752    #[derive(Clone, PartialEq, ::prost::Message)]
753    pub struct OriginatorFilter {
754        #[prost(uint32, repeated, tag = "1")]
755        pub originator_node_ids: ::prost::alloc::vec::Vec<u32>,
756        #[prost(message, optional, tag = "2")]
757        pub last_seen: ::core::option::Option<super::super::envelopes::Cursor>,
758    }
759    impl ::prost::Name for OriginatorFilter {
760        const NAME: &'static str = "OriginatorFilter";
761        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
762        fn full_name() -> ::prost::alloc::string::String {
763            "xmtp.xmtpv4.message_api.SubscribeOriginatorsRequest.OriginatorFilter".into()
764        }
765        fn type_url() -> ::prost::alloc::string::String {
766            "/xmtp.xmtpv4.message_api.SubscribeOriginatorsRequest.OriginatorFilter"
767                .into()
768        }
769    }
770}
771impl ::prost::Name for SubscribeOriginatorsRequest {
772    const NAME: &'static str = "SubscribeOriginatorsRequest";
773    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
774    fn full_name() -> ::prost::alloc::string::String {
775        "xmtp.xmtpv4.message_api.SubscribeOriginatorsRequest".into()
776    }
777    fn type_url() -> ::prost::alloc::string::String {
778        "/xmtp.xmtpv4.message_api.SubscribeOriginatorsRequest".into()
779    }
780}
781/// Response for SubscribeOriginators
782#[derive(Clone, PartialEq, ::prost::Message)]
783pub struct SubscribeOriginatorsResponse {
784    #[prost(oneof = "subscribe_originators_response::Response", tags = "1")]
785    pub response: ::core::option::Option<subscribe_originators_response::Response>,
786}
787/// Nested message and enum types in `SubscribeOriginatorsResponse`.
788pub mod subscribe_originators_response {
789    #[derive(Clone, PartialEq, ::prost::Message)]
790    pub struct Envelopes {
791        #[prost(message, repeated, tag = "1")]
792        pub envelopes: ::prost::alloc::vec::Vec<
793            super::super::envelopes::OriginatorEnvelope,
794        >,
795    }
796    impl ::prost::Name for Envelopes {
797        const NAME: &'static str = "Envelopes";
798        const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
799        fn full_name() -> ::prost::alloc::string::String {
800            "xmtp.xmtpv4.message_api.SubscribeOriginatorsResponse.Envelopes".into()
801        }
802        fn type_url() -> ::prost::alloc::string::String {
803            "/xmtp.xmtpv4.message_api.SubscribeOriginatorsResponse.Envelopes".into()
804        }
805    }
806    #[derive(Clone, PartialEq, ::prost::Oneof)]
807    pub enum Response {
808        #[prost(message, tag = "1")]
809        Envelopes(Envelopes),
810    }
811}
812impl ::prost::Name for SubscribeOriginatorsResponse {
813    const NAME: &'static str = "SubscribeOriginatorsResponse";
814    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
815    fn full_name() -> ::prost::alloc::string::String {
816        "xmtp.xmtpv4.message_api.SubscribeOriginatorsResponse".into()
817    }
818    fn type_url() -> ::prost::alloc::string::String {
819        "/xmtp.xmtpv4.message_api.SubscribeOriginatorsResponse".into()
820    }
821}
822/// Generated server implementations.
823#[cfg(any(not(target_arch = "wasm32"), feature = "grpc_server_impls"))]
824pub mod replication_api_server {
825    #![allow(
826        unused_variables,
827        dead_code,
828        missing_docs,
829        clippy::wildcard_imports,
830        clippy::let_unit_value,
831    )]
832    use tonic::codegen::*;
833    /// Generated trait containing gRPC methods that should be implemented for use with ReplicationApiServer.
834    #[async_trait]
835    pub trait ReplicationApi: std::marker::Send + std::marker::Sync + 'static {
836        /// Server streaming response type for the SubscribeOriginators method.
837        type SubscribeOriginatorsStream: tonic::codegen::tokio_stream::Stream<
838                Item = std::result::Result<
839                    super::SubscribeOriginatorsResponse,
840                    tonic::Status,
841                >,
842            >
843            + std::marker::Send
844            + 'static;
845        /// Node-to-node originator subscription
846        async fn subscribe_originators(
847            &self,
848            request: tonic::Request<super::SubscribeOriginatorsRequest>,
849        ) -> std::result::Result<
850            tonic::Response<Self::SubscribeOriginatorsStream>,
851            tonic::Status,
852        >;
853        /// Server streaming response type for the SubscribeEnvelopes method.
854        type SubscribeEnvelopesStream: tonic::codegen::tokio_stream::Stream<
855                Item = std::result::Result<
856                    super::SubscribeEnvelopesResponse,
857                    tonic::Status,
858                >,
859            >
860            + std::marker::Send
861            + 'static;
862        /// Deprecated: use SubscribeOriginators for node queries,
863        /// QueryApi.SubscribeTopics for client queries
864        async fn subscribe_envelopes(
865            &self,
866            request: tonic::Request<super::SubscribeEnvelopesRequest>,
867        ) -> std::result::Result<
868            tonic::Response<Self::SubscribeEnvelopesStream>,
869            tonic::Status,
870        >;
871        /// Server streaming response type for the SubscribeTopics method.
872        type SubscribeTopicsStream: tonic::codegen::tokio_stream::Stream<
873                Item = std::result::Result<super::SubscribeTopicsResponse, tonic::Status>,
874            >
875            + std::marker::Send
876            + 'static;
877        /// Deprecated: moved to QueryApi
878        async fn subscribe_topics(
879            &self,
880            request: tonic::Request<super::SubscribeTopicsRequest>,
881        ) -> std::result::Result<
882            tonic::Response<Self::SubscribeTopicsStream>,
883            tonic::Status,
884        >;
885        /// Deprecated: moved to QueryApi
886        async fn query_envelopes(
887            &self,
888            request: tonic::Request<super::QueryEnvelopesRequest>,
889        ) -> std::result::Result<
890            tonic::Response<super::QueryEnvelopesResponse>,
891            tonic::Status,
892        >;
893        /// Deprecated: moved to PublishApi
894        async fn publish_payer_envelopes(
895            &self,
896            request: tonic::Request<super::PublishPayerEnvelopesRequest>,
897        ) -> std::result::Result<
898            tonic::Response<super::PublishPayerEnvelopesResponse>,
899            tonic::Status,
900        >;
901        /// Deprecated: moved to QueryApi
902        async fn get_inbox_ids(
903            &self,
904            request: tonic::Request<super::GetInboxIdsRequest>,
905        ) -> std::result::Result<
906            tonic::Response<super::GetInboxIdsResponse>,
907            tonic::Status,
908        >;
909        /// Deprecated: moved to QueryApi
910        async fn get_newest_envelope(
911            &self,
912            request: tonic::Request<super::GetNewestEnvelopeRequest>,
913        ) -> std::result::Result<
914            tonic::Response<super::GetNewestEnvelopeResponse>,
915            tonic::Status,
916        >;
917    }
918    #[derive(Debug)]
919    pub struct ReplicationApiServer<T> {
920        inner: Arc<T>,
921        accept_compression_encodings: EnabledCompressionEncodings,
922        send_compression_encodings: EnabledCompressionEncodings,
923        max_decoding_message_size: Option<usize>,
924        max_encoding_message_size: Option<usize>,
925    }
926    impl<T> ReplicationApiServer<T> {
927        pub fn new(inner: T) -> Self {
928            Self::from_arc(Arc::new(inner))
929        }
930        pub fn from_arc(inner: Arc<T>) -> Self {
931            Self {
932                inner,
933                accept_compression_encodings: Default::default(),
934                send_compression_encodings: Default::default(),
935                max_decoding_message_size: None,
936                max_encoding_message_size: None,
937            }
938        }
939        pub fn with_interceptor<F>(
940            inner: T,
941            interceptor: F,
942        ) -> InterceptedService<Self, F>
943        where
944            F: tonic::service::Interceptor,
945        {
946            InterceptedService::new(Self::new(inner), interceptor)
947        }
948        /// Enable decompressing requests with the given encoding.
949        #[must_use]
950        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
951            self.accept_compression_encodings.enable(encoding);
952            self
953        }
954        /// Compress responses with the given encoding, if the client supports it.
955        #[must_use]
956        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
957            self.send_compression_encodings.enable(encoding);
958            self
959        }
960        /// Limits the maximum size of a decoded message.
961        ///
962        /// Default: `4MB`
963        #[must_use]
964        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
965            self.max_decoding_message_size = Some(limit);
966            self
967        }
968        /// Limits the maximum size of an encoded message.
969        ///
970        /// Default: `usize::MAX`
971        #[must_use]
972        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
973            self.max_encoding_message_size = Some(limit);
974            self
975        }
976    }
977    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplicationApiServer<T>
978    where
979        T: ReplicationApi,
980        B: Body + std::marker::Send + 'static,
981        B::Error: Into<StdError> + std::marker::Send + 'static,
982    {
983        type Response = http::Response<tonic::body::Body>;
984        type Error = std::convert::Infallible;
985        type Future = BoxFuture<Self::Response, Self::Error>;
986        fn poll_ready(
987            &mut self,
988            _cx: &mut Context<'_>,
989        ) -> Poll<std::result::Result<(), Self::Error>> {
990            Poll::Ready(Ok(()))
991        }
992        fn call(&mut self, req: http::Request<B>) -> Self::Future {
993            match req.uri().path() {
994                "/xmtp.xmtpv4.message_api.ReplicationApi/SubscribeOriginators" => {
995                    #[allow(non_camel_case_types)]
996                    struct SubscribeOriginatorsSvc<T: ReplicationApi>(pub Arc<T>);
997                    impl<
998                        T: ReplicationApi,
999                    > tonic::server::ServerStreamingService<
1000                        super::SubscribeOriginatorsRequest,
1001                    > for SubscribeOriginatorsSvc<T> {
1002                        type Response = super::SubscribeOriginatorsResponse;
1003                        type ResponseStream = T::SubscribeOriginatorsStream;
1004                        type Future = BoxFuture<
1005                            tonic::Response<Self::ResponseStream>,
1006                            tonic::Status,
1007                        >;
1008                        fn call(
1009                            &mut self,
1010                            request: tonic::Request<super::SubscribeOriginatorsRequest>,
1011                        ) -> Self::Future {
1012                            let inner = Arc::clone(&self.0);
1013                            let fut = async move {
1014                                <T as ReplicationApi>::subscribe_originators(
1015                                        &inner,
1016                                        request,
1017                                    )
1018                                    .await
1019                            };
1020                            Box::pin(fut)
1021                        }
1022                    }
1023                    let accept_compression_encodings = self.accept_compression_encodings;
1024                    let send_compression_encodings = self.send_compression_encodings;
1025                    let max_decoding_message_size = self.max_decoding_message_size;
1026                    let max_encoding_message_size = self.max_encoding_message_size;
1027                    let inner = self.inner.clone();
1028                    let fut = async move {
1029                        let method = SubscribeOriginatorsSvc(inner);
1030                        let codec = tonic_prost::ProstCodec::default();
1031                        let mut grpc = tonic::server::Grpc::new(codec)
1032                            .apply_compression_config(
1033                                accept_compression_encodings,
1034                                send_compression_encodings,
1035                            )
1036                            .apply_max_message_size_config(
1037                                max_decoding_message_size,
1038                                max_encoding_message_size,
1039                            );
1040                        let res = grpc.server_streaming(method, req).await;
1041                        Ok(res)
1042                    };
1043                    Box::pin(fut)
1044                }
1045                "/xmtp.xmtpv4.message_api.ReplicationApi/SubscribeEnvelopes" => {
1046                    #[allow(non_camel_case_types)]
1047                    struct SubscribeEnvelopesSvc<T: ReplicationApi>(pub Arc<T>);
1048                    impl<
1049                        T: ReplicationApi,
1050                    > tonic::server::ServerStreamingService<
1051                        super::SubscribeEnvelopesRequest,
1052                    > for SubscribeEnvelopesSvc<T> {
1053                        type Response = super::SubscribeEnvelopesResponse;
1054                        type ResponseStream = T::SubscribeEnvelopesStream;
1055                        type Future = BoxFuture<
1056                            tonic::Response<Self::ResponseStream>,
1057                            tonic::Status,
1058                        >;
1059                        fn call(
1060                            &mut self,
1061                            request: tonic::Request<super::SubscribeEnvelopesRequest>,
1062                        ) -> Self::Future {
1063                            let inner = Arc::clone(&self.0);
1064                            let fut = async move {
1065                                <T as ReplicationApi>::subscribe_envelopes(&inner, request)
1066                                    .await
1067                            };
1068                            Box::pin(fut)
1069                        }
1070                    }
1071                    let accept_compression_encodings = self.accept_compression_encodings;
1072                    let send_compression_encodings = self.send_compression_encodings;
1073                    let max_decoding_message_size = self.max_decoding_message_size;
1074                    let max_encoding_message_size = self.max_encoding_message_size;
1075                    let inner = self.inner.clone();
1076                    let fut = async move {
1077                        let method = SubscribeEnvelopesSvc(inner);
1078                        let codec = tonic_prost::ProstCodec::default();
1079                        let mut grpc = tonic::server::Grpc::new(codec)
1080                            .apply_compression_config(
1081                                accept_compression_encodings,
1082                                send_compression_encodings,
1083                            )
1084                            .apply_max_message_size_config(
1085                                max_decoding_message_size,
1086                                max_encoding_message_size,
1087                            );
1088                        let res = grpc.server_streaming(method, req).await;
1089                        Ok(res)
1090                    };
1091                    Box::pin(fut)
1092                }
1093                "/xmtp.xmtpv4.message_api.ReplicationApi/SubscribeTopics" => {
1094                    #[allow(non_camel_case_types)]
1095                    struct SubscribeTopicsSvc<T: ReplicationApi>(pub Arc<T>);
1096                    impl<
1097                        T: ReplicationApi,
1098                    > tonic::server::ServerStreamingService<
1099                        super::SubscribeTopicsRequest,
1100                    > for SubscribeTopicsSvc<T> {
1101                        type Response = super::SubscribeTopicsResponse;
1102                        type ResponseStream = T::SubscribeTopicsStream;
1103                        type Future = BoxFuture<
1104                            tonic::Response<Self::ResponseStream>,
1105                            tonic::Status,
1106                        >;
1107                        fn call(
1108                            &mut self,
1109                            request: tonic::Request<super::SubscribeTopicsRequest>,
1110                        ) -> Self::Future {
1111                            let inner = Arc::clone(&self.0);
1112                            let fut = async move {
1113                                <T as ReplicationApi>::subscribe_topics(&inner, request)
1114                                    .await
1115                            };
1116                            Box::pin(fut)
1117                        }
1118                    }
1119                    let accept_compression_encodings = self.accept_compression_encodings;
1120                    let send_compression_encodings = self.send_compression_encodings;
1121                    let max_decoding_message_size = self.max_decoding_message_size;
1122                    let max_encoding_message_size = self.max_encoding_message_size;
1123                    let inner = self.inner.clone();
1124                    let fut = async move {
1125                        let method = SubscribeTopicsSvc(inner);
1126                        let codec = tonic_prost::ProstCodec::default();
1127                        let mut grpc = tonic::server::Grpc::new(codec)
1128                            .apply_compression_config(
1129                                accept_compression_encodings,
1130                                send_compression_encodings,
1131                            )
1132                            .apply_max_message_size_config(
1133                                max_decoding_message_size,
1134                                max_encoding_message_size,
1135                            );
1136                        let res = grpc.server_streaming(method, req).await;
1137                        Ok(res)
1138                    };
1139                    Box::pin(fut)
1140                }
1141                "/xmtp.xmtpv4.message_api.ReplicationApi/QueryEnvelopes" => {
1142                    #[allow(non_camel_case_types)]
1143                    struct QueryEnvelopesSvc<T: ReplicationApi>(pub Arc<T>);
1144                    impl<
1145                        T: ReplicationApi,
1146                    > tonic::server::UnaryService<super::QueryEnvelopesRequest>
1147                    for QueryEnvelopesSvc<T> {
1148                        type Response = super::QueryEnvelopesResponse;
1149                        type Future = BoxFuture<
1150                            tonic::Response<Self::Response>,
1151                            tonic::Status,
1152                        >;
1153                        fn call(
1154                            &mut self,
1155                            request: tonic::Request<super::QueryEnvelopesRequest>,
1156                        ) -> Self::Future {
1157                            let inner = Arc::clone(&self.0);
1158                            let fut = async move {
1159                                <T as ReplicationApi>::query_envelopes(&inner, request)
1160                                    .await
1161                            };
1162                            Box::pin(fut)
1163                        }
1164                    }
1165                    let accept_compression_encodings = self.accept_compression_encodings;
1166                    let send_compression_encodings = self.send_compression_encodings;
1167                    let max_decoding_message_size = self.max_decoding_message_size;
1168                    let max_encoding_message_size = self.max_encoding_message_size;
1169                    let inner = self.inner.clone();
1170                    let fut = async move {
1171                        let method = QueryEnvelopesSvc(inner);
1172                        let codec = tonic_prost::ProstCodec::default();
1173                        let mut grpc = tonic::server::Grpc::new(codec)
1174                            .apply_compression_config(
1175                                accept_compression_encodings,
1176                                send_compression_encodings,
1177                            )
1178                            .apply_max_message_size_config(
1179                                max_decoding_message_size,
1180                                max_encoding_message_size,
1181                            );
1182                        let res = grpc.unary(method, req).await;
1183                        Ok(res)
1184                    };
1185                    Box::pin(fut)
1186                }
1187                "/xmtp.xmtpv4.message_api.ReplicationApi/PublishPayerEnvelopes" => {
1188                    #[allow(non_camel_case_types)]
1189                    struct PublishPayerEnvelopesSvc<T: ReplicationApi>(pub Arc<T>);
1190                    impl<
1191                        T: ReplicationApi,
1192                    > tonic::server::UnaryService<super::PublishPayerEnvelopesRequest>
1193                    for PublishPayerEnvelopesSvc<T> {
1194                        type Response = super::PublishPayerEnvelopesResponse;
1195                        type Future = BoxFuture<
1196                            tonic::Response<Self::Response>,
1197                            tonic::Status,
1198                        >;
1199                        fn call(
1200                            &mut self,
1201                            request: tonic::Request<super::PublishPayerEnvelopesRequest>,
1202                        ) -> Self::Future {
1203                            let inner = Arc::clone(&self.0);
1204                            let fut = async move {
1205                                <T as ReplicationApi>::publish_payer_envelopes(
1206                                        &inner,
1207                                        request,
1208                                    )
1209                                    .await
1210                            };
1211                            Box::pin(fut)
1212                        }
1213                    }
1214                    let accept_compression_encodings = self.accept_compression_encodings;
1215                    let send_compression_encodings = self.send_compression_encodings;
1216                    let max_decoding_message_size = self.max_decoding_message_size;
1217                    let max_encoding_message_size = self.max_encoding_message_size;
1218                    let inner = self.inner.clone();
1219                    let fut = async move {
1220                        let method = PublishPayerEnvelopesSvc(inner);
1221                        let codec = tonic_prost::ProstCodec::default();
1222                        let mut grpc = tonic::server::Grpc::new(codec)
1223                            .apply_compression_config(
1224                                accept_compression_encodings,
1225                                send_compression_encodings,
1226                            )
1227                            .apply_max_message_size_config(
1228                                max_decoding_message_size,
1229                                max_encoding_message_size,
1230                            );
1231                        let res = grpc.unary(method, req).await;
1232                        Ok(res)
1233                    };
1234                    Box::pin(fut)
1235                }
1236                "/xmtp.xmtpv4.message_api.ReplicationApi/GetInboxIds" => {
1237                    #[allow(non_camel_case_types)]
1238                    struct GetInboxIdsSvc<T: ReplicationApi>(pub Arc<T>);
1239                    impl<
1240                        T: ReplicationApi,
1241                    > tonic::server::UnaryService<super::GetInboxIdsRequest>
1242                    for GetInboxIdsSvc<T> {
1243                        type Response = super::GetInboxIdsResponse;
1244                        type Future = BoxFuture<
1245                            tonic::Response<Self::Response>,
1246                            tonic::Status,
1247                        >;
1248                        fn call(
1249                            &mut self,
1250                            request: tonic::Request<super::GetInboxIdsRequest>,
1251                        ) -> Self::Future {
1252                            let inner = Arc::clone(&self.0);
1253                            let fut = async move {
1254                                <T as ReplicationApi>::get_inbox_ids(&inner, request).await
1255                            };
1256                            Box::pin(fut)
1257                        }
1258                    }
1259                    let accept_compression_encodings = self.accept_compression_encodings;
1260                    let send_compression_encodings = self.send_compression_encodings;
1261                    let max_decoding_message_size = self.max_decoding_message_size;
1262                    let max_encoding_message_size = self.max_encoding_message_size;
1263                    let inner = self.inner.clone();
1264                    let fut = async move {
1265                        let method = GetInboxIdsSvc(inner);
1266                        let codec = tonic_prost::ProstCodec::default();
1267                        let mut grpc = tonic::server::Grpc::new(codec)
1268                            .apply_compression_config(
1269                                accept_compression_encodings,
1270                                send_compression_encodings,
1271                            )
1272                            .apply_max_message_size_config(
1273                                max_decoding_message_size,
1274                                max_encoding_message_size,
1275                            );
1276                        let res = grpc.unary(method, req).await;
1277                        Ok(res)
1278                    };
1279                    Box::pin(fut)
1280                }
1281                "/xmtp.xmtpv4.message_api.ReplicationApi/GetNewestEnvelope" => {
1282                    #[allow(non_camel_case_types)]
1283                    struct GetNewestEnvelopeSvc<T: ReplicationApi>(pub Arc<T>);
1284                    impl<
1285                        T: ReplicationApi,
1286                    > tonic::server::UnaryService<super::GetNewestEnvelopeRequest>
1287                    for GetNewestEnvelopeSvc<T> {
1288                        type Response = super::GetNewestEnvelopeResponse;
1289                        type Future = BoxFuture<
1290                            tonic::Response<Self::Response>,
1291                            tonic::Status,
1292                        >;
1293                        fn call(
1294                            &mut self,
1295                            request: tonic::Request<super::GetNewestEnvelopeRequest>,
1296                        ) -> Self::Future {
1297                            let inner = Arc::clone(&self.0);
1298                            let fut = async move {
1299                                <T as ReplicationApi>::get_newest_envelope(&inner, request)
1300                                    .await
1301                            };
1302                            Box::pin(fut)
1303                        }
1304                    }
1305                    let accept_compression_encodings = self.accept_compression_encodings;
1306                    let send_compression_encodings = self.send_compression_encodings;
1307                    let max_decoding_message_size = self.max_decoding_message_size;
1308                    let max_encoding_message_size = self.max_encoding_message_size;
1309                    let inner = self.inner.clone();
1310                    let fut = async move {
1311                        let method = GetNewestEnvelopeSvc(inner);
1312                        let codec = tonic_prost::ProstCodec::default();
1313                        let mut grpc = tonic::server::Grpc::new(codec)
1314                            .apply_compression_config(
1315                                accept_compression_encodings,
1316                                send_compression_encodings,
1317                            )
1318                            .apply_max_message_size_config(
1319                                max_decoding_message_size,
1320                                max_encoding_message_size,
1321                            );
1322                        let res = grpc.unary(method, req).await;
1323                        Ok(res)
1324                    };
1325                    Box::pin(fut)
1326                }
1327                _ => {
1328                    Box::pin(async move {
1329                        let mut response = http::Response::new(
1330                            tonic::body::Body::default(),
1331                        );
1332                        let headers = response.headers_mut();
1333                        headers
1334                            .insert(
1335                                tonic::Status::GRPC_STATUS,
1336                                (tonic::Code::Unimplemented as i32).into(),
1337                            );
1338                        headers
1339                            .insert(
1340                                http::header::CONTENT_TYPE,
1341                                tonic::metadata::GRPC_CONTENT_TYPE,
1342                            );
1343                        Ok(response)
1344                    })
1345                }
1346            }
1347        }
1348    }
1349    impl<T> Clone for ReplicationApiServer<T> {
1350        fn clone(&self) -> Self {
1351            let inner = self.inner.clone();
1352            Self {
1353                inner,
1354                accept_compression_encodings: self.accept_compression_encodings,
1355                send_compression_encodings: self.send_compression_encodings,
1356                max_decoding_message_size: self.max_decoding_message_size,
1357                max_encoding_message_size: self.max_encoding_message_size,
1358            }
1359        }
1360    }
1361    /// Generated gRPC service name
1362    pub const SERVICE_NAME: &str = "xmtp.xmtpv4.message_api.ReplicationApi";
1363    impl<T> tonic::server::NamedService for ReplicationApiServer<T> {
1364        const NAME: &'static str = SERVICE_NAME;
1365    }
1366}
1367/// Generated server implementations.
1368#[cfg(any(not(target_arch = "wasm32"), feature = "grpc_server_impls"))]
1369pub mod notification_api_server {
1370    #![allow(
1371        unused_variables,
1372        dead_code,
1373        missing_docs,
1374        clippy::wildcard_imports,
1375        clippy::let_unit_value,
1376    )]
1377    use tonic::codegen::*;
1378    /// Generated trait containing gRPC methods that should be implemented for use with NotificationApiServer.
1379    #[async_trait]
1380    pub trait NotificationApi: std::marker::Send + std::marker::Sync + 'static {
1381        /// Server streaming response type for the SubscribeAllEnvelopes method.
1382        type SubscribeAllEnvelopesStream: tonic::codegen::tokio_stream::Stream<
1383                Item = std::result::Result<
1384                    super::SubscribeEnvelopesResponse,
1385                    tonic::Status,
1386                >,
1387            >
1388            + std::marker::Send
1389            + 'static;
1390        async fn subscribe_all_envelopes(
1391            &self,
1392            request: tonic::Request<super::SubscribeAllEnvelopesRequest>,
1393        ) -> std::result::Result<
1394            tonic::Response<Self::SubscribeAllEnvelopesStream>,
1395            tonic::Status,
1396        >;
1397    }
1398    /// Full envelope stream for notification services.
1399    #[derive(Debug)]
1400    pub struct NotificationApiServer<T> {
1401        inner: Arc<T>,
1402        accept_compression_encodings: EnabledCompressionEncodings,
1403        send_compression_encodings: EnabledCompressionEncodings,
1404        max_decoding_message_size: Option<usize>,
1405        max_encoding_message_size: Option<usize>,
1406    }
1407    impl<T> NotificationApiServer<T> {
1408        pub fn new(inner: T) -> Self {
1409            Self::from_arc(Arc::new(inner))
1410        }
1411        pub fn from_arc(inner: Arc<T>) -> Self {
1412            Self {
1413                inner,
1414                accept_compression_encodings: Default::default(),
1415                send_compression_encodings: Default::default(),
1416                max_decoding_message_size: None,
1417                max_encoding_message_size: None,
1418            }
1419        }
1420        pub fn with_interceptor<F>(
1421            inner: T,
1422            interceptor: F,
1423        ) -> InterceptedService<Self, F>
1424        where
1425            F: tonic::service::Interceptor,
1426        {
1427            InterceptedService::new(Self::new(inner), interceptor)
1428        }
1429        /// Enable decompressing requests with the given encoding.
1430        #[must_use]
1431        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1432            self.accept_compression_encodings.enable(encoding);
1433            self
1434        }
1435        /// Compress responses with the given encoding, if the client supports it.
1436        #[must_use]
1437        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1438            self.send_compression_encodings.enable(encoding);
1439            self
1440        }
1441        /// Limits the maximum size of a decoded message.
1442        ///
1443        /// Default: `4MB`
1444        #[must_use]
1445        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1446            self.max_decoding_message_size = Some(limit);
1447            self
1448        }
1449        /// Limits the maximum size of an encoded message.
1450        ///
1451        /// Default: `usize::MAX`
1452        #[must_use]
1453        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1454            self.max_encoding_message_size = Some(limit);
1455            self
1456        }
1457    }
1458    impl<T, B> tonic::codegen::Service<http::Request<B>> for NotificationApiServer<T>
1459    where
1460        T: NotificationApi,
1461        B: Body + std::marker::Send + 'static,
1462        B::Error: Into<StdError> + std::marker::Send + 'static,
1463    {
1464        type Response = http::Response<tonic::body::Body>;
1465        type Error = std::convert::Infallible;
1466        type Future = BoxFuture<Self::Response, Self::Error>;
1467        fn poll_ready(
1468            &mut self,
1469            _cx: &mut Context<'_>,
1470        ) -> Poll<std::result::Result<(), Self::Error>> {
1471            Poll::Ready(Ok(()))
1472        }
1473        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1474            match req.uri().path() {
1475                "/xmtp.xmtpv4.message_api.NotificationApi/SubscribeAllEnvelopes" => {
1476                    #[allow(non_camel_case_types)]
1477                    struct SubscribeAllEnvelopesSvc<T: NotificationApi>(pub Arc<T>);
1478                    impl<
1479                        T: NotificationApi,
1480                    > tonic::server::ServerStreamingService<
1481                        super::SubscribeAllEnvelopesRequest,
1482                    > for SubscribeAllEnvelopesSvc<T> {
1483                        type Response = super::SubscribeEnvelopesResponse;
1484                        type ResponseStream = T::SubscribeAllEnvelopesStream;
1485                        type Future = BoxFuture<
1486                            tonic::Response<Self::ResponseStream>,
1487                            tonic::Status,
1488                        >;
1489                        fn call(
1490                            &mut self,
1491                            request: tonic::Request<super::SubscribeAllEnvelopesRequest>,
1492                        ) -> Self::Future {
1493                            let inner = Arc::clone(&self.0);
1494                            let fut = async move {
1495                                <T as NotificationApi>::subscribe_all_envelopes(
1496                                        &inner,
1497                                        request,
1498                                    )
1499                                    .await
1500                            };
1501                            Box::pin(fut)
1502                        }
1503                    }
1504                    let accept_compression_encodings = self.accept_compression_encodings;
1505                    let send_compression_encodings = self.send_compression_encodings;
1506                    let max_decoding_message_size = self.max_decoding_message_size;
1507                    let max_encoding_message_size = self.max_encoding_message_size;
1508                    let inner = self.inner.clone();
1509                    let fut = async move {
1510                        let method = SubscribeAllEnvelopesSvc(inner);
1511                        let codec = tonic_prost::ProstCodec::default();
1512                        let mut grpc = tonic::server::Grpc::new(codec)
1513                            .apply_compression_config(
1514                                accept_compression_encodings,
1515                                send_compression_encodings,
1516                            )
1517                            .apply_max_message_size_config(
1518                                max_decoding_message_size,
1519                                max_encoding_message_size,
1520                            );
1521                        let res = grpc.server_streaming(method, req).await;
1522                        Ok(res)
1523                    };
1524                    Box::pin(fut)
1525                }
1526                _ => {
1527                    Box::pin(async move {
1528                        let mut response = http::Response::new(
1529                            tonic::body::Body::default(),
1530                        );
1531                        let headers = response.headers_mut();
1532                        headers
1533                            .insert(
1534                                tonic::Status::GRPC_STATUS,
1535                                (tonic::Code::Unimplemented as i32).into(),
1536                            );
1537                        headers
1538                            .insert(
1539                                http::header::CONTENT_TYPE,
1540                                tonic::metadata::GRPC_CONTENT_TYPE,
1541                            );
1542                        Ok(response)
1543                    })
1544                }
1545            }
1546        }
1547    }
1548    impl<T> Clone for NotificationApiServer<T> {
1549        fn clone(&self) -> Self {
1550            let inner = self.inner.clone();
1551            Self {
1552                inner,
1553                accept_compression_encodings: self.accept_compression_encodings,
1554                send_compression_encodings: self.send_compression_encodings,
1555                max_decoding_message_size: self.max_decoding_message_size,
1556                max_encoding_message_size: self.max_encoding_message_size,
1557            }
1558        }
1559    }
1560    /// Generated gRPC service name
1561    pub const SERVICE_NAME: &str = "xmtp.xmtpv4.message_api.NotificationApi";
1562    impl<T> tonic::server::NamedService for NotificationApiServer<T> {
1563        const NAME: &'static str = SERVICE_NAME;
1564    }
1565}
1566/// Generated server implementations.
1567#[cfg(any(not(target_arch = "wasm32"), feature = "grpc_server_impls"))]
1568pub mod publish_api_server {
1569    #![allow(
1570        unused_variables,
1571        dead_code,
1572        missing_docs,
1573        clippy::wildcard_imports,
1574        clippy::let_unit_value,
1575    )]
1576    use tonic::codegen::*;
1577    /// Generated trait containing gRPC methods that should be implemented for use with PublishApiServer.
1578    #[async_trait]
1579    pub trait PublishApi: std::marker::Send + std::marker::Sync + 'static {
1580        async fn publish_payer_envelopes(
1581            &self,
1582            request: tonic::Request<super::PublishPayerEnvelopesRequest>,
1583        ) -> std::result::Result<
1584            tonic::Response<super::PublishPayerEnvelopesResponse>,
1585            tonic::Status,
1586        >;
1587    }
1588    /// Gateway -> Node.
1589    #[derive(Debug)]
1590    pub struct PublishApiServer<T> {
1591        inner: Arc<T>,
1592        accept_compression_encodings: EnabledCompressionEncodings,
1593        send_compression_encodings: EnabledCompressionEncodings,
1594        max_decoding_message_size: Option<usize>,
1595        max_encoding_message_size: Option<usize>,
1596    }
1597    impl<T> PublishApiServer<T> {
1598        pub fn new(inner: T) -> Self {
1599            Self::from_arc(Arc::new(inner))
1600        }
1601        pub fn from_arc(inner: Arc<T>) -> Self {
1602            Self {
1603                inner,
1604                accept_compression_encodings: Default::default(),
1605                send_compression_encodings: Default::default(),
1606                max_decoding_message_size: None,
1607                max_encoding_message_size: None,
1608            }
1609        }
1610        pub fn with_interceptor<F>(
1611            inner: T,
1612            interceptor: F,
1613        ) -> InterceptedService<Self, F>
1614        where
1615            F: tonic::service::Interceptor,
1616        {
1617            InterceptedService::new(Self::new(inner), interceptor)
1618        }
1619        /// Enable decompressing requests with the given encoding.
1620        #[must_use]
1621        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1622            self.accept_compression_encodings.enable(encoding);
1623            self
1624        }
1625        /// Compress responses with the given encoding, if the client supports it.
1626        #[must_use]
1627        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1628            self.send_compression_encodings.enable(encoding);
1629            self
1630        }
1631        /// Limits the maximum size of a decoded message.
1632        ///
1633        /// Default: `4MB`
1634        #[must_use]
1635        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1636            self.max_decoding_message_size = Some(limit);
1637            self
1638        }
1639        /// Limits the maximum size of an encoded message.
1640        ///
1641        /// Default: `usize::MAX`
1642        #[must_use]
1643        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1644            self.max_encoding_message_size = Some(limit);
1645            self
1646        }
1647    }
1648    impl<T, B> tonic::codegen::Service<http::Request<B>> for PublishApiServer<T>
1649    where
1650        T: PublishApi,
1651        B: Body + std::marker::Send + 'static,
1652        B::Error: Into<StdError> + std::marker::Send + 'static,
1653    {
1654        type Response = http::Response<tonic::body::Body>;
1655        type Error = std::convert::Infallible;
1656        type Future = BoxFuture<Self::Response, Self::Error>;
1657        fn poll_ready(
1658            &mut self,
1659            _cx: &mut Context<'_>,
1660        ) -> Poll<std::result::Result<(), Self::Error>> {
1661            Poll::Ready(Ok(()))
1662        }
1663        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1664            match req.uri().path() {
1665                "/xmtp.xmtpv4.message_api.PublishApi/PublishPayerEnvelopes" => {
1666                    #[allow(non_camel_case_types)]
1667                    struct PublishPayerEnvelopesSvc<T: PublishApi>(pub Arc<T>);
1668                    impl<
1669                        T: PublishApi,
1670                    > tonic::server::UnaryService<super::PublishPayerEnvelopesRequest>
1671                    for PublishPayerEnvelopesSvc<T> {
1672                        type Response = super::PublishPayerEnvelopesResponse;
1673                        type Future = BoxFuture<
1674                            tonic::Response<Self::Response>,
1675                            tonic::Status,
1676                        >;
1677                        fn call(
1678                            &mut self,
1679                            request: tonic::Request<super::PublishPayerEnvelopesRequest>,
1680                        ) -> Self::Future {
1681                            let inner = Arc::clone(&self.0);
1682                            let fut = async move {
1683                                <T as PublishApi>::publish_payer_envelopes(&inner, request)
1684                                    .await
1685                            };
1686                            Box::pin(fut)
1687                        }
1688                    }
1689                    let accept_compression_encodings = self.accept_compression_encodings;
1690                    let send_compression_encodings = self.send_compression_encodings;
1691                    let max_decoding_message_size = self.max_decoding_message_size;
1692                    let max_encoding_message_size = self.max_encoding_message_size;
1693                    let inner = self.inner.clone();
1694                    let fut = async move {
1695                        let method = PublishPayerEnvelopesSvc(inner);
1696                        let codec = tonic_prost::ProstCodec::default();
1697                        let mut grpc = tonic::server::Grpc::new(codec)
1698                            .apply_compression_config(
1699                                accept_compression_encodings,
1700                                send_compression_encodings,
1701                            )
1702                            .apply_max_message_size_config(
1703                                max_decoding_message_size,
1704                                max_encoding_message_size,
1705                            );
1706                        let res = grpc.unary(method, req).await;
1707                        Ok(res)
1708                    };
1709                    Box::pin(fut)
1710                }
1711                _ => {
1712                    Box::pin(async move {
1713                        let mut response = http::Response::new(
1714                            tonic::body::Body::default(),
1715                        );
1716                        let headers = response.headers_mut();
1717                        headers
1718                            .insert(
1719                                tonic::Status::GRPC_STATUS,
1720                                (tonic::Code::Unimplemented as i32).into(),
1721                            );
1722                        headers
1723                            .insert(
1724                                http::header::CONTENT_TYPE,
1725                                tonic::metadata::GRPC_CONTENT_TYPE,
1726                            );
1727                        Ok(response)
1728                    })
1729                }
1730            }
1731        }
1732    }
1733    impl<T> Clone for PublishApiServer<T> {
1734        fn clone(&self) -> Self {
1735            let inner = self.inner.clone();
1736            Self {
1737                inner,
1738                accept_compression_encodings: self.accept_compression_encodings,
1739                send_compression_encodings: self.send_compression_encodings,
1740                max_decoding_message_size: self.max_decoding_message_size,
1741                max_encoding_message_size: self.max_encoding_message_size,
1742            }
1743        }
1744    }
1745    /// Generated gRPC service name
1746    pub const SERVICE_NAME: &str = "xmtp.xmtpv4.message_api.PublishApi";
1747    impl<T> tonic::server::NamedService for PublishApiServer<T> {
1748        const NAME: &'static str = SERVICE_NAME;
1749    }
1750}
1751#[derive(Clone, PartialEq, ::prost::Message)]
1752pub struct LivenessFailure {
1753    #[prost(uint32, tag = "1")]
1754    pub response_time_ns: u32,
1755    #[prost(oneof = "liveness_failure::Request", tags = "2, 3, 4")]
1756    pub request: ::core::option::Option<liveness_failure::Request>,
1757}
1758/// Nested message and enum types in `LivenessFailure`.
1759pub mod liveness_failure {
1760    #[derive(Clone, PartialEq, ::prost::Oneof)]
1761    pub enum Request {
1762        #[prost(message, tag = "2")]
1763        Subscribe(super::SubscribeEnvelopesRequest),
1764        #[prost(message, tag = "3")]
1765        Query(super::QueryEnvelopesRequest),
1766        #[prost(message, tag = "4")]
1767        Publish(super::PublishPayerEnvelopesRequest),
1768    }
1769}
1770impl ::prost::Name for LivenessFailure {
1771    const NAME: &'static str = "LivenessFailure";
1772    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
1773    fn full_name() -> ::prost::alloc::string::String {
1774        "xmtp.xmtpv4.message_api.LivenessFailure".into()
1775    }
1776    fn type_url() -> ::prost::alloc::string::String {
1777        "/xmtp.xmtpv4.message_api.LivenessFailure".into()
1778    }
1779}
1780#[derive(Clone, PartialEq, ::prost::Message)]
1781pub struct SafetyFailure {
1782    #[prost(message, repeated, tag = "1")]
1783    pub envelopes: ::prost::alloc::vec::Vec<super::envelopes::OriginatorEnvelope>,
1784}
1785impl ::prost::Name for SafetyFailure {
1786    const NAME: &'static str = "SafetyFailure";
1787    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
1788    fn full_name() -> ::prost::alloc::string::String {
1789        "xmtp.xmtpv4.message_api.SafetyFailure".into()
1790    }
1791    fn type_url() -> ::prost::alloc::string::String {
1792        "/xmtp.xmtpv4.message_api.SafetyFailure".into()
1793    }
1794}
1795#[derive(Clone, PartialEq, ::prost::Message)]
1796pub struct UnsignedMisbehaviorReport {
1797    #[prost(uint64, tag = "1")]
1798    pub reporter_time_ns: u64,
1799    #[prost(uint32, tag = "2")]
1800    pub misbehaving_node_id: u32,
1801    #[prost(enumeration = "Misbehavior", tag = "3")]
1802    pub r#type: i32,
1803    /// Nodes must verify this field is false for client-submitted reports
1804    #[prost(bool, tag = "6")]
1805    pub submitted_by_node: bool,
1806    #[prost(oneof = "unsigned_misbehavior_report::Failure", tags = "4, 5")]
1807    pub failure: ::core::option::Option<unsigned_misbehavior_report::Failure>,
1808}
1809/// Nested message and enum types in `UnsignedMisbehaviorReport`.
1810pub mod unsigned_misbehavior_report {
1811    #[derive(Clone, PartialEq, ::prost::Oneof)]
1812    pub enum Failure {
1813        #[prost(message, tag = "4")]
1814        Liveness(super::LivenessFailure),
1815        #[prost(message, tag = "5")]
1816        Safety(super::SafetyFailure),
1817    }
1818}
1819impl ::prost::Name for UnsignedMisbehaviorReport {
1820    const NAME: &'static str = "UnsignedMisbehaviorReport";
1821    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
1822    fn full_name() -> ::prost::alloc::string::String {
1823        "xmtp.xmtpv4.message_api.UnsignedMisbehaviorReport".into()
1824    }
1825    fn type_url() -> ::prost::alloc::string::String {
1826        "/xmtp.xmtpv4.message_api.UnsignedMisbehaviorReport".into()
1827    }
1828}
1829#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1830pub struct MisbehaviorReport {
1831    /// Server time when the report was stored. Used only for querying reports.
1832    /// This field is not signed.
1833    #[prost(uint64, tag = "1")]
1834    pub server_time_ns: u64,
1835    #[prost(bytes = "vec", tag = "2")]
1836    pub unsigned_misbehavior_report: ::prost::alloc::vec::Vec<u8>,
1837    /// Signed by the node hosting the report
1838    #[prost(message, optional, tag = "3")]
1839    pub signature: ::core::option::Option<
1840        super::super::identity::associations::RecoverableEcdsaSignature,
1841    >,
1842}
1843impl ::prost::Name for MisbehaviorReport {
1844    const NAME: &'static str = "MisbehaviorReport";
1845    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
1846    fn full_name() -> ::prost::alloc::string::String {
1847        "xmtp.xmtpv4.message_api.MisbehaviorReport".into()
1848    }
1849    fn type_url() -> ::prost::alloc::string::String {
1850        "/xmtp.xmtpv4.message_api.MisbehaviorReport".into()
1851    }
1852}
1853#[derive(Clone, PartialEq, ::prost::Message)]
1854pub struct SubmitMisbehaviorReportRequest {
1855    #[prost(message, optional, tag = "1")]
1856    pub report: ::core::option::Option<UnsignedMisbehaviorReport>,
1857}
1858impl ::prost::Name for SubmitMisbehaviorReportRequest {
1859    const NAME: &'static str = "SubmitMisbehaviorReportRequest";
1860    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
1861    fn full_name() -> ::prost::alloc::string::String {
1862        "xmtp.xmtpv4.message_api.SubmitMisbehaviorReportRequest".into()
1863    }
1864    fn type_url() -> ::prost::alloc::string::String {
1865        "/xmtp.xmtpv4.message_api.SubmitMisbehaviorReportRequest".into()
1866    }
1867}
1868#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1869pub struct SubmitMisbehaviorReportResponse {}
1870impl ::prost::Name for SubmitMisbehaviorReportResponse {
1871    const NAME: &'static str = "SubmitMisbehaviorReportResponse";
1872    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
1873    fn full_name() -> ::prost::alloc::string::String {
1874        "xmtp.xmtpv4.message_api.SubmitMisbehaviorReportResponse".into()
1875    }
1876    fn type_url() -> ::prost::alloc::string::String {
1877        "/xmtp.xmtpv4.message_api.SubmitMisbehaviorReportResponse".into()
1878    }
1879}
1880#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1881pub struct QueryMisbehaviorReportsRequest {
1882    #[prost(uint64, tag = "1")]
1883    pub after_ns: u64,
1884}
1885impl ::prost::Name for QueryMisbehaviorReportsRequest {
1886    const NAME: &'static str = "QueryMisbehaviorReportsRequest";
1887    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
1888    fn full_name() -> ::prost::alloc::string::String {
1889        "xmtp.xmtpv4.message_api.QueryMisbehaviorReportsRequest".into()
1890    }
1891    fn type_url() -> ::prost::alloc::string::String {
1892        "/xmtp.xmtpv4.message_api.QueryMisbehaviorReportsRequest".into()
1893    }
1894}
1895#[derive(Clone, PartialEq, ::prost::Message)]
1896pub struct QueryMisbehaviorReportsResponse {
1897    #[prost(message, repeated, tag = "1")]
1898    pub reports: ::prost::alloc::vec::Vec<MisbehaviorReport>,
1899}
1900impl ::prost::Name for QueryMisbehaviorReportsResponse {
1901    const NAME: &'static str = "QueryMisbehaviorReportsResponse";
1902    const PACKAGE: &'static str = "xmtp.xmtpv4.message_api";
1903    fn full_name() -> ::prost::alloc::string::String {
1904        "xmtp.xmtpv4.message_api.QueryMisbehaviorReportsResponse".into()
1905    }
1906    fn type_url() -> ::prost::alloc::string::String {
1907        "/xmtp.xmtpv4.message_api.QueryMisbehaviorReportsResponse".into()
1908    }
1909}
1910#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1911#[repr(i32)]
1912pub enum Misbehavior {
1913    Unspecified = 0,
1914    UnresponsiveNode = 1,
1915    SlowNode = 2,
1916    FailedRequest = 3,
1917    OutOfOrder = 4,
1918    DuplicateSequenceId = 5,
1919    CausalOrdering = 6,
1920    InvalidPayload = 7,
1921    BlockchainInconsistency = 8,
1922}
1923impl Misbehavior {
1924    /// String value of the enum field names used in the ProtoBuf definition.
1925    ///
1926    /// The values are not transformed in any way and thus are considered stable
1927    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1928    pub fn as_str_name(&self) -> &'static str {
1929        match self {
1930            Self::Unspecified => "MISBEHAVIOR_UNSPECIFIED",
1931            Self::UnresponsiveNode => "MISBEHAVIOR_UNRESPONSIVE_NODE",
1932            Self::SlowNode => "MISBEHAVIOR_SLOW_NODE",
1933            Self::FailedRequest => "MISBEHAVIOR_FAILED_REQUEST",
1934            Self::OutOfOrder => "MISBEHAVIOR_OUT_OF_ORDER",
1935            Self::DuplicateSequenceId => "MISBEHAVIOR_DUPLICATE_SEQUENCE_ID",
1936            Self::CausalOrdering => "MISBEHAVIOR_CAUSAL_ORDERING",
1937            Self::InvalidPayload => "MISBEHAVIOR_INVALID_PAYLOAD",
1938            Self::BlockchainInconsistency => "MISBEHAVIOR_BLOCKCHAIN_INCONSISTENCY",
1939        }
1940    }
1941    /// Creates an enum from field names used in the ProtoBuf definition.
1942    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1943        match value {
1944            "MISBEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
1945            "MISBEHAVIOR_UNRESPONSIVE_NODE" => Some(Self::UnresponsiveNode),
1946            "MISBEHAVIOR_SLOW_NODE" => Some(Self::SlowNode),
1947            "MISBEHAVIOR_FAILED_REQUEST" => Some(Self::FailedRequest),
1948            "MISBEHAVIOR_OUT_OF_ORDER" => Some(Self::OutOfOrder),
1949            "MISBEHAVIOR_DUPLICATE_SEQUENCE_ID" => Some(Self::DuplicateSequenceId),
1950            "MISBEHAVIOR_CAUSAL_ORDERING" => Some(Self::CausalOrdering),
1951            "MISBEHAVIOR_INVALID_PAYLOAD" => Some(Self::InvalidPayload),
1952            "MISBEHAVIOR_BLOCKCHAIN_INCONSISTENCY" => Some(Self::BlockchainInconsistency),
1953            _ => None,
1954        }
1955    }
1956}
1957/// Generated server implementations.
1958#[cfg(any(not(target_arch = "wasm32"), feature = "grpc_server_impls"))]
1959pub mod misbehavior_api_server {
1960    #![allow(
1961        unused_variables,
1962        dead_code,
1963        missing_docs,
1964        clippy::wildcard_imports,
1965        clippy::let_unit_value,
1966    )]
1967    use tonic::codegen::*;
1968    /// Generated trait containing gRPC methods that should be implemented for use with MisbehaviorApiServer.
1969    #[async_trait]
1970    pub trait MisbehaviorApi: std::marker::Send + std::marker::Sync + 'static {
1971        async fn submit_misbehavior_report(
1972            &self,
1973            request: tonic::Request<super::SubmitMisbehaviorReportRequest>,
1974        ) -> std::result::Result<
1975            tonic::Response<super::SubmitMisbehaviorReportResponse>,
1976            tonic::Status,
1977        >;
1978        async fn query_misbehavior_reports(
1979            &self,
1980            request: tonic::Request<super::QueryMisbehaviorReportsRequest>,
1981        ) -> std::result::Result<
1982            tonic::Response<super::QueryMisbehaviorReportsResponse>,
1983            tonic::Status,
1984        >;
1985    }
1986    #[derive(Debug)]
1987    pub struct MisbehaviorApiServer<T> {
1988        inner: Arc<T>,
1989        accept_compression_encodings: EnabledCompressionEncodings,
1990        send_compression_encodings: EnabledCompressionEncodings,
1991        max_decoding_message_size: Option<usize>,
1992        max_encoding_message_size: Option<usize>,
1993    }
1994    impl<T> MisbehaviorApiServer<T> {
1995        pub fn new(inner: T) -> Self {
1996            Self::from_arc(Arc::new(inner))
1997        }
1998        pub fn from_arc(inner: Arc<T>) -> Self {
1999            Self {
2000                inner,
2001                accept_compression_encodings: Default::default(),
2002                send_compression_encodings: Default::default(),
2003                max_decoding_message_size: None,
2004                max_encoding_message_size: None,
2005            }
2006        }
2007        pub fn with_interceptor<F>(
2008            inner: T,
2009            interceptor: F,
2010        ) -> InterceptedService<Self, F>
2011        where
2012            F: tonic::service::Interceptor,
2013        {
2014            InterceptedService::new(Self::new(inner), interceptor)
2015        }
2016        /// Enable decompressing requests with the given encoding.
2017        #[must_use]
2018        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2019            self.accept_compression_encodings.enable(encoding);
2020            self
2021        }
2022        /// Compress responses with the given encoding, if the client supports it.
2023        #[must_use]
2024        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2025            self.send_compression_encodings.enable(encoding);
2026            self
2027        }
2028        /// Limits the maximum size of a decoded message.
2029        ///
2030        /// Default: `4MB`
2031        #[must_use]
2032        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2033            self.max_decoding_message_size = Some(limit);
2034            self
2035        }
2036        /// Limits the maximum size of an encoded message.
2037        ///
2038        /// Default: `usize::MAX`
2039        #[must_use]
2040        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2041            self.max_encoding_message_size = Some(limit);
2042            self
2043        }
2044    }
2045    impl<T, B> tonic::codegen::Service<http::Request<B>> for MisbehaviorApiServer<T>
2046    where
2047        T: MisbehaviorApi,
2048        B: Body + std::marker::Send + 'static,
2049        B::Error: Into<StdError> + std::marker::Send + 'static,
2050    {
2051        type Response = http::Response<tonic::body::Body>;
2052        type Error = std::convert::Infallible;
2053        type Future = BoxFuture<Self::Response, Self::Error>;
2054        fn poll_ready(
2055            &mut self,
2056            _cx: &mut Context<'_>,
2057        ) -> Poll<std::result::Result<(), Self::Error>> {
2058            Poll::Ready(Ok(()))
2059        }
2060        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2061            match req.uri().path() {
2062                "/xmtp.xmtpv4.message_api.MisbehaviorApi/SubmitMisbehaviorReport" => {
2063                    #[allow(non_camel_case_types)]
2064                    struct SubmitMisbehaviorReportSvc<T: MisbehaviorApi>(pub Arc<T>);
2065                    impl<
2066                        T: MisbehaviorApi,
2067                    > tonic::server::UnaryService<super::SubmitMisbehaviorReportRequest>
2068                    for SubmitMisbehaviorReportSvc<T> {
2069                        type Response = super::SubmitMisbehaviorReportResponse;
2070                        type Future = BoxFuture<
2071                            tonic::Response<Self::Response>,
2072                            tonic::Status,
2073                        >;
2074                        fn call(
2075                            &mut self,
2076                            request: tonic::Request<
2077                                super::SubmitMisbehaviorReportRequest,
2078                            >,
2079                        ) -> Self::Future {
2080                            let inner = Arc::clone(&self.0);
2081                            let fut = async move {
2082                                <T as MisbehaviorApi>::submit_misbehavior_report(
2083                                        &inner,
2084                                        request,
2085                                    )
2086                                    .await
2087                            };
2088                            Box::pin(fut)
2089                        }
2090                    }
2091                    let accept_compression_encodings = self.accept_compression_encodings;
2092                    let send_compression_encodings = self.send_compression_encodings;
2093                    let max_decoding_message_size = self.max_decoding_message_size;
2094                    let max_encoding_message_size = self.max_encoding_message_size;
2095                    let inner = self.inner.clone();
2096                    let fut = async move {
2097                        let method = SubmitMisbehaviorReportSvc(inner);
2098                        let codec = tonic_prost::ProstCodec::default();
2099                        let mut grpc = tonic::server::Grpc::new(codec)
2100                            .apply_compression_config(
2101                                accept_compression_encodings,
2102                                send_compression_encodings,
2103                            )
2104                            .apply_max_message_size_config(
2105                                max_decoding_message_size,
2106                                max_encoding_message_size,
2107                            );
2108                        let res = grpc.unary(method, req).await;
2109                        Ok(res)
2110                    };
2111                    Box::pin(fut)
2112                }
2113                "/xmtp.xmtpv4.message_api.MisbehaviorApi/QueryMisbehaviorReports" => {
2114                    #[allow(non_camel_case_types)]
2115                    struct QueryMisbehaviorReportsSvc<T: MisbehaviorApi>(pub Arc<T>);
2116                    impl<
2117                        T: MisbehaviorApi,
2118                    > tonic::server::UnaryService<super::QueryMisbehaviorReportsRequest>
2119                    for QueryMisbehaviorReportsSvc<T> {
2120                        type Response = super::QueryMisbehaviorReportsResponse;
2121                        type Future = BoxFuture<
2122                            tonic::Response<Self::Response>,
2123                            tonic::Status,
2124                        >;
2125                        fn call(
2126                            &mut self,
2127                            request: tonic::Request<
2128                                super::QueryMisbehaviorReportsRequest,
2129                            >,
2130                        ) -> Self::Future {
2131                            let inner = Arc::clone(&self.0);
2132                            let fut = async move {
2133                                <T as MisbehaviorApi>::query_misbehavior_reports(
2134                                        &inner,
2135                                        request,
2136                                    )
2137                                    .await
2138                            };
2139                            Box::pin(fut)
2140                        }
2141                    }
2142                    let accept_compression_encodings = self.accept_compression_encodings;
2143                    let send_compression_encodings = self.send_compression_encodings;
2144                    let max_decoding_message_size = self.max_decoding_message_size;
2145                    let max_encoding_message_size = self.max_encoding_message_size;
2146                    let inner = self.inner.clone();
2147                    let fut = async move {
2148                        let method = QueryMisbehaviorReportsSvc(inner);
2149                        let codec = tonic_prost::ProstCodec::default();
2150                        let mut grpc = tonic::server::Grpc::new(codec)
2151                            .apply_compression_config(
2152                                accept_compression_encodings,
2153                                send_compression_encodings,
2154                            )
2155                            .apply_max_message_size_config(
2156                                max_decoding_message_size,
2157                                max_encoding_message_size,
2158                            );
2159                        let res = grpc.unary(method, req).await;
2160                        Ok(res)
2161                    };
2162                    Box::pin(fut)
2163                }
2164                _ => {
2165                    Box::pin(async move {
2166                        let mut response = http::Response::new(
2167                            tonic::body::Body::default(),
2168                        );
2169                        let headers = response.headers_mut();
2170                        headers
2171                            .insert(
2172                                tonic::Status::GRPC_STATUS,
2173                                (tonic::Code::Unimplemented as i32).into(),
2174                            );
2175                        headers
2176                            .insert(
2177                                http::header::CONTENT_TYPE,
2178                                tonic::metadata::GRPC_CONTENT_TYPE,
2179                            );
2180                        Ok(response)
2181                    })
2182                }
2183            }
2184        }
2185    }
2186    impl<T> Clone for MisbehaviorApiServer<T> {
2187        fn clone(&self) -> Self {
2188            let inner = self.inner.clone();
2189            Self {
2190                inner,
2191                accept_compression_encodings: self.accept_compression_encodings,
2192                send_compression_encodings: self.send_compression_encodings,
2193                max_decoding_message_size: self.max_decoding_message_size,
2194                max_encoding_message_size: self.max_encoding_message_size,
2195            }
2196        }
2197    }
2198    /// Generated gRPC service name
2199    pub const SERVICE_NAME: &str = "xmtp.xmtpv4.message_api.MisbehaviorApi";
2200    impl<T> tonic::server::NamedService for MisbehaviorApiServer<T> {
2201        const NAME: &'static str = SERVICE_NAME;
2202    }
2203}
2204/// Generated server implementations.
2205#[cfg(any(not(target_arch = "wasm32"), feature = "grpc_server_impls"))]
2206pub mod query_api_server {
2207    #![allow(
2208        unused_variables,
2209        dead_code,
2210        missing_docs,
2211        clippy::wildcard_imports,
2212        clippy::let_unit_value,
2213    )]
2214    use tonic::codegen::*;
2215    /// Generated trait containing gRPC methods that should be implemented for use with QueryApiServer.
2216    #[async_trait]
2217    pub trait QueryApi: std::marker::Send + std::marker::Sync + 'static {
2218        async fn query_envelopes(
2219            &self,
2220            request: tonic::Request<super::QueryEnvelopesRequest>,
2221        ) -> std::result::Result<
2222            tonic::Response<super::QueryEnvelopesResponse>,
2223            tonic::Status,
2224        >;
2225        /// Server streaming response type for the SubscribeTopics method.
2226        type SubscribeTopicsStream: tonic::codegen::tokio_stream::Stream<
2227                Item = std::result::Result<super::SubscribeTopicsResponse, tonic::Status>,
2228            >
2229            + std::marker::Send
2230            + 'static;
2231        async fn subscribe_topics(
2232            &self,
2233            request: tonic::Request<super::SubscribeTopicsRequest>,
2234        ) -> std::result::Result<
2235            tonic::Response<Self::SubscribeTopicsStream>,
2236            tonic::Status,
2237        >;
2238        /// Server streaming response type for the Subscribe method.
2239        type SubscribeStream: tonic::codegen::tokio_stream::Stream<
2240                Item = std::result::Result<super::SubscribeResponse, tonic::Status>,
2241            >
2242            + std::marker::Send
2243            + 'static;
2244        /// XIP-83 bidirectional mutable subscription: a single long-lived stream the
2245        /// client mutates in place (add/remove topics) with ping/pong liveness, in
2246        /// contrast to SubscribeTopics' fixed, immutable, server-streaming filter set.
2247        /// Bidi streaming requires HTTP/2 (not grpc-web / connect-web); browser
2248        /// clients stay on SubscribeTopics.
2249        async fn subscribe(
2250            &self,
2251            request: tonic::Request<tonic::Streaming<super::SubscribeRequest>>,
2252        ) -> std::result::Result<tonic::Response<Self::SubscribeStream>, tonic::Status>;
2253        async fn get_inbox_ids(
2254            &self,
2255            request: tonic::Request<super::GetInboxIdsRequest>,
2256        ) -> std::result::Result<
2257            tonic::Response<super::GetInboxIdsResponse>,
2258            tonic::Status,
2259        >;
2260        async fn get_newest_envelope(
2261            &self,
2262            request: tonic::Request<super::GetNewestEnvelopeRequest>,
2263        ) -> std::result::Result<
2264            tonic::Response<super::GetNewestEnvelopeResponse>,
2265            tonic::Status,
2266        >;
2267    }
2268    /// Client -> Node. No auth token required.
2269    #[derive(Debug)]
2270    pub struct QueryApiServer<T> {
2271        inner: Arc<T>,
2272        accept_compression_encodings: EnabledCompressionEncodings,
2273        send_compression_encodings: EnabledCompressionEncodings,
2274        max_decoding_message_size: Option<usize>,
2275        max_encoding_message_size: Option<usize>,
2276    }
2277    impl<T> QueryApiServer<T> {
2278        pub fn new(inner: T) -> Self {
2279            Self::from_arc(Arc::new(inner))
2280        }
2281        pub fn from_arc(inner: Arc<T>) -> Self {
2282            Self {
2283                inner,
2284                accept_compression_encodings: Default::default(),
2285                send_compression_encodings: Default::default(),
2286                max_decoding_message_size: None,
2287                max_encoding_message_size: None,
2288            }
2289        }
2290        pub fn with_interceptor<F>(
2291            inner: T,
2292            interceptor: F,
2293        ) -> InterceptedService<Self, F>
2294        where
2295            F: tonic::service::Interceptor,
2296        {
2297            InterceptedService::new(Self::new(inner), interceptor)
2298        }
2299        /// Enable decompressing requests with the given encoding.
2300        #[must_use]
2301        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2302            self.accept_compression_encodings.enable(encoding);
2303            self
2304        }
2305        /// Compress responses with the given encoding, if the client supports it.
2306        #[must_use]
2307        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2308            self.send_compression_encodings.enable(encoding);
2309            self
2310        }
2311        /// Limits the maximum size of a decoded message.
2312        ///
2313        /// Default: `4MB`
2314        #[must_use]
2315        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2316            self.max_decoding_message_size = Some(limit);
2317            self
2318        }
2319        /// Limits the maximum size of an encoded message.
2320        ///
2321        /// Default: `usize::MAX`
2322        #[must_use]
2323        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2324            self.max_encoding_message_size = Some(limit);
2325            self
2326        }
2327    }
2328    impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryApiServer<T>
2329    where
2330        T: QueryApi,
2331        B: Body + std::marker::Send + 'static,
2332        B::Error: Into<StdError> + std::marker::Send + 'static,
2333    {
2334        type Response = http::Response<tonic::body::Body>;
2335        type Error = std::convert::Infallible;
2336        type Future = BoxFuture<Self::Response, Self::Error>;
2337        fn poll_ready(
2338            &mut self,
2339            _cx: &mut Context<'_>,
2340        ) -> Poll<std::result::Result<(), Self::Error>> {
2341            Poll::Ready(Ok(()))
2342        }
2343        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2344            match req.uri().path() {
2345                "/xmtp.xmtpv4.message_api.QueryApi/QueryEnvelopes" => {
2346                    #[allow(non_camel_case_types)]
2347                    struct QueryEnvelopesSvc<T: QueryApi>(pub Arc<T>);
2348                    impl<
2349                        T: QueryApi,
2350                    > tonic::server::UnaryService<super::QueryEnvelopesRequest>
2351                    for QueryEnvelopesSvc<T> {
2352                        type Response = super::QueryEnvelopesResponse;
2353                        type Future = BoxFuture<
2354                            tonic::Response<Self::Response>,
2355                            tonic::Status,
2356                        >;
2357                        fn call(
2358                            &mut self,
2359                            request: tonic::Request<super::QueryEnvelopesRequest>,
2360                        ) -> Self::Future {
2361                            let inner = Arc::clone(&self.0);
2362                            let fut = async move {
2363                                <T as QueryApi>::query_envelopes(&inner, request).await
2364                            };
2365                            Box::pin(fut)
2366                        }
2367                    }
2368                    let accept_compression_encodings = self.accept_compression_encodings;
2369                    let send_compression_encodings = self.send_compression_encodings;
2370                    let max_decoding_message_size = self.max_decoding_message_size;
2371                    let max_encoding_message_size = self.max_encoding_message_size;
2372                    let inner = self.inner.clone();
2373                    let fut = async move {
2374                        let method = QueryEnvelopesSvc(inner);
2375                        let codec = tonic_prost::ProstCodec::default();
2376                        let mut grpc = tonic::server::Grpc::new(codec)
2377                            .apply_compression_config(
2378                                accept_compression_encodings,
2379                                send_compression_encodings,
2380                            )
2381                            .apply_max_message_size_config(
2382                                max_decoding_message_size,
2383                                max_encoding_message_size,
2384                            );
2385                        let res = grpc.unary(method, req).await;
2386                        Ok(res)
2387                    };
2388                    Box::pin(fut)
2389                }
2390                "/xmtp.xmtpv4.message_api.QueryApi/SubscribeTopics" => {
2391                    #[allow(non_camel_case_types)]
2392                    struct SubscribeTopicsSvc<T: QueryApi>(pub Arc<T>);
2393                    impl<
2394                        T: QueryApi,
2395                    > tonic::server::ServerStreamingService<
2396                        super::SubscribeTopicsRequest,
2397                    > for SubscribeTopicsSvc<T> {
2398                        type Response = super::SubscribeTopicsResponse;
2399                        type ResponseStream = T::SubscribeTopicsStream;
2400                        type Future = BoxFuture<
2401                            tonic::Response<Self::ResponseStream>,
2402                            tonic::Status,
2403                        >;
2404                        fn call(
2405                            &mut self,
2406                            request: tonic::Request<super::SubscribeTopicsRequest>,
2407                        ) -> Self::Future {
2408                            let inner = Arc::clone(&self.0);
2409                            let fut = async move {
2410                                <T as QueryApi>::subscribe_topics(&inner, request).await
2411                            };
2412                            Box::pin(fut)
2413                        }
2414                    }
2415                    let accept_compression_encodings = self.accept_compression_encodings;
2416                    let send_compression_encodings = self.send_compression_encodings;
2417                    let max_decoding_message_size = self.max_decoding_message_size;
2418                    let max_encoding_message_size = self.max_encoding_message_size;
2419                    let inner = self.inner.clone();
2420                    let fut = async move {
2421                        let method = SubscribeTopicsSvc(inner);
2422                        let codec = tonic_prost::ProstCodec::default();
2423                        let mut grpc = tonic::server::Grpc::new(codec)
2424                            .apply_compression_config(
2425                                accept_compression_encodings,
2426                                send_compression_encodings,
2427                            )
2428                            .apply_max_message_size_config(
2429                                max_decoding_message_size,
2430                                max_encoding_message_size,
2431                            );
2432                        let res = grpc.server_streaming(method, req).await;
2433                        Ok(res)
2434                    };
2435                    Box::pin(fut)
2436                }
2437                "/xmtp.xmtpv4.message_api.QueryApi/Subscribe" => {
2438                    #[allow(non_camel_case_types)]
2439                    struct SubscribeSvc<T: QueryApi>(pub Arc<T>);
2440                    impl<
2441                        T: QueryApi,
2442                    > tonic::server::StreamingService<super::SubscribeRequest>
2443                    for SubscribeSvc<T> {
2444                        type Response = super::SubscribeResponse;
2445                        type ResponseStream = T::SubscribeStream;
2446                        type Future = BoxFuture<
2447                            tonic::Response<Self::ResponseStream>,
2448                            tonic::Status,
2449                        >;
2450                        fn call(
2451                            &mut self,
2452                            request: tonic::Request<
2453                                tonic::Streaming<super::SubscribeRequest>,
2454                            >,
2455                        ) -> Self::Future {
2456                            let inner = Arc::clone(&self.0);
2457                            let fut = async move {
2458                                <T as QueryApi>::subscribe(&inner, request).await
2459                            };
2460                            Box::pin(fut)
2461                        }
2462                    }
2463                    let accept_compression_encodings = self.accept_compression_encodings;
2464                    let send_compression_encodings = self.send_compression_encodings;
2465                    let max_decoding_message_size = self.max_decoding_message_size;
2466                    let max_encoding_message_size = self.max_encoding_message_size;
2467                    let inner = self.inner.clone();
2468                    let fut = async move {
2469                        let method = SubscribeSvc(inner);
2470                        let codec = tonic_prost::ProstCodec::default();
2471                        let mut grpc = tonic::server::Grpc::new(codec)
2472                            .apply_compression_config(
2473                                accept_compression_encodings,
2474                                send_compression_encodings,
2475                            )
2476                            .apply_max_message_size_config(
2477                                max_decoding_message_size,
2478                                max_encoding_message_size,
2479                            );
2480                        let res = grpc.streaming(method, req).await;
2481                        Ok(res)
2482                    };
2483                    Box::pin(fut)
2484                }
2485                "/xmtp.xmtpv4.message_api.QueryApi/GetInboxIds" => {
2486                    #[allow(non_camel_case_types)]
2487                    struct GetInboxIdsSvc<T: QueryApi>(pub Arc<T>);
2488                    impl<
2489                        T: QueryApi,
2490                    > tonic::server::UnaryService<super::GetInboxIdsRequest>
2491                    for GetInboxIdsSvc<T> {
2492                        type Response = super::GetInboxIdsResponse;
2493                        type Future = BoxFuture<
2494                            tonic::Response<Self::Response>,
2495                            tonic::Status,
2496                        >;
2497                        fn call(
2498                            &mut self,
2499                            request: tonic::Request<super::GetInboxIdsRequest>,
2500                        ) -> Self::Future {
2501                            let inner = Arc::clone(&self.0);
2502                            let fut = async move {
2503                                <T as QueryApi>::get_inbox_ids(&inner, request).await
2504                            };
2505                            Box::pin(fut)
2506                        }
2507                    }
2508                    let accept_compression_encodings = self.accept_compression_encodings;
2509                    let send_compression_encodings = self.send_compression_encodings;
2510                    let max_decoding_message_size = self.max_decoding_message_size;
2511                    let max_encoding_message_size = self.max_encoding_message_size;
2512                    let inner = self.inner.clone();
2513                    let fut = async move {
2514                        let method = GetInboxIdsSvc(inner);
2515                        let codec = tonic_prost::ProstCodec::default();
2516                        let mut grpc = tonic::server::Grpc::new(codec)
2517                            .apply_compression_config(
2518                                accept_compression_encodings,
2519                                send_compression_encodings,
2520                            )
2521                            .apply_max_message_size_config(
2522                                max_decoding_message_size,
2523                                max_encoding_message_size,
2524                            );
2525                        let res = grpc.unary(method, req).await;
2526                        Ok(res)
2527                    };
2528                    Box::pin(fut)
2529                }
2530                "/xmtp.xmtpv4.message_api.QueryApi/GetNewestEnvelope" => {
2531                    #[allow(non_camel_case_types)]
2532                    struct GetNewestEnvelopeSvc<T: QueryApi>(pub Arc<T>);
2533                    impl<
2534                        T: QueryApi,
2535                    > tonic::server::UnaryService<super::GetNewestEnvelopeRequest>
2536                    for GetNewestEnvelopeSvc<T> {
2537                        type Response = super::GetNewestEnvelopeResponse;
2538                        type Future = BoxFuture<
2539                            tonic::Response<Self::Response>,
2540                            tonic::Status,
2541                        >;
2542                        fn call(
2543                            &mut self,
2544                            request: tonic::Request<super::GetNewestEnvelopeRequest>,
2545                        ) -> Self::Future {
2546                            let inner = Arc::clone(&self.0);
2547                            let fut = async move {
2548                                <T as QueryApi>::get_newest_envelope(&inner, request).await
2549                            };
2550                            Box::pin(fut)
2551                        }
2552                    }
2553                    let accept_compression_encodings = self.accept_compression_encodings;
2554                    let send_compression_encodings = self.send_compression_encodings;
2555                    let max_decoding_message_size = self.max_decoding_message_size;
2556                    let max_encoding_message_size = self.max_encoding_message_size;
2557                    let inner = self.inner.clone();
2558                    let fut = async move {
2559                        let method = GetNewestEnvelopeSvc(inner);
2560                        let codec = tonic_prost::ProstCodec::default();
2561                        let mut grpc = tonic::server::Grpc::new(codec)
2562                            .apply_compression_config(
2563                                accept_compression_encodings,
2564                                send_compression_encodings,
2565                            )
2566                            .apply_max_message_size_config(
2567                                max_decoding_message_size,
2568                                max_encoding_message_size,
2569                            );
2570                        let res = grpc.unary(method, req).await;
2571                        Ok(res)
2572                    };
2573                    Box::pin(fut)
2574                }
2575                _ => {
2576                    Box::pin(async move {
2577                        let mut response = http::Response::new(
2578                            tonic::body::Body::default(),
2579                        );
2580                        let headers = response.headers_mut();
2581                        headers
2582                            .insert(
2583                                tonic::Status::GRPC_STATUS,
2584                                (tonic::Code::Unimplemented as i32).into(),
2585                            );
2586                        headers
2587                            .insert(
2588                                http::header::CONTENT_TYPE,
2589                                tonic::metadata::GRPC_CONTENT_TYPE,
2590                            );
2591                        Ok(response)
2592                    })
2593                }
2594            }
2595        }
2596    }
2597    impl<T> Clone for QueryApiServer<T> {
2598        fn clone(&self) -> Self {
2599            let inner = self.inner.clone();
2600            Self {
2601                inner,
2602                accept_compression_encodings: self.accept_compression_encodings,
2603                send_compression_encodings: self.send_compression_encodings,
2604                max_decoding_message_size: self.max_decoding_message_size,
2605                max_encoding_message_size: self.max_encoding_message_size,
2606            }
2607        }
2608    }
2609    /// Generated gRPC service name
2610    pub const SERVICE_NAME: &str = "xmtp.xmtpv4.message_api.QueryApi";
2611    impl<T> tonic::server::NamedService for QueryApiServer<T> {
2612        const NAME: &'static str = SERVICE_NAME;
2613    }
2614}