xmtp_proto/gen/
xmtp.message_contents.rs

1// This file is @generated by prost-build.
2/// Signature represents a generalized public key signature,
3/// defined as a union to support cryptographic algorithm agility.
4#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct Signature {
6    #[prost(oneof = "signature::Union", tags = "1, 2")]
7    pub union: ::core::option::Option<signature::Union>,
8}
9/// Nested message and enum types in `Signature`.
10pub mod signature {
11    /// ECDSA signature bytes and the recovery bit
12    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
13    pub struct EcdsaCompact {
14        /// compact representation \[ R || S \], 64 bytes
15        #[prost(bytes = "vec", tag = "1")]
16        pub bytes: ::prost::alloc::vec::Vec<u8>,
17        /// recovery bit
18        #[prost(uint32, tag = "2")]
19        pub recovery: u32,
20    }
21    impl ::prost::Name for EcdsaCompact {
22        const NAME: &'static str = "ECDSACompact";
23        const PACKAGE: &'static str = "xmtp.message_contents";
24        fn full_name() -> ::prost::alloc::string::String {
25            "xmtp.message_contents.Signature.ECDSACompact".into()
26        }
27        fn type_url() -> ::prost::alloc::string::String {
28            "/xmtp.message_contents.Signature.ECDSACompact".into()
29        }
30    }
31    /// ECDSA signature bytes and the recovery bit
32    /// produced by xmtp-js::PublicKey.signWithWallet function, i.e.
33    /// EIP-191 signature of a "Create Identity" message with the key embedded.
34    /// Used to sign identity keys.
35    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
36    pub struct WalletEcdsaCompact {
37        /// compact representation \[ R || S \], 64 bytes
38        #[prost(bytes = "vec", tag = "1")]
39        pub bytes: ::prost::alloc::vec::Vec<u8>,
40        /// recovery bit
41        #[prost(uint32, tag = "2")]
42        pub recovery: u32,
43    }
44    impl ::prost::Name for WalletEcdsaCompact {
45        const NAME: &'static str = "WalletECDSACompact";
46        const PACKAGE: &'static str = "xmtp.message_contents";
47        fn full_name() -> ::prost::alloc::string::String {
48            "xmtp.message_contents.Signature.WalletECDSACompact".into()
49        }
50        fn type_url() -> ::prost::alloc::string::String {
51            "/xmtp.message_contents.Signature.WalletECDSACompact".into()
52        }
53    }
54    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
55    pub enum Union {
56        #[prost(message, tag = "1")]
57        EcdsaCompact(EcdsaCompact),
58        #[prost(message, tag = "2")]
59        WalletEcdsaCompact(WalletEcdsaCompact),
60    }
61}
62impl ::prost::Name for Signature {
63    const NAME: &'static str = "Signature";
64    const PACKAGE: &'static str = "xmtp.message_contents";
65    fn full_name() -> ::prost::alloc::string::String {
66        "xmtp.message_contents.Signature".into()
67    }
68    fn type_url() -> ::prost::alloc::string::String {
69        "/xmtp.message_contents.Signature".into()
70    }
71}
72/// UnsignedPublicKey represents a generalized public key,
73/// defined as a union to support cryptographic algorithm agility.
74#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
75pub struct UnsignedPublicKey {
76    #[prost(uint64, tag = "1")]
77    pub created_ns: u64,
78    #[prost(oneof = "unsigned_public_key::Union", tags = "3")]
79    pub union: ::core::option::Option<unsigned_public_key::Union>,
80}
81/// Nested message and enum types in `UnsignedPublicKey`.
82pub mod unsigned_public_key {
83    /// EC: SECP256k1
84    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
85    pub struct Secp256k1Uncompressed {
86        /// uncompressed point with prefix (0x04) \[ P || X || Y \], 65 bytes
87        #[prost(bytes = "vec", tag = "1")]
88        pub bytes: ::prost::alloc::vec::Vec<u8>,
89    }
90    impl ::prost::Name for Secp256k1Uncompressed {
91        const NAME: &'static str = "Secp256k1Uncompressed";
92        const PACKAGE: &'static str = "xmtp.message_contents";
93        fn full_name() -> ::prost::alloc::string::String {
94            "xmtp.message_contents.UnsignedPublicKey.Secp256k1Uncompressed".into()
95        }
96        fn type_url() -> ::prost::alloc::string::String {
97            "/xmtp.message_contents.UnsignedPublicKey.Secp256k1Uncompressed".into()
98        }
99    }
100    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
101    pub enum Union {
102        #[prost(message, tag = "3")]
103        Secp256k1Uncompressed(Secp256k1Uncompressed),
104    }
105}
106impl ::prost::Name for UnsignedPublicKey {
107    const NAME: &'static str = "UnsignedPublicKey";
108    const PACKAGE: &'static str = "xmtp.message_contents";
109    fn full_name() -> ::prost::alloc::string::String {
110        "xmtp.message_contents.UnsignedPublicKey".into()
111    }
112    fn type_url() -> ::prost::alloc::string::String {
113        "/xmtp.message_contents.UnsignedPublicKey".into()
114    }
115}
116/// SignedPublicKey
117#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
118pub struct SignedPublicKey {
119    /// embeds an UnsignedPublicKey
120    #[prost(bytes = "vec", tag = "1")]
121    pub key_bytes: ::prost::alloc::vec::Vec<u8>,
122    /// signs key_bytes
123    #[prost(message, optional, tag = "2")]
124    pub signature: ::core::option::Option<Signature>,
125}
126impl ::prost::Name for SignedPublicKey {
127    const NAME: &'static str = "SignedPublicKey";
128    const PACKAGE: &'static str = "xmtp.message_contents";
129    fn full_name() -> ::prost::alloc::string::String {
130        "xmtp.message_contents.SignedPublicKey".into()
131    }
132    fn type_url() -> ::prost::alloc::string::String {
133        "/xmtp.message_contents.SignedPublicKey".into()
134    }
135}
136/// PublicKeyBundle packages the cryptographic keys associated with a wallet.
137#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
138pub struct SignedPublicKeyBundle {
139    /// Identity key MUST be signed by the wallet.
140    #[prost(message, optional, tag = "1")]
141    pub identity_key: ::core::option::Option<SignedPublicKey>,
142    /// Pre-key MUST be signed by the identity key.
143    #[prost(message, optional, tag = "2")]
144    pub pre_key: ::core::option::Option<SignedPublicKey>,
145}
146impl ::prost::Name for SignedPublicKeyBundle {
147    const NAME: &'static str = "SignedPublicKeyBundle";
148    const PACKAGE: &'static str = "xmtp.message_contents";
149    fn full_name() -> ::prost::alloc::string::String {
150        "xmtp.message_contents.SignedPublicKeyBundle".into()
151    }
152    fn type_url() -> ::prost::alloc::string::String {
153        "/xmtp.message_contents.SignedPublicKeyBundle".into()
154    }
155}
156/// PublicKey represents a generalized public key,
157/// defined as a union to support cryptographic algorithm agility.
158#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
159pub struct PublicKey {
160    #[prost(uint64, tag = "1")]
161    pub timestamp: u64,
162    #[prost(message, optional, tag = "2")]
163    pub signature: ::core::option::Option<Signature>,
164    #[prost(oneof = "public_key::Union", tags = "3")]
165    pub union: ::core::option::Option<public_key::Union>,
166}
167/// Nested message and enum types in `PublicKey`.
168pub mod public_key {
169    /// The key bytes
170    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
171    pub struct Secp256k1Uncompressed {
172        /// uncompressed point with prefix (0x04) \[ P || X || Y \], 65 bytes
173        #[prost(bytes = "vec", tag = "1")]
174        pub bytes: ::prost::alloc::vec::Vec<u8>,
175    }
176    impl ::prost::Name for Secp256k1Uncompressed {
177        const NAME: &'static str = "Secp256k1Uncompressed";
178        const PACKAGE: &'static str = "xmtp.message_contents";
179        fn full_name() -> ::prost::alloc::string::String {
180            "xmtp.message_contents.PublicKey.Secp256k1Uncompressed".into()
181        }
182        fn type_url() -> ::prost::alloc::string::String {
183            "/xmtp.message_contents.PublicKey.Secp256k1Uncompressed".into()
184        }
185    }
186    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
187    pub enum Union {
188        #[prost(message, tag = "3")]
189        Secp256k1Uncompressed(Secp256k1Uncompressed),
190    }
191}
192impl ::prost::Name for PublicKey {
193    const NAME: &'static str = "PublicKey";
194    const PACKAGE: &'static str = "xmtp.message_contents";
195    fn full_name() -> ::prost::alloc::string::String {
196        "xmtp.message_contents.PublicKey".into()
197    }
198    fn type_url() -> ::prost::alloc::string::String {
199        "/xmtp.message_contents.PublicKey".into()
200    }
201}
202/// PublicKeyBundle packages the cryptographic keys associated with a wallet,
203/// both senders and recipients are identified by their key bundles.
204#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
205pub struct PublicKeyBundle {
206    /// Identity key MUST be signed by the wallet.
207    #[prost(message, optional, tag = "1")]
208    pub identity_key: ::core::option::Option<PublicKey>,
209    /// Pre-key MUST be signed by the identity key.
210    #[prost(message, optional, tag = "2")]
211    pub pre_key: ::core::option::Option<PublicKey>,
212}
213impl ::prost::Name for PublicKeyBundle {
214    const NAME: &'static str = "PublicKeyBundle";
215    const PACKAGE: &'static str = "xmtp.message_contents";
216    fn full_name() -> ::prost::alloc::string::String {
217        "xmtp.message_contents.PublicKeyBundle".into()
218    }
219    fn type_url() -> ::prost::alloc::string::String {
220        "/xmtp.message_contents.PublicKeyBundle".into()
221    }
222}
223/// Ciphertext represents encrypted payload.
224/// It is definited as a union to support cryptographic algorithm agility.
225/// The payload is accompanied by the cryptographic parameters
226/// required by the chosen encryption scheme.
227#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
228pub struct Ciphertext {
229    #[prost(oneof = "ciphertext::Union", tags = "1")]
230    pub union: ::core::option::Option<ciphertext::Union>,
231}
232/// Nested message and enum types in `Ciphertext`.
233pub mod ciphertext {
234    /// Encryption: AES256-GCM
235    /// Key derivation function: HKDF-SHA256
236    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
237    pub struct Aes256gcmHkdfsha256 {
238        /// 32 bytes
239        #[prost(bytes = "vec", tag = "1")]
240        pub hkdf_salt: ::prost::alloc::vec::Vec<u8>,
241        /// 12 bytes
242        #[prost(bytes = "vec", tag = "2")]
243        pub gcm_nonce: ::prost::alloc::vec::Vec<u8>,
244        /// encrypted payload
245        #[prost(bytes = "vec", tag = "3")]
246        pub payload: ::prost::alloc::vec::Vec<u8>,
247    }
248    impl ::prost::Name for Aes256gcmHkdfsha256 {
249        const NAME: &'static str = "Aes256gcmHkdfsha256";
250        const PACKAGE: &'static str = "xmtp.message_contents";
251        fn full_name() -> ::prost::alloc::string::String {
252            "xmtp.message_contents.Ciphertext.Aes256gcmHkdfsha256".into()
253        }
254        fn type_url() -> ::prost::alloc::string::String {
255            "/xmtp.message_contents.Ciphertext.Aes256gcmHkdfsha256".into()
256        }
257    }
258    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
259    pub enum Union {
260        #[prost(message, tag = "1")]
261        Aes256GcmHkdfSha256(Aes256gcmHkdfsha256),
262    }
263}
264impl ::prost::Name for Ciphertext {
265    const NAME: &'static str = "Ciphertext";
266    const PACKAGE: &'static str = "xmtp.message_contents";
267    fn full_name() -> ::prost::alloc::string::String {
268        "xmtp.message_contents.Ciphertext".into()
269    }
270    fn type_url() -> ::prost::alloc::string::String {
271        "/xmtp.message_contents.Ciphertext".into()
272    }
273}
274/// SignedEciesCiphertext represents an ECIES encrypted payload and a signature
275#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
276pub struct SignedEciesCiphertext {
277    /// serialized Ecies message
278    #[prost(bytes = "vec", tag = "1")]
279    pub ecies_bytes: ::prost::alloc::vec::Vec<u8>,
280    /// signature of sha256(ecies_bytes) signed with the IdentityKey
281    #[prost(message, optional, tag = "2")]
282    pub signature: ::core::option::Option<Signature>,
283}
284/// Nested message and enum types in `SignedEciesCiphertext`.
285pub mod signed_ecies_ciphertext {
286    /// Ecies is ciphertext encrypted using ECIES with a MAC
287    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
288    pub struct Ecies {
289        /// 65 bytes
290        #[prost(bytes = "vec", tag = "1")]
291        pub ephemeral_public_key: ::prost::alloc::vec::Vec<u8>,
292        /// 16 bytes
293        #[prost(bytes = "vec", tag = "2")]
294        pub iv: ::prost::alloc::vec::Vec<u8>,
295        /// 32 bytes
296        #[prost(bytes = "vec", tag = "3")]
297        pub mac: ::prost::alloc::vec::Vec<u8>,
298        /// encrypted payload with block size of 16
299        #[prost(bytes = "vec", tag = "4")]
300        pub ciphertext: ::prost::alloc::vec::Vec<u8>,
301    }
302    impl ::prost::Name for Ecies {
303        const NAME: &'static str = "Ecies";
304        const PACKAGE: &'static str = "xmtp.message_contents";
305        fn full_name() -> ::prost::alloc::string::String {
306            "xmtp.message_contents.SignedEciesCiphertext.Ecies".into()
307        }
308        fn type_url() -> ::prost::alloc::string::String {
309            "/xmtp.message_contents.SignedEciesCiphertext.Ecies".into()
310        }
311    }
312}
313impl ::prost::Name for SignedEciesCiphertext {
314    const NAME: &'static str = "SignedEciesCiphertext";
315    const PACKAGE: &'static str = "xmtp.message_contents";
316    fn full_name() -> ::prost::alloc::string::String {
317        "xmtp.message_contents.SignedEciesCiphertext".into()
318    }
319    fn type_url() -> ::prost::alloc::string::String {
320        "/xmtp.message_contents.SignedEciesCiphertext".into()
321    }
322}
323/// Unsealed invitation V1
324#[derive(Clone, PartialEq, ::prost::Message)]
325pub struct InvitationV1 {
326    /// topic name chosen for this conversation.
327    /// It MUST be randomly generated bytes (length >= 32),
328    /// then base64 encoded without padding
329    #[prost(string, tag = "1")]
330    pub topic: ::prost::alloc::string::String,
331    /// A context object defining metadata
332    #[prost(message, optional, tag = "2")]
333    pub context: ::core::option::Option<invitation_v1::Context>,
334    /// The user's consent proof
335    #[prost(message, optional, tag = "4")]
336    pub consent_proof: ::core::option::Option<ConsentProofPayload>,
337    /// message encryption scheme and keys for this conversation.
338    #[prost(oneof = "invitation_v1::Encryption", tags = "3")]
339    pub encryption: ::core::option::Option<invitation_v1::Encryption>,
340}
341/// Nested message and enum types in `InvitationV1`.
342pub mod invitation_v1 {
343    /// Supported encryption schemes
344    /// AES256-GCM-HKDF-SHA256
345    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
346    pub struct Aes256gcmHkdfsha256 {
347        /// randomly generated key material (32 bytes)
348        #[prost(bytes = "vec", tag = "1")]
349        pub key_material: ::prost::alloc::vec::Vec<u8>,
350    }
351    impl ::prost::Name for Aes256gcmHkdfsha256 {
352        const NAME: &'static str = "Aes256gcmHkdfsha256";
353        const PACKAGE: &'static str = "xmtp.message_contents";
354        fn full_name() -> ::prost::alloc::string::String {
355            "xmtp.message_contents.InvitationV1.Aes256gcmHkdfsha256".into()
356        }
357        fn type_url() -> ::prost::alloc::string::String {
358            "/xmtp.message_contents.InvitationV1.Aes256gcmHkdfsha256".into()
359        }
360    }
361    /// The context type
362    #[derive(Clone, PartialEq, ::prost::Message)]
363    pub struct Context {
364        /// Expected to be a URI (ie xmtp.org/convo1)
365        #[prost(string, tag = "1")]
366        pub conversation_id: ::prost::alloc::string::String,
367        /// Key value map of additional metadata that would be exposed to
368        /// application developers and could be used for filtering
369        #[prost(map = "string, string", tag = "2")]
370        pub metadata: ::std::collections::HashMap<
371            ::prost::alloc::string::String,
372            ::prost::alloc::string::String,
373        >,
374    }
375    impl ::prost::Name for Context {
376        const NAME: &'static str = "Context";
377        const PACKAGE: &'static str = "xmtp.message_contents";
378        fn full_name() -> ::prost::alloc::string::String {
379            "xmtp.message_contents.InvitationV1.Context".into()
380        }
381        fn type_url() -> ::prost::alloc::string::String {
382            "/xmtp.message_contents.InvitationV1.Context".into()
383        }
384    }
385    /// message encryption scheme and keys for this conversation.
386    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
387    pub enum Encryption {
388        /// Specify the encryption method to process the key material properly.
389        #[prost(message, tag = "3")]
390        Aes256GcmHkdfSha256(Aes256gcmHkdfsha256),
391    }
392}
393impl ::prost::Name for InvitationV1 {
394    const NAME: &'static str = "InvitationV1";
395    const PACKAGE: &'static str = "xmtp.message_contents";
396    fn full_name() -> ::prost::alloc::string::String {
397        "xmtp.message_contents.InvitationV1".into()
398    }
399    fn type_url() -> ::prost::alloc::string::String {
400        "/xmtp.message_contents.InvitationV1".into()
401    }
402}
403/// Sealed Invitation V1 Header
404/// Header carries information that is unencrypted, thus readable by the network
405/// it is however authenticated as associated data with the AEAD scheme used
406/// to encrypt the invitation body, thus providing tamper evidence.
407#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
408pub struct SealedInvitationHeaderV1 {
409    #[prost(message, optional, tag = "1")]
410    pub sender: ::core::option::Option<SignedPublicKeyBundle>,
411    #[prost(message, optional, tag = "2")]
412    pub recipient: ::core::option::Option<SignedPublicKeyBundle>,
413    #[prost(uint64, tag = "3")]
414    pub created_ns: u64,
415}
416impl ::prost::Name for SealedInvitationHeaderV1 {
417    const NAME: &'static str = "SealedInvitationHeaderV1";
418    const PACKAGE: &'static str = "xmtp.message_contents";
419    fn full_name() -> ::prost::alloc::string::String {
420        "xmtp.message_contents.SealedInvitationHeaderV1".into()
421    }
422    fn type_url() -> ::prost::alloc::string::String {
423        "/xmtp.message_contents.SealedInvitationHeaderV1".into()
424    }
425}
426/// Sealed Invitation V1
427/// Invitation encrypted with key material derived from the sender's and
428/// recipient's public key bundles using simplified X3DH where
429/// the sender's ephemeral key is replaced with sender's pre-key.
430#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
431pub struct SealedInvitationV1 {
432    /// encoded SealedInvitationHeaderV1 used as associated data for Ciphertext
433    #[prost(bytes = "vec", tag = "1")]
434    pub header_bytes: ::prost::alloc::vec::Vec<u8>,
435    /// Ciphertext.payload MUST contain encrypted InvitationV1.
436    #[prost(message, optional, tag = "2")]
437    pub ciphertext: ::core::option::Option<Ciphertext>,
438}
439impl ::prost::Name for SealedInvitationV1 {
440    const NAME: &'static str = "SealedInvitationV1";
441    const PACKAGE: &'static str = "xmtp.message_contents";
442    fn full_name() -> ::prost::alloc::string::String {
443        "xmtp.message_contents.SealedInvitationV1".into()
444    }
445    fn type_url() -> ::prost::alloc::string::String {
446        "/xmtp.message_contents.SealedInvitationV1".into()
447    }
448}
449/// Versioned Sealed Invitation
450#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
451pub struct SealedInvitation {
452    #[prost(oneof = "sealed_invitation::Version", tags = "1")]
453    pub version: ::core::option::Option<sealed_invitation::Version>,
454}
455/// Nested message and enum types in `SealedInvitation`.
456pub mod sealed_invitation {
457    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
458    pub enum Version {
459        #[prost(message, tag = "1")]
460        V1(super::SealedInvitationV1),
461    }
462}
463impl ::prost::Name for SealedInvitation {
464    const NAME: &'static str = "SealedInvitation";
465    const PACKAGE: &'static str = "xmtp.message_contents";
466    fn full_name() -> ::prost::alloc::string::String {
467        "xmtp.message_contents.SealedInvitation".into()
468    }
469    fn type_url() -> ::prost::alloc::string::String {
470        "/xmtp.message_contents.SealedInvitation".into()
471    }
472}
473/// Payload for user's consent proof to be set in the invitation
474/// Signifying the conversation should be preapproved for the user on receipt
475#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
476pub struct ConsentProofPayload {
477    /// the user's signature in hex format
478    #[prost(string, tag = "1")]
479    pub signature: ::prost::alloc::string::String,
480    /// approximate time when the user signed
481    #[prost(uint64, tag = "2")]
482    pub timestamp: u64,
483    /// version of the payload
484    #[prost(enumeration = "ConsentProofPayloadVersion", tag = "3")]
485    pub payload_version: i32,
486}
487impl ::prost::Name for ConsentProofPayload {
488    const NAME: &'static str = "ConsentProofPayload";
489    const PACKAGE: &'static str = "xmtp.message_contents";
490    fn full_name() -> ::prost::alloc::string::String {
491        "xmtp.message_contents.ConsentProofPayload".into()
492    }
493    fn type_url() -> ::prost::alloc::string::String {
494        "/xmtp.message_contents.ConsentProofPayload".into()
495    }
496}
497/// Version of consent proof payload
498#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
499#[repr(i32)]
500pub enum ConsentProofPayloadVersion {
501    Unspecified = 0,
502    ConsentProofPayloadVersion1 = 1,
503}
504impl ConsentProofPayloadVersion {
505    /// String value of the enum field names used in the ProtoBuf definition.
506    ///
507    /// The values are not transformed in any way and thus are considered stable
508    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
509    pub fn as_str_name(&self) -> &'static str {
510        match self {
511            Self::Unspecified => "CONSENT_PROOF_PAYLOAD_VERSION_UNSPECIFIED",
512            Self::ConsentProofPayloadVersion1 => "CONSENT_PROOF_PAYLOAD_VERSION_1",
513        }
514    }
515    /// Creates an enum from field names used in the ProtoBuf definition.
516    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
517        match value {
518            "CONSENT_PROOF_PAYLOAD_VERSION_UNSPECIFIED" => Some(Self::Unspecified),
519            "CONSENT_PROOF_PAYLOAD_VERSION_1" => Some(Self::ConsentProofPayloadVersion1),
520            _ => None,
521        }
522    }
523}
524/// A light pointer for a conversation that contains no decryption keys
525#[derive(Clone, PartialEq, ::prost::Message)]
526pub struct ConversationReference {
527    #[prost(string, tag = "1")]
528    pub topic: ::prost::alloc::string::String,
529    #[prost(string, tag = "2")]
530    pub peer_address: ::prost::alloc::string::String,
531    #[prost(uint64, tag = "3")]
532    pub created_ns: u64,
533    #[prost(message, optional, tag = "4")]
534    pub context: ::core::option::Option<invitation_v1::Context>,
535    #[prost(message, optional, tag = "5")]
536    pub consent_proof_payload: ::core::option::Option<ConsentProofPayload>,
537}
538impl ::prost::Name for ConversationReference {
539    const NAME: &'static str = "ConversationReference";
540    const PACKAGE: &'static str = "xmtp.message_contents";
541    fn full_name() -> ::prost::alloc::string::String {
542        "xmtp.message_contents.ConversationReference".into()
543    }
544    fn type_url() -> ::prost::alloc::string::String {
545        "/xmtp.message_contents.ConversationReference".into()
546    }
547}
548/// PrivateKey generalized to support different key types
549#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
550pub struct SignedPrivateKey {
551    /// time the key was created
552    #[prost(uint64, tag = "1")]
553    pub created_ns: u64,
554    /// public key for this private key
555    #[prost(message, optional, tag = "3")]
556    pub public_key: ::core::option::Option<SignedPublicKey>,
557    /// private key
558    #[prost(oneof = "signed_private_key::Union", tags = "2")]
559    pub union: ::core::option::Option<signed_private_key::Union>,
560}
561/// Nested message and enum types in `SignedPrivateKey`.
562pub mod signed_private_key {
563    /// EC: SECP256k1
564    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
565    pub struct Secp256k1 {
566        /// D big-endian, 32 bytes
567        #[prost(bytes = "vec", tag = "1")]
568        pub bytes: ::prost::alloc::vec::Vec<u8>,
569    }
570    impl ::prost::Name for Secp256k1 {
571        const NAME: &'static str = "Secp256k1";
572        const PACKAGE: &'static str = "xmtp.message_contents";
573        fn full_name() -> ::prost::alloc::string::String {
574            "xmtp.message_contents.SignedPrivateKey.Secp256k1".into()
575        }
576        fn type_url() -> ::prost::alloc::string::String {
577            "/xmtp.message_contents.SignedPrivateKey.Secp256k1".into()
578        }
579    }
580    /// private key
581    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
582    pub enum Union {
583        #[prost(message, tag = "2")]
584        Secp256k1(Secp256k1),
585    }
586}
587impl ::prost::Name for SignedPrivateKey {
588    const NAME: &'static str = "SignedPrivateKey";
589    const PACKAGE: &'static str = "xmtp.message_contents";
590    fn full_name() -> ::prost::alloc::string::String {
591        "xmtp.message_contents.SignedPrivateKey".into()
592    }
593    fn type_url() -> ::prost::alloc::string::String {
594        "/xmtp.message_contents.SignedPrivateKey".into()
595    }
596}
597/// PrivateKeyBundle wraps the identityKey and the preKeys,
598/// enforces usage of signed keys.
599#[derive(Clone, PartialEq, ::prost::Message)]
600pub struct PrivateKeyBundleV2 {
601    #[prost(message, optional, tag = "1")]
602    pub identity_key: ::core::option::Option<SignedPrivateKey>,
603    /// all the known pre-keys, newer keys first,
604    #[prost(message, repeated, tag = "2")]
605    pub pre_keys: ::prost::alloc::vec::Vec<SignedPrivateKey>,
606}
607impl ::prost::Name for PrivateKeyBundleV2 {
608    const NAME: &'static str = "PrivateKeyBundleV2";
609    const PACKAGE: &'static str = "xmtp.message_contents";
610    fn full_name() -> ::prost::alloc::string::String {
611        "xmtp.message_contents.PrivateKeyBundleV2".into()
612    }
613    fn type_url() -> ::prost::alloc::string::String {
614        "/xmtp.message_contents.PrivateKeyBundleV2".into()
615    }
616}
617/// LEGACY: PrivateKey generalized to support different key types
618#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
619pub struct PrivateKey {
620    /// time the key was created
621    #[prost(uint64, tag = "1")]
622    pub timestamp: u64,
623    /// public key for this private key
624    #[prost(message, optional, tag = "3")]
625    pub public_key: ::core::option::Option<PublicKey>,
626    /// private key
627    #[prost(oneof = "private_key::Union", tags = "2")]
628    pub union: ::core::option::Option<private_key::Union>,
629}
630/// Nested message and enum types in `PrivateKey`.
631pub mod private_key {
632    /// EC: SECP256k1
633    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
634    pub struct Secp256k1 {
635        /// D big-endian, 32 bytes
636        #[prost(bytes = "vec", tag = "1")]
637        pub bytes: ::prost::alloc::vec::Vec<u8>,
638    }
639    impl ::prost::Name for Secp256k1 {
640        const NAME: &'static str = "Secp256k1";
641        const PACKAGE: &'static str = "xmtp.message_contents";
642        fn full_name() -> ::prost::alloc::string::String {
643            "xmtp.message_contents.PrivateKey.Secp256k1".into()
644        }
645        fn type_url() -> ::prost::alloc::string::String {
646            "/xmtp.message_contents.PrivateKey.Secp256k1".into()
647        }
648    }
649    /// private key
650    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
651    pub enum Union {
652        #[prost(message, tag = "2")]
653        Secp256k1(Secp256k1),
654    }
655}
656impl ::prost::Name for PrivateKey {
657    const NAME: &'static str = "PrivateKey";
658    const PACKAGE: &'static str = "xmtp.message_contents";
659    fn full_name() -> ::prost::alloc::string::String {
660        "xmtp.message_contents.PrivateKey".into()
661    }
662    fn type_url() -> ::prost::alloc::string::String {
663        "/xmtp.message_contents.PrivateKey".into()
664    }
665}
666/// LEGACY: PrivateKeyBundleV1 wraps the identityKey and the preKeys
667#[derive(Clone, PartialEq, ::prost::Message)]
668pub struct PrivateKeyBundleV1 {
669    #[prost(message, optional, tag = "1")]
670    pub identity_key: ::core::option::Option<PrivateKey>,
671    /// all the known pre-keys, newer keys first,
672    #[prost(message, repeated, tag = "2")]
673    pub pre_keys: ::prost::alloc::vec::Vec<PrivateKey>,
674}
675impl ::prost::Name for PrivateKeyBundleV1 {
676    const NAME: &'static str = "PrivateKeyBundleV1";
677    const PACKAGE: &'static str = "xmtp.message_contents";
678    fn full_name() -> ::prost::alloc::string::String {
679        "xmtp.message_contents.PrivateKeyBundleV1".into()
680    }
681    fn type_url() -> ::prost::alloc::string::String {
682        "/xmtp.message_contents.PrivateKeyBundleV1".into()
683    }
684}
685/// Versioned PrivateKeyBundle
686#[derive(Clone, PartialEq, ::prost::Message)]
687pub struct PrivateKeyBundle {
688    #[prost(oneof = "private_key_bundle::Version", tags = "1, 2")]
689    pub version: ::core::option::Option<private_key_bundle::Version>,
690}
691/// Nested message and enum types in `PrivateKeyBundle`.
692pub mod private_key_bundle {
693    #[derive(Clone, PartialEq, ::prost::Oneof)]
694    pub enum Version {
695        #[prost(message, tag = "1")]
696        V1(super::PrivateKeyBundleV1),
697        #[prost(message, tag = "2")]
698        V2(super::PrivateKeyBundleV2),
699    }
700}
701impl ::prost::Name for PrivateKeyBundle {
702    const NAME: &'static str = "PrivateKeyBundle";
703    const PACKAGE: &'static str = "xmtp.message_contents";
704    fn full_name() -> ::prost::alloc::string::String {
705        "xmtp.message_contents.PrivateKeyBundle".into()
706    }
707    fn type_url() -> ::prost::alloc::string::String {
708        "/xmtp.message_contents.PrivateKeyBundle".into()
709    }
710}
711/// PrivateKeyBundle encrypted with key material generated by
712/// signing a randomly generated "pre-key" with the user's wallet,
713/// i.e. EIP-191 signature of a "storage signature" message with
714/// the pre-key embedded in it.
715/// (see xmtp-js::PrivateKeyBundle.toEncryptedBytes for details)
716#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
717pub struct EncryptedPrivateKeyBundleV1 {
718    /// randomly generated pre-key
719    ///
720    /// 32 bytes
721    #[prost(bytes = "vec", tag = "1")]
722    pub wallet_pre_key: ::prost::alloc::vec::Vec<u8>,
723    /// MUST contain encrypted PrivateKeyBundle
724    #[prost(message, optional, tag = "2")]
725    pub ciphertext: ::core::option::Option<Ciphertext>,
726}
727impl ::prost::Name for EncryptedPrivateKeyBundleV1 {
728    const NAME: &'static str = "EncryptedPrivateKeyBundleV1";
729    const PACKAGE: &'static str = "xmtp.message_contents";
730    fn full_name() -> ::prost::alloc::string::String {
731        "xmtp.message_contents.EncryptedPrivateKeyBundleV1".into()
732    }
733    fn type_url() -> ::prost::alloc::string::String {
734        "/xmtp.message_contents.EncryptedPrivateKeyBundleV1".into()
735    }
736}
737/// Versioned encrypted PrivateKeyBundle
738#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
739pub struct EncryptedPrivateKeyBundle {
740    #[prost(oneof = "encrypted_private_key_bundle::Version", tags = "1")]
741    pub version: ::core::option::Option<encrypted_private_key_bundle::Version>,
742}
743/// Nested message and enum types in `EncryptedPrivateKeyBundle`.
744pub mod encrypted_private_key_bundle {
745    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
746    pub enum Version {
747        #[prost(message, tag = "1")]
748        V1(super::EncryptedPrivateKeyBundleV1),
749    }
750}
751impl ::prost::Name for EncryptedPrivateKeyBundle {
752    const NAME: &'static str = "EncryptedPrivateKeyBundle";
753    const PACKAGE: &'static str = "xmtp.message_contents";
754    fn full_name() -> ::prost::alloc::string::String {
755        "xmtp.message_contents.EncryptedPrivateKeyBundle".into()
756    }
757    fn type_url() -> ::prost::alloc::string::String {
758        "/xmtp.message_contents.EncryptedPrivateKeyBundle".into()
759    }
760}
761/// PrivatePreferencesAction is a message used to update the client's preference
762/// store.
763#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
764pub struct PrivatePreferencesAction {
765    #[prost(
766        oneof = "private_preferences_action::MessageType",
767        tags = "1, 2, 3, 4, 5, 6"
768    )]
769    pub message_type: ::core::option::Option<private_preferences_action::MessageType>,
770}
771/// Nested message and enum types in `PrivatePreferencesAction`.
772pub mod private_preferences_action {
773    /// Allow 1:1 direct message (DM) access
774    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
775    pub struct AllowAddress {
776        /// Add the given wallet addresses to the allow list
777        #[prost(string, repeated, tag = "1")]
778        pub wallet_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
779    }
780    impl ::prost::Name for AllowAddress {
781        const NAME: &'static str = "AllowAddress";
782        const PACKAGE: &'static str = "xmtp.message_contents";
783        fn full_name() -> ::prost::alloc::string::String {
784            "xmtp.message_contents.PrivatePreferencesAction.AllowAddress".into()
785        }
786        fn type_url() -> ::prost::alloc::string::String {
787            "/xmtp.message_contents.PrivatePreferencesAction.AllowAddress".into()
788        }
789    }
790    /// Deny (block) 1:1 direct message (DM) access
791    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
792    pub struct DenyAddress {
793        /// Add the given wallet addresses to the deny list
794        #[prost(string, repeated, tag = "1")]
795        pub wallet_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
796    }
797    impl ::prost::Name for DenyAddress {
798        const NAME: &'static str = "DenyAddress";
799        const PACKAGE: &'static str = "xmtp.message_contents";
800        fn full_name() -> ::prost::alloc::string::String {
801            "xmtp.message_contents.PrivatePreferencesAction.DenyAddress".into()
802        }
803        fn type_url() -> ::prost::alloc::string::String {
804            "/xmtp.message_contents.PrivatePreferencesAction.DenyAddress".into()
805        }
806    }
807    /// Allow V3 1:1 direct message (DM) access
808    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
809    pub struct AllowInboxId {
810        /// Add the given inbox id to the allow list
811        #[prost(string, repeated, tag = "1")]
812        pub inbox_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
813    }
814    impl ::prost::Name for AllowInboxId {
815        const NAME: &'static str = "AllowInboxId";
816        const PACKAGE: &'static str = "xmtp.message_contents";
817        fn full_name() -> ::prost::alloc::string::String {
818            "xmtp.message_contents.PrivatePreferencesAction.AllowInboxId".into()
819        }
820        fn type_url() -> ::prost::alloc::string::String {
821            "/xmtp.message_contents.PrivatePreferencesAction.AllowInboxId".into()
822        }
823    }
824    /// Deny (block) V3 1:1 direct message (DM) access
825    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
826    pub struct DenyInboxId {
827        /// Add the given inbox id to the deny list
828        #[prost(string, repeated, tag = "1")]
829        pub inbox_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
830    }
831    impl ::prost::Name for DenyInboxId {
832        const NAME: &'static str = "DenyInboxId";
833        const PACKAGE: &'static str = "xmtp.message_contents";
834        fn full_name() -> ::prost::alloc::string::String {
835            "xmtp.message_contents.PrivatePreferencesAction.DenyInboxId".into()
836        }
837        fn type_url() -> ::prost::alloc::string::String {
838            "/xmtp.message_contents.PrivatePreferencesAction.DenyInboxId".into()
839        }
840    }
841    /// Allow Group access
842    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
843    pub struct AllowGroup {
844        /// Add the given group_ids to the allow list
845        #[prost(string, repeated, tag = "1")]
846        pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
847    }
848    impl ::prost::Name for AllowGroup {
849        const NAME: &'static str = "AllowGroup";
850        const PACKAGE: &'static str = "xmtp.message_contents";
851        fn full_name() -> ::prost::alloc::string::String {
852            "xmtp.message_contents.PrivatePreferencesAction.AllowGroup".into()
853        }
854        fn type_url() -> ::prost::alloc::string::String {
855            "/xmtp.message_contents.PrivatePreferencesAction.AllowGroup".into()
856        }
857    }
858    /// Deny (deny) Group access
859    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
860    pub struct DenyGroup {
861        /// Add the given group_ids to the deny list
862        #[prost(string, repeated, tag = "1")]
863        pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
864    }
865    impl ::prost::Name for DenyGroup {
866        const NAME: &'static str = "DenyGroup";
867        const PACKAGE: &'static str = "xmtp.message_contents";
868        fn full_name() -> ::prost::alloc::string::String {
869            "xmtp.message_contents.PrivatePreferencesAction.DenyGroup".into()
870        }
871        fn type_url() -> ::prost::alloc::string::String {
872            "/xmtp.message_contents.PrivatePreferencesAction.DenyGroup".into()
873        }
874    }
875    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
876    pub enum MessageType {
877        #[prost(message, tag = "1")]
878        AllowAddress(AllowAddress),
879        #[prost(message, tag = "2")]
880        DenyAddress(DenyAddress),
881        #[prost(message, tag = "3")]
882        AllowGroup(AllowGroup),
883        #[prost(message, tag = "4")]
884        DenyGroup(DenyGroup),
885        #[prost(message, tag = "5")]
886        AllowInboxId(AllowInboxId),
887        #[prost(message, tag = "6")]
888        DenyInboxId(DenyInboxId),
889    }
890}
891impl ::prost::Name for PrivatePreferencesAction {
892    const NAME: &'static str = "PrivatePreferencesAction";
893    const PACKAGE: &'static str = "xmtp.message_contents";
894    fn full_name() -> ::prost::alloc::string::String {
895        "xmtp.message_contents.PrivatePreferencesAction".into()
896    }
897    fn type_url() -> ::prost::alloc::string::String {
898        "/xmtp.message_contents.PrivatePreferencesAction".into()
899    }
900}
901/// The payload that goes over the wire
902#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
903pub struct PrivatePreferencesPayload {
904    #[prost(oneof = "private_preferences_payload::Version", tags = "1")]
905    pub version: ::core::option::Option<private_preferences_payload::Version>,
906}
907/// Nested message and enum types in `PrivatePreferencesPayload`.
908pub mod private_preferences_payload {
909    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
910    pub enum Version {
911        #[prost(message, tag = "1")]
912        V1(super::Ciphertext),
913    }
914}
915impl ::prost::Name for PrivatePreferencesPayload {
916    const NAME: &'static str = "PrivatePreferencesPayload";
917    const PACKAGE: &'static str = "xmtp.message_contents";
918    fn full_name() -> ::prost::alloc::string::String {
919        "xmtp.message_contents.PrivatePreferencesPayload".into()
920    }
921    fn type_url() -> ::prost::alloc::string::String {
922        "/xmtp.message_contents.PrivatePreferencesPayload".into()
923    }
924}
925/// ContentTypeId is used to identify the type of content stored in a Message.
926#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
927pub struct ContentTypeId {
928    /// authority governing this content type
929    #[prost(string, tag = "1")]
930    pub authority_id: ::prost::alloc::string::String,
931    /// type identifier
932    #[prost(string, tag = "2")]
933    pub type_id: ::prost::alloc::string::String,
934    /// major version of the type
935    #[prost(uint32, tag = "3")]
936    pub version_major: u32,
937    /// minor version of the type
938    #[prost(uint32, tag = "4")]
939    pub version_minor: u32,
940}
941impl ::prost::Name for ContentTypeId {
942    const NAME: &'static str = "ContentTypeId";
943    const PACKAGE: &'static str = "xmtp.message_contents";
944    fn full_name() -> ::prost::alloc::string::String {
945        "xmtp.message_contents.ContentTypeId".into()
946    }
947    fn type_url() -> ::prost::alloc::string::String {
948        "/xmtp.message_contents.ContentTypeId".into()
949    }
950}
951/// EncodedContent bundles the content with metadata identifying its type
952/// and parameters required for correct decoding and presentation of the content.
953#[derive(Clone, PartialEq, ::prost::Message)]
954pub struct EncodedContent {
955    /// content type identifier used to match the payload with
956    /// the correct decoding machinery
957    #[prost(message, optional, tag = "1")]
958    pub r#type: ::core::option::Option<ContentTypeId>,
959    /// optional encoding parameters required to correctly decode the content
960    #[prost(map = "string, string", tag = "2")]
961    pub parameters: ::std::collections::HashMap<
962        ::prost::alloc::string::String,
963        ::prost::alloc::string::String,
964    >,
965    /// optional fallback description of the content that can be used in case
966    /// the client cannot decode or render the content
967    #[prost(string, optional, tag = "3")]
968    pub fallback: ::core::option::Option<::prost::alloc::string::String>,
969    /// optional compression; the value indicates algorithm used to
970    /// compress the encoded content bytes
971    #[prost(enumeration = "Compression", optional, tag = "5")]
972    pub compression: ::core::option::Option<i32>,
973    /// encoded content itself
974    #[prost(bytes = "vec", tag = "4")]
975    pub content: ::prost::alloc::vec::Vec<u8>,
976}
977impl ::prost::Name for EncodedContent {
978    const NAME: &'static str = "EncodedContent";
979    const PACKAGE: &'static str = "xmtp.message_contents";
980    fn full_name() -> ::prost::alloc::string::String {
981        "xmtp.message_contents.EncodedContent".into()
982    }
983    fn type_url() -> ::prost::alloc::string::String {
984        "/xmtp.message_contents.EncodedContent".into()
985    }
986}
987/// SignedContent attaches a signature to EncodedContent.
988#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
989pub struct SignedContent {
990    /// MUST contain EncodedContent
991    #[prost(bytes = "vec", tag = "1")]
992    pub payload: ::prost::alloc::vec::Vec<u8>,
993    #[prost(message, optional, tag = "2")]
994    pub sender: ::core::option::Option<SignedPublicKeyBundle>,
995    /// MUST be a signature of a concatenation of
996    /// the message header bytes and the payload bytes,
997    /// signed by the sender's pre-key.
998    #[prost(message, optional, tag = "3")]
999    pub signature: ::core::option::Option<Signature>,
1000}
1001impl ::prost::Name for SignedContent {
1002    const NAME: &'static str = "SignedContent";
1003    const PACKAGE: &'static str = "xmtp.message_contents";
1004    fn full_name() -> ::prost::alloc::string::String {
1005        "xmtp.message_contents.SignedContent".into()
1006    }
1007    fn type_url() -> ::prost::alloc::string::String {
1008        "/xmtp.message_contents.SignedContent".into()
1009    }
1010}
1011/// Recognized compression algorithms
1012/// protolint:disable ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH
1013#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1014#[repr(i32)]
1015pub enum Compression {
1016    Deflate = 0,
1017    Gzip = 1,
1018}
1019impl Compression {
1020    /// String value of the enum field names used in the ProtoBuf definition.
1021    ///
1022    /// The values are not transformed in any way and thus are considered stable
1023    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1024    pub fn as_str_name(&self) -> &'static str {
1025        match self {
1026            Self::Deflate => "COMPRESSION_DEFLATE",
1027            Self::Gzip => "COMPRESSION_GZIP",
1028        }
1029    }
1030    /// Creates an enum from field names used in the ProtoBuf definition.
1031    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1032        match value {
1033            "COMPRESSION_DEFLATE" => Some(Self::Deflate),
1034            "COMPRESSION_GZIP" => Some(Self::Gzip),
1035            _ => None,
1036        }
1037    }
1038}
1039/// Composite is used to implement xmtp.org/composite content type
1040#[derive(Clone, PartialEq, ::prost::Message)]
1041pub struct Composite {
1042    #[prost(message, repeated, tag = "1")]
1043    pub parts: ::prost::alloc::vec::Vec<composite::Part>,
1044}
1045/// Nested message and enum types in `Composite`.
1046pub mod composite {
1047    /// Part represents one section of a composite message
1048    #[derive(Clone, PartialEq, ::prost::Message)]
1049    pub struct Part {
1050        #[prost(oneof = "part::Element", tags = "1, 2")]
1051        pub element: ::core::option::Option<part::Element>,
1052    }
1053    /// Nested message and enum types in `Part`.
1054    pub mod part {
1055        #[derive(Clone, PartialEq, ::prost::Oneof)]
1056        pub enum Element {
1057            #[prost(message, tag = "1")]
1058            Part(super::super::EncodedContent),
1059            #[prost(message, tag = "2")]
1060            Composite(super::super::Composite),
1061        }
1062    }
1063    impl ::prost::Name for Part {
1064        const NAME: &'static str = "Part";
1065        const PACKAGE: &'static str = "xmtp.message_contents";
1066        fn full_name() -> ::prost::alloc::string::String {
1067            "xmtp.message_contents.Composite.Part".into()
1068        }
1069        fn type_url() -> ::prost::alloc::string::String {
1070            "/xmtp.message_contents.Composite.Part".into()
1071        }
1072    }
1073}
1074impl ::prost::Name for Composite {
1075    const NAME: &'static str = "Composite";
1076    const PACKAGE: &'static str = "xmtp.message_contents";
1077    fn full_name() -> ::prost::alloc::string::String {
1078        "xmtp.message_contents.Composite".into()
1079    }
1080    fn type_url() -> ::prost::alloc::string::String {
1081        "/xmtp.message_contents.Composite".into()
1082    }
1083}
1084/// LEGACY: User key bundle V1 using PublicKeys.
1085/// The PublicKeys MUST be signed.
1086#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1087pub struct ContactBundleV1 {
1088    #[prost(message, optional, tag = "1")]
1089    pub key_bundle: ::core::option::Option<PublicKeyBundle>,
1090}
1091impl ::prost::Name for ContactBundleV1 {
1092    const NAME: &'static str = "ContactBundleV1";
1093    const PACKAGE: &'static str = "xmtp.message_contents";
1094    fn full_name() -> ::prost::alloc::string::String {
1095        "xmtp.message_contents.ContactBundleV1".into()
1096    }
1097    fn type_url() -> ::prost::alloc::string::String {
1098        "/xmtp.message_contents.ContactBundleV1".into()
1099    }
1100}
1101/// User key bundle V2 using SignedPublicKeys.
1102#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1103pub struct ContactBundleV2 {
1104    #[prost(message, optional, tag = "1")]
1105    pub key_bundle: ::core::option::Option<SignedPublicKeyBundle>,
1106}
1107impl ::prost::Name for ContactBundleV2 {
1108    const NAME: &'static str = "ContactBundleV2";
1109    const PACKAGE: &'static str = "xmtp.message_contents";
1110    fn full_name() -> ::prost::alloc::string::String {
1111        "xmtp.message_contents.ContactBundleV2".into()
1112    }
1113    fn type_url() -> ::prost::alloc::string::String {
1114        "/xmtp.message_contents.ContactBundleV2".into()
1115    }
1116}
1117/// Versioned ContactBundle
1118#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1119pub struct ContactBundle {
1120    #[prost(oneof = "contact_bundle::Version", tags = "1, 2")]
1121    pub version: ::core::option::Option<contact_bundle::Version>,
1122}
1123/// Nested message and enum types in `ContactBundle`.
1124pub mod contact_bundle {
1125    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1126    pub enum Version {
1127        #[prost(message, tag = "1")]
1128        V1(super::ContactBundleV1),
1129        #[prost(message, tag = "2")]
1130        V2(super::ContactBundleV2),
1131    }
1132}
1133impl ::prost::Name for ContactBundle {
1134    const NAME: &'static str = "ContactBundle";
1135    const PACKAGE: &'static str = "xmtp.message_contents";
1136    fn full_name() -> ::prost::alloc::string::String {
1137        "xmtp.message_contents.ContactBundle".into()
1138    }
1139    fn type_url() -> ::prost::alloc::string::String {
1140        "/xmtp.message_contents.ContactBundle".into()
1141    }
1142}
1143/// EciesMessage is a wrapper for ECIES encrypted payloads
1144#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1145pub struct EciesMessage {
1146    #[prost(oneof = "ecies_message::Version", tags = "1")]
1147    pub version: ::core::option::Option<ecies_message::Version>,
1148}
1149/// Nested message and enum types in `EciesMessage`.
1150pub mod ecies_message {
1151    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1152    pub enum Version {
1153        /// Expected to be an ECIES encrypted SignedPayload
1154        #[prost(bytes, tag = "1")]
1155        V1(::prost::alloc::vec::Vec<u8>),
1156    }
1157}
1158impl ::prost::Name for EciesMessage {
1159    const NAME: &'static str = "EciesMessage";
1160    const PACKAGE: &'static str = "xmtp.message_contents";
1161    fn full_name() -> ::prost::alloc::string::String {
1162        "xmtp.message_contents.EciesMessage".into()
1163    }
1164    fn type_url() -> ::prost::alloc::string::String {
1165        "/xmtp.message_contents.EciesMessage".into()
1166    }
1167}
1168/// The message that will be signed by the Client and returned inside the
1169/// `action_body` field of the FrameAction message
1170#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1171pub struct FrameActionBody {
1172    /// The URL of the frame that was clicked
1173    /// May be different from `post_url`
1174    #[prost(string, tag = "1")]
1175    pub frame_url: ::prost::alloc::string::String,
1176    /// The 1-indexed button that was clicked
1177    #[prost(int32, tag = "2")]
1178    pub button_index: i32,
1179    /// Timestamp of the click in milliseconds since the epoch
1180    #[deprecated]
1181    #[prost(uint64, tag = "3")]
1182    pub timestamp: u64,
1183    /// A unique identifier for the conversation, not tied to anything on the
1184    /// network. Will not match the topic or conversation_id
1185    #[prost(string, tag = "4")]
1186    pub opaque_conversation_identifier: ::prost::alloc::string::String,
1187    /// Unix timestamp
1188    #[prost(uint32, tag = "5")]
1189    pub unix_timestamp: u32,
1190    /// Input text from a text input field
1191    #[prost(string, tag = "6")]
1192    pub input_text: ::prost::alloc::string::String,
1193    /// A state serialized to a string (for example via JSON.stringify()). Maximum 4096 bytes.
1194    #[prost(string, tag = "7")]
1195    pub state: ::prost::alloc::string::String,
1196    /// A 0x wallet address
1197    #[prost(string, tag = "8")]
1198    pub address: ::prost::alloc::string::String,
1199    /// A hash from a transaction
1200    #[prost(string, tag = "9")]
1201    pub transaction_id: ::prost::alloc::string::String,
1202}
1203impl ::prost::Name for FrameActionBody {
1204    const NAME: &'static str = "FrameActionBody";
1205    const PACKAGE: &'static str = "xmtp.message_contents";
1206    fn full_name() -> ::prost::alloc::string::String {
1207        "xmtp.message_contents.FrameActionBody".into()
1208    }
1209    fn type_url() -> ::prost::alloc::string::String {
1210        "/xmtp.message_contents.FrameActionBody".into()
1211    }
1212}
1213/// The outer payload that will be sent as the `messageBytes` in the
1214/// `trusted_data` part of the Frames message
1215#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1216pub struct FrameAction {
1217    #[deprecated]
1218    #[prost(message, optional, tag = "1")]
1219    pub signature: ::core::option::Option<Signature>,
1220    /// The SignedPublicKeyBundle of the signer, used to link the XMTP signature
1221    /// with a blockchain account through a chain of signatures.
1222    #[deprecated]
1223    #[prost(message, optional, tag = "2")]
1224    pub signed_public_key_bundle: ::core::option::Option<SignedPublicKeyBundle>,
1225    /// Serialized FrameActionBody message, so that the signature verification can
1226    /// happen on a byte-perfect representation of the message
1227    #[prost(bytes = "vec", tag = "3")]
1228    pub action_body: ::prost::alloc::vec::Vec<u8>,
1229    /// The installation signature
1230    #[prost(bytes = "vec", tag = "4")]
1231    pub installation_signature: ::prost::alloc::vec::Vec<u8>,
1232    /// The public installation id used to sign.
1233    #[prost(bytes = "vec", tag = "5")]
1234    pub installation_id: ::prost::alloc::vec::Vec<u8>,
1235    /// The inbox id of the installation used to sign.
1236    #[prost(string, tag = "6")]
1237    pub inbox_id: ::prost::alloc::string::String,
1238}
1239impl ::prost::Name for FrameAction {
1240    const NAME: &'static str = "FrameAction";
1241    const PACKAGE: &'static str = "xmtp.message_contents";
1242    fn full_name() -> ::prost::alloc::string::String {
1243        "xmtp.message_contents.FrameAction".into()
1244    }
1245    fn type_url() -> ::prost::alloc::string::String {
1246        "/xmtp.message_contents.FrameAction".into()
1247    }
1248}
1249/// Message header is encoded separately as the bytes are also used
1250/// as associated data for authenticated encryption
1251#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1252pub struct MessageHeaderV1 {
1253    #[prost(message, optional, tag = "1")]
1254    pub sender: ::core::option::Option<PublicKeyBundle>,
1255    #[prost(message, optional, tag = "2")]
1256    pub recipient: ::core::option::Option<PublicKeyBundle>,
1257    #[prost(uint64, tag = "3")]
1258    pub timestamp: u64,
1259}
1260impl ::prost::Name for MessageHeaderV1 {
1261    const NAME: &'static str = "MessageHeaderV1";
1262    const PACKAGE: &'static str = "xmtp.message_contents";
1263    fn full_name() -> ::prost::alloc::string::String {
1264        "xmtp.message_contents.MessageHeaderV1".into()
1265    }
1266    fn type_url() -> ::prost::alloc::string::String {
1267        "/xmtp.message_contents.MessageHeaderV1".into()
1268    }
1269}
1270/// Message is the top level protocol element
1271#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1272pub struct MessageV1 {
1273    /// encapsulates encoded MessageHeaderV1
1274    #[prost(bytes = "vec", tag = "1")]
1275    pub header_bytes: ::prost::alloc::vec::Vec<u8>,
1276    /// Ciphertext.payload MUST contain encrypted EncodedContent
1277    #[prost(message, optional, tag = "2")]
1278    pub ciphertext: ::core::option::Option<Ciphertext>,
1279}
1280impl ::prost::Name for MessageV1 {
1281    const NAME: &'static str = "MessageV1";
1282    const PACKAGE: &'static str = "xmtp.message_contents";
1283    fn full_name() -> ::prost::alloc::string::String {
1284        "xmtp.message_contents.MessageV1".into()
1285    }
1286    fn type_url() -> ::prost::alloc::string::String {
1287        "/xmtp.message_contents.MessageV1".into()
1288    }
1289}
1290/// Message header carries information that is not encrypted, and is therefore
1291/// observable by the network. It is however authenticated as associated data
1292/// of the AEAD encryption used to protect the message,
1293/// thus providing tamper evidence.
1294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1295pub struct MessageHeaderV2 {
1296    /// sender specified message creation time
1297    #[prost(uint64, tag = "1")]
1298    pub created_ns: u64,
1299    /// the topic the message belongs to
1300    #[prost(string, tag = "2")]
1301    pub topic: ::prost::alloc::string::String,
1302}
1303impl ::prost::Name for MessageHeaderV2 {
1304    const NAME: &'static str = "MessageHeaderV2";
1305    const PACKAGE: &'static str = "xmtp.message_contents";
1306    fn full_name() -> ::prost::alloc::string::String {
1307        "xmtp.message_contents.MessageHeaderV2".into()
1308    }
1309    fn type_url() -> ::prost::alloc::string::String {
1310        "/xmtp.message_contents.MessageHeaderV2".into()
1311    }
1312}
1313/// Message combines the encoded header with the encrypted payload.
1314#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1315pub struct MessageV2 {
1316    /// encapsulates encoded MessageHeaderV2
1317    #[prost(bytes = "vec", tag = "1")]
1318    pub header_bytes: ::prost::alloc::vec::Vec<u8>,
1319    /// Ciphertext.payload MUST contain encrypted SignedContent
1320    #[prost(message, optional, tag = "2")]
1321    pub ciphertext: ::core::option::Option<Ciphertext>,
1322    /// HMAC of the message ciphertext, with the HMAC key derived from the topic
1323    /// key
1324    #[prost(bytes = "vec", optional, tag = "3")]
1325    pub sender_hmac: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1326    /// Flag indicating whether the message should be pushed from a notification
1327    /// server
1328    #[prost(bool, optional, tag = "4")]
1329    pub should_push: ::core::option::Option<bool>,
1330}
1331impl ::prost::Name for MessageV2 {
1332    const NAME: &'static str = "MessageV2";
1333    const PACKAGE: &'static str = "xmtp.message_contents";
1334    fn full_name() -> ::prost::alloc::string::String {
1335        "xmtp.message_contents.MessageV2".into()
1336    }
1337    fn type_url() -> ::prost::alloc::string::String {
1338        "/xmtp.message_contents.MessageV2".into()
1339    }
1340}
1341/// Versioned Message
1342#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1343pub struct Message {
1344    #[prost(oneof = "message::Version", tags = "1, 2")]
1345    pub version: ::core::option::Option<message::Version>,
1346}
1347/// Nested message and enum types in `Message`.
1348pub mod message {
1349    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1350    pub enum Version {
1351        #[prost(message, tag = "1")]
1352        V1(super::MessageV1),
1353        #[prost(message, tag = "2")]
1354        V2(super::MessageV2),
1355    }
1356}
1357impl ::prost::Name for Message {
1358    const NAME: &'static str = "Message";
1359    const PACKAGE: &'static str = "xmtp.message_contents";
1360    fn full_name() -> ::prost::alloc::string::String {
1361        "xmtp.message_contents.Message".into()
1362    }
1363    fn type_url() -> ::prost::alloc::string::String {
1364        "/xmtp.message_contents.Message".into()
1365    }
1366}
1367/// DecodedMessage represents the decrypted message contents.
1368/// DecodedMessage instances are not stored on the network, but
1369/// may be serialized and stored by clients
1370#[derive(Clone, PartialEq, ::prost::Message)]
1371pub struct DecodedMessage {
1372    #[prost(string, tag = "1")]
1373    pub id: ::prost::alloc::string::String,
1374    #[prost(string, tag = "2")]
1375    pub message_version: ::prost::alloc::string::String,
1376    #[prost(string, tag = "3")]
1377    pub sender_address: ::prost::alloc::string::String,
1378    #[prost(string, optional, tag = "4")]
1379    pub recipient_address: ::core::option::Option<::prost::alloc::string::String>,
1380    #[prost(uint64, tag = "5")]
1381    pub sent_ns: u64,
1382    #[prost(string, tag = "6")]
1383    pub content_topic: ::prost::alloc::string::String,
1384    #[prost(message, optional, tag = "7")]
1385    pub conversation: ::core::option::Option<ConversationReference>,
1386    /// encapsulates EncodedContent
1387    #[prost(bytes = "vec", tag = "8")]
1388    pub content_bytes: ::prost::alloc::vec::Vec<u8>,
1389}
1390impl ::prost::Name for DecodedMessage {
1391    const NAME: &'static str = "DecodedMessage";
1392    const PACKAGE: &'static str = "xmtp.message_contents";
1393    fn full_name() -> ::prost::alloc::string::String {
1394        "xmtp.message_contents.DecodedMessage".into()
1395    }
1396    fn type_url() -> ::prost::alloc::string::String {
1397        "/xmtp.message_contents.DecodedMessage".into()
1398    }
1399}
1400/// SignedPayload is a wrapper for a signature and a payload
1401#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1402pub struct SignedPayload {
1403    #[prost(bytes = "vec", tag = "1")]
1404    pub payload: ::prost::alloc::vec::Vec<u8>,
1405    #[prost(message, optional, tag = "2")]
1406    pub signature: ::core::option::Option<Signature>,
1407}
1408impl ::prost::Name for SignedPayload {
1409    const NAME: &'static str = "SignedPayload";
1410    const PACKAGE: &'static str = "xmtp.message_contents";
1411    fn full_name() -> ::prost::alloc::string::String {
1412        "xmtp.message_contents.SignedPayload".into()
1413    }
1414    fn type_url() -> ::prost::alloc::string::String {
1415        "/xmtp.message_contents.SignedPayload".into()
1416    }
1417}