Skip to main content

polyester/gen/buffa/
chain.deposit.v1.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2
3/// DepositAddress describes one assigned deposit address for one external chain.
4#[derive(Clone, PartialEq, Default)]
5#[derive(::serde::Serialize, ::serde::Deserialize)]
6#[serde(default)]
7pub struct DepositAddress {
8    /// PolyChain-registered source chain id used across deposit flows.
9    ///
10    /// Field 1: `chain_id`
11    #[serde(
12        rename = "chainId",
13        alias = "chain_id",
14        with = "::buffa::json_helpers::uint32",
15        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
16    )]
17    pub chain_id: u32,
18    /// Assigned external-chain deposit address for the selected account target.
19    ///
20    /// Field 2: `deposit_address`
21    #[serde(
22        rename = "depositAddress",
23        alias = "deposit_address",
24        with = "::buffa::json_helpers::proto_string",
25        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
26    )]
27    pub deposit_address: ::buffa::alloc::string::String,
28    #[serde(skip)]
29    #[doc(hidden)]
30    pub __buffa_unknown_fields: ::buffa::UnknownFields,
31}
32impl ::core::fmt::Debug for DepositAddress {
33    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34        f.debug_struct("DepositAddress")
35            .field("chain_id", &self.chain_id)
36            .field("deposit_address", &self.deposit_address)
37            .finish()
38    }
39}
40impl DepositAddress {
41    /// Protobuf type URL for this message, for use with `Any::pack` and
42    /// `Any::unpack_if`.
43    ///
44    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
45    pub const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.DepositAddress";
46}
47::buffa::impl_default_instance!(DepositAddress);
48impl ::buffa::MessageName for DepositAddress {
49    const PACKAGE: &'static str = "chain.deposit.v1";
50    const NAME: &'static str = "DepositAddress";
51    const FULL_NAME: &'static str = "chain.deposit.v1.DepositAddress";
52    const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.DepositAddress";
53}
54impl ::buffa::Message for DepositAddress {
55    /// Returns the total encoded size in bytes.
56    ///
57    /// The result is a `u32`; the protobuf specification requires all
58    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
59    /// compliant message will never overflow this type.
60    #[allow(clippy::let_and_return)]
61    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
62        #[allow(unused_imports)]
63        use ::buffa::Enumeration as _;
64        let mut size = 0u32;
65        if self.chain_id != 0u32 {
66            size += 1u32 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
67        }
68        if !self.deposit_address.is_empty() {
69            size
70                += 1u32
71                    + ::buffa::types::string_encoded_len(&self.deposit_address) as u32;
72        }
73        size += self.__buffa_unknown_fields.encoded_len() as u32;
74        size
75    }
76    fn write_to(
77        &self,
78        _cache: &mut ::buffa::SizeCache,
79        buf: &mut impl ::buffa::bytes::BufMut,
80    ) {
81        #[allow(unused_imports)]
82        use ::buffa::Enumeration as _;
83        if self.chain_id != 0u32 {
84            ::buffa::types::put_uint32_field(1u32, self.chain_id, buf);
85        }
86        if !self.deposit_address.is_empty() {
87            ::buffa::types::put_string_field(2u32, &self.deposit_address, buf);
88        }
89        self.__buffa_unknown_fields.write_to(buf);
90    }
91    fn merge_field(
92        &mut self,
93        tag: ::buffa::encoding::Tag,
94        buf: &mut impl ::buffa::bytes::Buf,
95        ctx: ::buffa::DecodeContext<'_>,
96    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
97        #[allow(unused_imports)]
98        use ::buffa::bytes::Buf as _;
99        #[allow(unused_imports)]
100        use ::buffa::Enumeration as _;
101        match tag.field_number() {
102            1u32 => {
103                ::buffa::encoding::check_wire_type(
104                    tag,
105                    ::buffa::encoding::WireType::Varint,
106                )?;
107                self.chain_id = ::buffa::types::decode_uint32(buf)?;
108            }
109            2u32 => {
110                ::buffa::encoding::check_wire_type(
111                    tag,
112                    ::buffa::encoding::WireType::LengthDelimited,
113                )?;
114                ::buffa::types::merge_string(&mut self.deposit_address, buf)?;
115            }
116            _ => {
117                self.__buffa_unknown_fields
118                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
119            }
120        }
121        ::core::result::Result::Ok(())
122    }
123    fn clear(&mut self) {
124        self.chain_id = 0u32;
125        self.deposit_address.clear();
126        self.__buffa_unknown_fields.clear();
127    }
128}
129impl ::buffa::ExtensionSet for DepositAddress {
130    const PROTO_FQN: &'static str = "chain.deposit.v1.DepositAddress";
131    fn unknown_fields(&self) -> &::buffa::UnknownFields {
132        &self.__buffa_unknown_fields
133    }
134    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
135        &mut self.__buffa_unknown_fields
136    }
137}
138impl ::buffa::json_helpers::ProtoElemJson for DepositAddress {
139    fn serialize_proto_json<S: ::serde::Serializer>(
140        v: &Self,
141        s: S,
142    ) -> ::core::result::Result<S::Ok, S::Error> {
143        ::serde::Serialize::serialize(v, s)
144    }
145    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
146        d: D,
147    ) -> ::core::result::Result<Self, D::Error> {
148        <Self as ::serde::Deserialize>::deserialize(d)
149    }
150}
151#[doc(hidden)]
152pub const __DEPOSIT_ADDRESS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
153    type_url: "type.googleapis.com/chain.deposit.v1.DepositAddress",
154    to_json: ::buffa::type_registry::any_to_json::<DepositAddress>,
155    from_json: ::buffa::type_registry::any_from_json::<DepositAddress>,
156    is_wkt: false,
157};
158/// CreateDepositAddressRequest creates or returns the deposit address for one
159/// selected account target and chain.
160#[derive(Clone, PartialEq, Default)]
161#[derive(::serde::Serialize, ::serde::Deserialize)]
162#[serde(default)]
163pub struct CreateDepositAddressRequest {
164    /// Optional subaccount public id. When omitted, the authenticated caller's
165    /// root account is used as the target account.
166    ///
167    /// Field 1: `subaccount_id`
168    #[serde(
169        rename = "subaccountId",
170        alias = "subaccount_id",
171        with = "::buffa::json_helpers::uint64",
172        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
173    )]
174    pub subaccount_id: u64,
175    /// PolyChain-registered source chain id to assign the deposit address for.
176    ///
177    /// Field 2: `chain_id`
178    #[serde(
179        rename = "chainId",
180        alias = "chain_id",
181        with = "::buffa::json_helpers::uint32",
182        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
183    )]
184    pub chain_id: u32,
185    #[serde(skip)]
186    #[doc(hidden)]
187    pub __buffa_unknown_fields: ::buffa::UnknownFields,
188}
189impl ::core::fmt::Debug for CreateDepositAddressRequest {
190    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
191        f.debug_struct("CreateDepositAddressRequest")
192            .field("subaccount_id", &self.subaccount_id)
193            .field("chain_id", &self.chain_id)
194            .finish()
195    }
196}
197impl CreateDepositAddressRequest {
198    /// Protobuf type URL for this message, for use with `Any::pack` and
199    /// `Any::unpack_if`.
200    ///
201    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
202    pub const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.CreateDepositAddressRequest";
203}
204::buffa::impl_default_instance!(CreateDepositAddressRequest);
205impl ::buffa::MessageName for CreateDepositAddressRequest {
206    const PACKAGE: &'static str = "chain.deposit.v1";
207    const NAME: &'static str = "CreateDepositAddressRequest";
208    const FULL_NAME: &'static str = "chain.deposit.v1.CreateDepositAddressRequest";
209    const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.CreateDepositAddressRequest";
210}
211impl ::buffa::Message for CreateDepositAddressRequest {
212    /// Returns the total encoded size in bytes.
213    ///
214    /// The result is a `u32`; the protobuf specification requires all
215    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
216    /// compliant message will never overflow this type.
217    #[allow(clippy::let_and_return)]
218    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
219        #[allow(unused_imports)]
220        use ::buffa::Enumeration as _;
221        let mut size = 0u32;
222        if self.subaccount_id != 0u64 {
223            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
224        }
225        if self.chain_id != 0u32 {
226            size += 1u32 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
227        }
228        size += self.__buffa_unknown_fields.encoded_len() as u32;
229        size
230    }
231    fn write_to(
232        &self,
233        _cache: &mut ::buffa::SizeCache,
234        buf: &mut impl ::buffa::bytes::BufMut,
235    ) {
236        #[allow(unused_imports)]
237        use ::buffa::Enumeration as _;
238        if self.subaccount_id != 0u64 {
239            ::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
240        }
241        if self.chain_id != 0u32 {
242            ::buffa::types::put_uint32_field(2u32, self.chain_id, buf);
243        }
244        self.__buffa_unknown_fields.write_to(buf);
245    }
246    fn merge_field(
247        &mut self,
248        tag: ::buffa::encoding::Tag,
249        buf: &mut impl ::buffa::bytes::Buf,
250        ctx: ::buffa::DecodeContext<'_>,
251    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
252        #[allow(unused_imports)]
253        use ::buffa::bytes::Buf as _;
254        #[allow(unused_imports)]
255        use ::buffa::Enumeration as _;
256        match tag.field_number() {
257            1u32 => {
258                ::buffa::encoding::check_wire_type(
259                    tag,
260                    ::buffa::encoding::WireType::Fixed64,
261                )?;
262                self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
263            }
264            2u32 => {
265                ::buffa::encoding::check_wire_type(
266                    tag,
267                    ::buffa::encoding::WireType::Varint,
268                )?;
269                self.chain_id = ::buffa::types::decode_uint32(buf)?;
270            }
271            _ => {
272                self.__buffa_unknown_fields
273                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
274            }
275        }
276        ::core::result::Result::Ok(())
277    }
278    fn clear(&mut self) {
279        self.subaccount_id = 0u64;
280        self.chain_id = 0u32;
281        self.__buffa_unknown_fields.clear();
282    }
283}
284impl ::buffa::ExtensionSet for CreateDepositAddressRequest {
285    const PROTO_FQN: &'static str = "chain.deposit.v1.CreateDepositAddressRequest";
286    fn unknown_fields(&self) -> &::buffa::UnknownFields {
287        &self.__buffa_unknown_fields
288    }
289    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
290        &mut self.__buffa_unknown_fields
291    }
292}
293impl ::buffa::json_helpers::ProtoElemJson for CreateDepositAddressRequest {
294    fn serialize_proto_json<S: ::serde::Serializer>(
295        v: &Self,
296        s: S,
297    ) -> ::core::result::Result<S::Ok, S::Error> {
298        ::serde::Serialize::serialize(v, s)
299    }
300    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
301        d: D,
302    ) -> ::core::result::Result<Self, D::Error> {
303        <Self as ::serde::Deserialize>::deserialize(d)
304    }
305}
306#[doc(hidden)]
307pub const __CREATE_DEPOSIT_ADDRESS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
308    type_url: "type.googleapis.com/chain.deposit.v1.CreateDepositAddressRequest",
309    to_json: ::buffa::type_registry::any_to_json::<CreateDepositAddressRequest>,
310    from_json: ::buffa::type_registry::any_from_json::<CreateDepositAddressRequest>,
311    is_wkt: false,
312};
313/// CreateDepositAddressResponse returns the assigned deposit address for the
314/// requested target and chain.
315#[derive(Clone, PartialEq, Default)]
316#[derive(::serde::Serialize, ::serde::Deserialize)]
317#[serde(default)]
318pub struct CreateDepositAddressResponse {
319    /// Assigned deposit address for the requested target and chain.
320    ///
321    /// Field 1: `deposit_address`
322    #[serde(
323        rename = "depositAddress",
324        alias = "deposit_address",
325        skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
326    )]
327    pub deposit_address: ::buffa::MessageField<DepositAddress>,
328    #[serde(skip)]
329    #[doc(hidden)]
330    pub __buffa_unknown_fields: ::buffa::UnknownFields,
331}
332impl ::core::fmt::Debug for CreateDepositAddressResponse {
333    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
334        f.debug_struct("CreateDepositAddressResponse")
335            .field("deposit_address", &self.deposit_address)
336            .finish()
337    }
338}
339impl CreateDepositAddressResponse {
340    /// Protobuf type URL for this message, for use with `Any::pack` and
341    /// `Any::unpack_if`.
342    ///
343    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
344    pub const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.CreateDepositAddressResponse";
345}
346::buffa::impl_default_instance!(CreateDepositAddressResponse);
347impl ::buffa::MessageName for CreateDepositAddressResponse {
348    const PACKAGE: &'static str = "chain.deposit.v1";
349    const NAME: &'static str = "CreateDepositAddressResponse";
350    const FULL_NAME: &'static str = "chain.deposit.v1.CreateDepositAddressResponse";
351    const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.CreateDepositAddressResponse";
352}
353impl ::buffa::Message for CreateDepositAddressResponse {
354    /// Returns the total encoded size in bytes.
355    ///
356    /// The result is a `u32`; the protobuf specification requires all
357    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
358    /// compliant message will never overflow this type.
359    #[allow(clippy::let_and_return)]
360    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
361        #[allow(unused_imports)]
362        use ::buffa::Enumeration as _;
363        let mut size = 0u32;
364        if self.deposit_address.is_set() {
365            let __slot = __cache.reserve();
366            let inner_size = self.deposit_address.compute_size(__cache);
367            __cache.set(__slot, inner_size);
368            size
369                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
370                    + inner_size;
371        }
372        size += self.__buffa_unknown_fields.encoded_len() as u32;
373        size
374    }
375    fn write_to(
376        &self,
377        __cache: &mut ::buffa::SizeCache,
378        buf: &mut impl ::buffa::bytes::BufMut,
379    ) {
380        #[allow(unused_imports)]
381        use ::buffa::Enumeration as _;
382        if self.deposit_address.is_set() {
383            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
384            self.deposit_address.write_to(__cache, buf);
385        }
386        self.__buffa_unknown_fields.write_to(buf);
387    }
388    fn merge_field(
389        &mut self,
390        tag: ::buffa::encoding::Tag,
391        buf: &mut impl ::buffa::bytes::Buf,
392        ctx: ::buffa::DecodeContext<'_>,
393    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
394        #[allow(unused_imports)]
395        use ::buffa::bytes::Buf as _;
396        #[allow(unused_imports)]
397        use ::buffa::Enumeration as _;
398        match tag.field_number() {
399            1u32 => {
400                ::buffa::encoding::check_wire_type(
401                    tag,
402                    ::buffa::encoding::WireType::LengthDelimited,
403                )?;
404                ::buffa::Message::merge_length_delimited(
405                    self.deposit_address.get_or_insert_default(),
406                    buf,
407                    ctx,
408                )?;
409            }
410            _ => {
411                self.__buffa_unknown_fields
412                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
413            }
414        }
415        ::core::result::Result::Ok(())
416    }
417    fn clear(&mut self) {
418        self.deposit_address = ::buffa::MessageField::none();
419        self.__buffa_unknown_fields.clear();
420    }
421}
422impl ::buffa::ExtensionSet for CreateDepositAddressResponse {
423    const PROTO_FQN: &'static str = "chain.deposit.v1.CreateDepositAddressResponse";
424    fn unknown_fields(&self) -> &::buffa::UnknownFields {
425        &self.__buffa_unknown_fields
426    }
427    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
428        &mut self.__buffa_unknown_fields
429    }
430}
431impl ::buffa::json_helpers::ProtoElemJson for CreateDepositAddressResponse {
432    fn serialize_proto_json<S: ::serde::Serializer>(
433        v: &Self,
434        s: S,
435    ) -> ::core::result::Result<S::Ok, S::Error> {
436        ::serde::Serialize::serialize(v, s)
437    }
438    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
439        d: D,
440    ) -> ::core::result::Result<Self, D::Error> {
441        <Self as ::serde::Deserialize>::deserialize(d)
442    }
443}
444#[doc(hidden)]
445pub const __CREATE_DEPOSIT_ADDRESS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
446    type_url: "type.googleapis.com/chain.deposit.v1.CreateDepositAddressResponse",
447    to_json: ::buffa::type_registry::any_to_json::<CreateDepositAddressResponse>,
448    from_json: ::buffa::type_registry::any_from_json::<CreateDepositAddressResponse>,
449    is_wkt: false,
450};
451/// ListDepositAddressesRequest lists known deposit addresses for one selected
452/// account target.
453#[derive(Clone, PartialEq, Default)]
454#[derive(::serde::Serialize, ::serde::Deserialize)]
455#[serde(default)]
456pub struct ListDepositAddressesRequest {
457    /// Optional subaccount public id. When omitted, the authenticated caller's
458    /// root account is used as the target account.
459    ///
460    /// Field 1: `subaccount_id`
461    #[serde(
462        rename = "subaccountId",
463        alias = "subaccount_id",
464        with = "::buffa::json_helpers::uint64",
465        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
466    )]
467    pub subaccount_id: u64,
468    /// Optional PolyChain-registered source chain id filter. When omitted, the
469    /// response returns all known deposit addresses for the selected target,
470    /// ordered by ascending chain id.
471    ///
472    /// Field 2: `chain_id`
473    #[serde(
474        rename = "chainId",
475        alias = "chain_id",
476        with = "::buffa::json_helpers::uint32",
477        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
478    )]
479    pub chain_id: u32,
480    #[serde(skip)]
481    #[doc(hidden)]
482    pub __buffa_unknown_fields: ::buffa::UnknownFields,
483}
484impl ::core::fmt::Debug for ListDepositAddressesRequest {
485    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
486        f.debug_struct("ListDepositAddressesRequest")
487            .field("subaccount_id", &self.subaccount_id)
488            .field("chain_id", &self.chain_id)
489            .finish()
490    }
491}
492impl ListDepositAddressesRequest {
493    /// Protobuf type URL for this message, for use with `Any::pack` and
494    /// `Any::unpack_if`.
495    ///
496    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
497    pub const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.ListDepositAddressesRequest";
498}
499::buffa::impl_default_instance!(ListDepositAddressesRequest);
500impl ::buffa::MessageName for ListDepositAddressesRequest {
501    const PACKAGE: &'static str = "chain.deposit.v1";
502    const NAME: &'static str = "ListDepositAddressesRequest";
503    const FULL_NAME: &'static str = "chain.deposit.v1.ListDepositAddressesRequest";
504    const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.ListDepositAddressesRequest";
505}
506impl ::buffa::Message for ListDepositAddressesRequest {
507    /// Returns the total encoded size in bytes.
508    ///
509    /// The result is a `u32`; the protobuf specification requires all
510    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
511    /// compliant message will never overflow this type.
512    #[allow(clippy::let_and_return)]
513    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
514        #[allow(unused_imports)]
515        use ::buffa::Enumeration as _;
516        let mut size = 0u32;
517        if self.subaccount_id != 0u64 {
518            size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
519        }
520        if self.chain_id != 0u32 {
521            size += 1u32 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
522        }
523        size += self.__buffa_unknown_fields.encoded_len() as u32;
524        size
525    }
526    fn write_to(
527        &self,
528        _cache: &mut ::buffa::SizeCache,
529        buf: &mut impl ::buffa::bytes::BufMut,
530    ) {
531        #[allow(unused_imports)]
532        use ::buffa::Enumeration as _;
533        if self.subaccount_id != 0u64 {
534            ::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
535        }
536        if self.chain_id != 0u32 {
537            ::buffa::types::put_uint32_field(2u32, self.chain_id, buf);
538        }
539        self.__buffa_unknown_fields.write_to(buf);
540    }
541    fn merge_field(
542        &mut self,
543        tag: ::buffa::encoding::Tag,
544        buf: &mut impl ::buffa::bytes::Buf,
545        ctx: ::buffa::DecodeContext<'_>,
546    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
547        #[allow(unused_imports)]
548        use ::buffa::bytes::Buf as _;
549        #[allow(unused_imports)]
550        use ::buffa::Enumeration as _;
551        match tag.field_number() {
552            1u32 => {
553                ::buffa::encoding::check_wire_type(
554                    tag,
555                    ::buffa::encoding::WireType::Fixed64,
556                )?;
557                self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
558            }
559            2u32 => {
560                ::buffa::encoding::check_wire_type(
561                    tag,
562                    ::buffa::encoding::WireType::Varint,
563                )?;
564                self.chain_id = ::buffa::types::decode_uint32(buf)?;
565            }
566            _ => {
567                self.__buffa_unknown_fields
568                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
569            }
570        }
571        ::core::result::Result::Ok(())
572    }
573    fn clear(&mut self) {
574        self.subaccount_id = 0u64;
575        self.chain_id = 0u32;
576        self.__buffa_unknown_fields.clear();
577    }
578}
579impl ::buffa::ExtensionSet for ListDepositAddressesRequest {
580    const PROTO_FQN: &'static str = "chain.deposit.v1.ListDepositAddressesRequest";
581    fn unknown_fields(&self) -> &::buffa::UnknownFields {
582        &self.__buffa_unknown_fields
583    }
584    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
585        &mut self.__buffa_unknown_fields
586    }
587}
588impl ::buffa::json_helpers::ProtoElemJson for ListDepositAddressesRequest {
589    fn serialize_proto_json<S: ::serde::Serializer>(
590        v: &Self,
591        s: S,
592    ) -> ::core::result::Result<S::Ok, S::Error> {
593        ::serde::Serialize::serialize(v, s)
594    }
595    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
596        d: D,
597    ) -> ::core::result::Result<Self, D::Error> {
598        <Self as ::serde::Deserialize>::deserialize(d)
599    }
600}
601#[doc(hidden)]
602pub const __LIST_DEPOSIT_ADDRESSES_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
603    type_url: "type.googleapis.com/chain.deposit.v1.ListDepositAddressesRequest",
604    to_json: ::buffa::type_registry::any_to_json::<ListDepositAddressesRequest>,
605    from_json: ::buffa::type_registry::any_from_json::<ListDepositAddressesRequest>,
606    is_wkt: false,
607};
608/// ListDepositAddressesResponse returns the known deposit addresses for the
609/// selected target, ordered by ascending chain id.
610#[derive(Clone, PartialEq, Default)]
611#[derive(::serde::Serialize, ::serde::Deserialize)]
612#[serde(default)]
613pub struct ListDepositAddressesResponse {
614    /// Known deposit addresses for the selected target.
615    ///
616    /// Field 1: `deposit_addresses`
617    #[serde(
618        rename = "depositAddresses",
619        alias = "deposit_addresses",
620        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
621        deserialize_with = "::buffa::json_helpers::null_as_default"
622    )]
623    pub deposit_addresses: ::buffa::alloc::vec::Vec<DepositAddress>,
624    #[serde(skip)]
625    #[doc(hidden)]
626    pub __buffa_unknown_fields: ::buffa::UnknownFields,
627}
628impl ::core::fmt::Debug for ListDepositAddressesResponse {
629    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
630        f.debug_struct("ListDepositAddressesResponse")
631            .field("deposit_addresses", &self.deposit_addresses)
632            .finish()
633    }
634}
635impl ListDepositAddressesResponse {
636    /// Protobuf type URL for this message, for use with `Any::pack` and
637    /// `Any::unpack_if`.
638    ///
639    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
640    pub const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.ListDepositAddressesResponse";
641}
642::buffa::impl_default_instance!(ListDepositAddressesResponse);
643impl ::buffa::MessageName for ListDepositAddressesResponse {
644    const PACKAGE: &'static str = "chain.deposit.v1";
645    const NAME: &'static str = "ListDepositAddressesResponse";
646    const FULL_NAME: &'static str = "chain.deposit.v1.ListDepositAddressesResponse";
647    const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.ListDepositAddressesResponse";
648}
649impl ::buffa::Message for ListDepositAddressesResponse {
650    /// Returns the total encoded size in bytes.
651    ///
652    /// The result is a `u32`; the protobuf specification requires all
653    /// messages to fit within 2 GiB (2,147,483,647 bytes), so a
654    /// compliant message will never overflow this type.
655    #[allow(clippy::let_and_return)]
656    fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
657        #[allow(unused_imports)]
658        use ::buffa::Enumeration as _;
659        let mut size = 0u32;
660        for v in &self.deposit_addresses {
661            let __slot = __cache.reserve();
662            let inner_size = v.compute_size(__cache);
663            __cache.set(__slot, inner_size);
664            size
665                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
666                    + inner_size;
667        }
668        size += self.__buffa_unknown_fields.encoded_len() as u32;
669        size
670    }
671    fn write_to(
672        &self,
673        __cache: &mut ::buffa::SizeCache,
674        buf: &mut impl ::buffa::bytes::BufMut,
675    ) {
676        #[allow(unused_imports)]
677        use ::buffa::Enumeration as _;
678        for v in &self.deposit_addresses {
679            ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
680            v.write_to(__cache, buf);
681        }
682        self.__buffa_unknown_fields.write_to(buf);
683    }
684    fn merge_field(
685        &mut self,
686        tag: ::buffa::encoding::Tag,
687        buf: &mut impl ::buffa::bytes::Buf,
688        ctx: ::buffa::DecodeContext<'_>,
689    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
690        #[allow(unused_imports)]
691        use ::buffa::bytes::Buf as _;
692        #[allow(unused_imports)]
693        use ::buffa::Enumeration as _;
694        match tag.field_number() {
695            1u32 => {
696                ::buffa::encoding::check_wire_type(
697                    tag,
698                    ::buffa::encoding::WireType::LengthDelimited,
699                )?;
700                let mut elem = ::core::default::Default::default();
701                ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
702                self.deposit_addresses.push(elem);
703            }
704            _ => {
705                self.__buffa_unknown_fields
706                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
707            }
708        }
709        ::core::result::Result::Ok(())
710    }
711    fn clear(&mut self) {
712        self.deposit_addresses.clear();
713        self.__buffa_unknown_fields.clear();
714    }
715}
716impl ::buffa::ExtensionSet for ListDepositAddressesResponse {
717    const PROTO_FQN: &'static str = "chain.deposit.v1.ListDepositAddressesResponse";
718    fn unknown_fields(&self) -> &::buffa::UnknownFields {
719        &self.__buffa_unknown_fields
720    }
721    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
722        &mut self.__buffa_unknown_fields
723    }
724}
725impl ::buffa::json_helpers::ProtoElemJson for ListDepositAddressesResponse {
726    fn serialize_proto_json<S: ::serde::Serializer>(
727        v: &Self,
728        s: S,
729    ) -> ::core::result::Result<S::Ok, S::Error> {
730        ::serde::Serialize::serialize(v, s)
731    }
732    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
733        d: D,
734    ) -> ::core::result::Result<Self, D::Error> {
735        <Self as ::serde::Deserialize>::deserialize(d)
736    }
737}
738#[doc(hidden)]
739pub const __LIST_DEPOSIT_ADDRESSES_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
740    type_url: "type.googleapis.com/chain.deposit.v1.ListDepositAddressesResponse",
741    to_json: ::buffa::type_registry::any_to_json::<ListDepositAddressesResponse>,
742    from_json: ::buffa::type_registry::any_from_json::<ListDepositAddressesResponse>,
743    is_wkt: false,
744};
745#[allow(
746    non_camel_case_types,
747    dead_code,
748    unused_imports,
749    unused_qualifications,
750    clippy::derivable_impls,
751    clippy::match_single_binding,
752    clippy::uninlined_format_args,
753    clippy::doc_lazy_continuation,
754    clippy::module_inception
755)]
756pub mod __buffa {
757    #[allow(unused_imports)]
758    use super::*;
759    pub mod view {
760        #[allow(unused_imports)]
761        use super::*;
762        /// DepositAddress describes one assigned deposit address for one external chain.
763        #[derive(Clone, Debug, Default)]
764        pub struct DepositAddressView<'a> {
765            /// PolyChain-registered source chain id used across deposit flows.
766            ///
767            /// Field 1: `chain_id`
768            pub chain_id: u32,
769            /// Assigned external-chain deposit address for the selected account target.
770            ///
771            /// Field 2: `deposit_address`
772            pub deposit_address: &'a str,
773            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
774        }
775        impl<'a> ::buffa::MessageView<'a> for DepositAddressView<'a> {
776            type Owned = super::super::DepositAddress;
777            fn decode_view(
778                buf: &'a [u8],
779            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
780                let __limit = ::core::cell::Cell::new(
781                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
782                );
783                <Self as ::buffa::MessageView>::decode_view_ctx(
784                    buf,
785                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
786                )
787            }
788            fn decode_view_with_ctx(
789                buf: &'a [u8],
790                ctx: ::buffa::DecodeContext<'_>,
791            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
792                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
793            }
794            fn merge_view_field(
795                &mut self,
796                tag: ::buffa::encoding::Tag,
797                cur: &'a [u8],
798                before_tag: &'a [u8],
799                ctx: ::buffa::DecodeContext<'_>,
800            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
801                let _ = ctx;
802                #[allow(unused_variables)]
803                let view = self;
804                let mut cur = cur;
805                match tag.field_number() {
806                    1u32 => {
807                        ::buffa::encoding::check_wire_type(
808                            tag,
809                            ::buffa::encoding::WireType::Varint,
810                        )?;
811                        view.chain_id = ::buffa::types::decode_uint32(&mut cur)?;
812                    }
813                    2u32 => {
814                        ::buffa::encoding::check_wire_type(
815                            tag,
816                            ::buffa::encoding::WireType::LengthDelimited,
817                        )?;
818                        view.deposit_address = ::buffa::types::borrow_str(&mut cur)?;
819                    }
820                    _ => {
821                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
822                        let span_len = before_tag.len() - cur.len();
823                        view.__buffa_unknown_fields
824                            .push_record(before_tag, span_len, ctx)?;
825                    }
826                }
827                ::core::result::Result::Ok(cur)
828            }
829            fn to_owned_message(
830                &self,
831            ) -> ::core::result::Result<
832                super::super::DepositAddress,
833                ::buffa::DecodeError,
834            > {
835                self.to_owned_from_source(None)
836            }
837            #[allow(clippy::useless_conversion, clippy::needless_update)]
838            fn to_owned_from_source(
839                &self,
840                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
841            ) -> ::core::result::Result<
842                super::super::DepositAddress,
843                ::buffa::DecodeError,
844            > {
845                #[allow(unused_imports)]
846                use ::buffa::alloc::string::ToString as _;
847                let _ = __buffa_src;
848                ::core::result::Result::Ok(super::super::DepositAddress {
849                    chain_id: self.chain_id,
850                    deposit_address: self.deposit_address.to_string(),
851                    __buffa_unknown_fields: self
852                        .__buffa_unknown_fields
853                        .to_owned()?
854                        .into(),
855                    ..::core::default::Default::default()
856                })
857            }
858        }
859        impl<'a> ::buffa::ViewEncode<'a> for DepositAddressView<'a> {
860            #[allow(clippy::needless_borrow, clippy::let_and_return)]
861            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
862                #[allow(unused_imports)]
863                use ::buffa::Enumeration as _;
864                let mut size = 0u32;
865                if self.chain_id != 0u32 {
866                    size
867                        += 1u32
868                            + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
869                }
870                if !self.deposit_address.is_empty() {
871                    size
872                        += 1u32
873                            + ::buffa::types::string_encoded_len(&self.deposit_address)
874                                as u32;
875                }
876                size += self.__buffa_unknown_fields.encoded_len() as u32;
877                size
878            }
879            #[allow(clippy::needless_borrow)]
880            fn write_to(
881                &self,
882                _cache: &mut ::buffa::SizeCache,
883                buf: &mut impl ::buffa::bytes::BufMut,
884            ) {
885                #[allow(unused_imports)]
886                use ::buffa::Enumeration as _;
887                if self.chain_id != 0u32 {
888                    ::buffa::types::put_uint32_field(1u32, self.chain_id, buf);
889                }
890                if !self.deposit_address.is_empty() {
891                    ::buffa::types::put_string_field(2u32, &self.deposit_address, buf);
892                }
893                self.__buffa_unknown_fields.write_to(buf);
894            }
895        }
896        /// Serializes this view as protobuf JSON.
897        ///
898        /// Implicit-presence fields with default values are omitted, `required`
899        /// fields are always emitted, explicit-presence (`optional`) fields are
900        /// emitted only when set, bytes fields are base64-encoded, and enum
901        /// values are their proto name strings.
902        ///
903        /// This impl uses `serialize_map(None)` because the number of emitted
904        /// fields depends on default-omission rules; serializers that require
905        /// known map lengths (e.g. `bincode`) will return a runtime error.
906        /// Use the owned message type for those formats.
907        impl<'__a> ::serde::Serialize for DepositAddressView<'__a> {
908            fn serialize<__S: ::serde::Serializer>(
909                &self,
910                __s: __S,
911            ) -> ::core::result::Result<__S::Ok, __S::Error> {
912                use ::serde::ser::SerializeMap as _;
913                let mut __map = __s.serialize_map(::core::option::Option::None)?;
914                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.chain_id) {
915                    __map
916                        .serialize_entry(
917                            "chainId",
918                            &::buffa::json_helpers::ProtoJson(&self.chain_id),
919                        )?;
920                }
921                if !::buffa::json_helpers::skip_if::is_empty_str(self.deposit_address) {
922                    __map.serialize_entry("depositAddress", self.deposit_address)?;
923                }
924                __map.end()
925            }
926        }
927        impl<'a> ::buffa::MessageName for DepositAddressView<'a> {
928            const PACKAGE: &'static str = "chain.deposit.v1";
929            const NAME: &'static str = "DepositAddress";
930            const FULL_NAME: &'static str = "chain.deposit.v1.DepositAddress";
931            const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.DepositAddress";
932        }
933        ::buffa::impl_default_view_instance!(DepositAddressView);
934        ::buffa::impl_view_reborrow!(DepositAddressView);
935        /** Self-contained, `'static` owned view of a `DepositAddress` message.
936
937 Wraps [`::buffa::OwnedView`]`<`[`DepositAddressView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
938
939 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`DepositAddressView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
940        #[derive(Clone, Debug)]
941        pub struct DepositAddressOwnedView(
942            ::buffa::OwnedView<DepositAddressView<'static>>,
943        );
944        impl DepositAddressOwnedView {
945            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
946            ///
947            /// The view borrows directly from the buffer's data; the buffer is
948            /// retained inside the returned handle.
949            ///
950            /// # Errors
951            ///
952            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
953            /// protobuf data.
954            pub fn decode(
955                bytes: ::buffa::bytes::Bytes,
956            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
957                ::core::result::Result::Ok(
958                    DepositAddressOwnedView(::buffa::OwnedView::decode(bytes)?),
959                )
960            }
961            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
962            /// max message size).
963            ///
964            /// # Errors
965            ///
966            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
967            /// exceeds the configured limits.
968            pub fn decode_with_options(
969                bytes: ::buffa::bytes::Bytes,
970                opts: &::buffa::DecodeOptions,
971            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
972                ::core::result::Result::Ok(
973                    DepositAddressOwnedView(
974                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
975                    ),
976                )
977            }
978            /// Build from an owned message via an encode → decode round-trip.
979            ///
980            /// # Errors
981            ///
982            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
983            /// somehow invalid (should not happen for well-formed messages).
984            pub fn from_owned(
985                msg: &super::super::DepositAddress,
986            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
987                ::core::result::Result::Ok(
988                    DepositAddressOwnedView(::buffa::OwnedView::from_owned(msg)?),
989                )
990            }
991            /// Borrow the full [`DepositAddressView`] with its lifetime tied to `&self`.
992            #[must_use]
993            pub fn view(&self) -> &DepositAddressView<'_> {
994                self.0.reborrow()
995            }
996            /// Convert to the owned message type.
997            ///
998            /// # Errors
999            ///
1000            /// Returns an error if re-materializing preserved unknown fields
1001            /// fails (e.g. the unknown-field limit is exceeded).
1002            pub fn to_owned_message(
1003                &self,
1004            ) -> ::core::result::Result<
1005                super::super::DepositAddress,
1006                ::buffa::DecodeError,
1007            > {
1008                self.0.to_owned_message()
1009            }
1010            /// The underlying bytes buffer.
1011            #[must_use]
1012            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
1013                self.0.bytes()
1014            }
1015            /// Consume the handle, returning the underlying bytes buffer.
1016            #[must_use]
1017            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
1018                self.0.into_bytes()
1019            }
1020            /// PolyChain-registered source chain id used across deposit flows.
1021            ///
1022            /// Field 1: `chain_id`
1023            #[must_use]
1024            pub fn chain_id(&self) -> u32 {
1025                self.0.reborrow().chain_id
1026            }
1027            /// Assigned external-chain deposit address for the selected account target.
1028            ///
1029            /// Field 2: `deposit_address`
1030            #[must_use]
1031            pub fn deposit_address(&self) -> &'_ str {
1032                self.0.reborrow().deposit_address
1033            }
1034        }
1035        impl ::core::convert::From<::buffa::OwnedView<DepositAddressView<'static>>>
1036        for DepositAddressOwnedView {
1037            fn from(inner: ::buffa::OwnedView<DepositAddressView<'static>>) -> Self {
1038                DepositAddressOwnedView(inner)
1039            }
1040        }
1041        impl ::core::convert::From<DepositAddressOwnedView>
1042        for ::buffa::OwnedView<DepositAddressView<'static>> {
1043            fn from(wrapper: DepositAddressOwnedView) -> Self {
1044                wrapper.0
1045            }
1046        }
1047        impl ::core::convert::AsRef<::buffa::OwnedView<DepositAddressView<'static>>>
1048        for DepositAddressOwnedView {
1049            fn as_ref(&self) -> &::buffa::OwnedView<DepositAddressView<'static>> {
1050                &self.0
1051            }
1052        }
1053        impl ::buffa::HasMessageView for super::super::DepositAddress {
1054            type View<'a> = DepositAddressView<'a>;
1055            type ViewHandle = DepositAddressOwnedView;
1056        }
1057        impl ::serde::Serialize for DepositAddressOwnedView {
1058            fn serialize<__S: ::serde::Serializer>(
1059                &self,
1060                __s: __S,
1061            ) -> ::core::result::Result<__S::Ok, __S::Error> {
1062                ::serde::Serialize::serialize(&self.0, __s)
1063            }
1064        }
1065        /// CreateDepositAddressRequest creates or returns the deposit address for one
1066        /// selected account target and chain.
1067        #[derive(Clone, Debug, Default)]
1068        pub struct CreateDepositAddressRequestView<'a> {
1069            /// Optional subaccount public id. When omitted, the authenticated caller's
1070            /// root account is used as the target account.
1071            ///
1072            /// Field 1: `subaccount_id`
1073            pub subaccount_id: u64,
1074            /// PolyChain-registered source chain id to assign the deposit address for.
1075            ///
1076            /// Field 2: `chain_id`
1077            pub chain_id: u32,
1078            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1079        }
1080        impl<'a> ::buffa::MessageView<'a> for CreateDepositAddressRequestView<'a> {
1081            type Owned = super::super::CreateDepositAddressRequest;
1082            fn decode_view(
1083                buf: &'a [u8],
1084            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1085                let __limit = ::core::cell::Cell::new(
1086                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
1087                );
1088                <Self as ::buffa::MessageView>::decode_view_ctx(
1089                    buf,
1090                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
1091                )
1092            }
1093            fn decode_view_with_ctx(
1094                buf: &'a [u8],
1095                ctx: ::buffa::DecodeContext<'_>,
1096            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1097                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
1098            }
1099            fn merge_view_field(
1100                &mut self,
1101                tag: ::buffa::encoding::Tag,
1102                cur: &'a [u8],
1103                before_tag: &'a [u8],
1104                ctx: ::buffa::DecodeContext<'_>,
1105            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
1106                let _ = ctx;
1107                #[allow(unused_variables)]
1108                let view = self;
1109                let mut cur = cur;
1110                match tag.field_number() {
1111                    1u32 => {
1112                        ::buffa::encoding::check_wire_type(
1113                            tag,
1114                            ::buffa::encoding::WireType::Fixed64,
1115                        )?;
1116                        view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
1117                    }
1118                    2u32 => {
1119                        ::buffa::encoding::check_wire_type(
1120                            tag,
1121                            ::buffa::encoding::WireType::Varint,
1122                        )?;
1123                        view.chain_id = ::buffa::types::decode_uint32(&mut cur)?;
1124                    }
1125                    _ => {
1126                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
1127                        let span_len = before_tag.len() - cur.len();
1128                        view.__buffa_unknown_fields
1129                            .push_record(before_tag, span_len, ctx)?;
1130                    }
1131                }
1132                ::core::result::Result::Ok(cur)
1133            }
1134            fn to_owned_message(
1135                &self,
1136            ) -> ::core::result::Result<
1137                super::super::CreateDepositAddressRequest,
1138                ::buffa::DecodeError,
1139            > {
1140                self.to_owned_from_source(None)
1141            }
1142            #[allow(clippy::useless_conversion, clippy::needless_update)]
1143            fn to_owned_from_source(
1144                &self,
1145                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1146            ) -> ::core::result::Result<
1147                super::super::CreateDepositAddressRequest,
1148                ::buffa::DecodeError,
1149            > {
1150                #[allow(unused_imports)]
1151                use ::buffa::alloc::string::ToString as _;
1152                let _ = __buffa_src;
1153                ::core::result::Result::Ok(super::super::CreateDepositAddressRequest {
1154                    subaccount_id: self.subaccount_id,
1155                    chain_id: self.chain_id,
1156                    __buffa_unknown_fields: self
1157                        .__buffa_unknown_fields
1158                        .to_owned()?
1159                        .into(),
1160                    ..::core::default::Default::default()
1161                })
1162            }
1163        }
1164        impl<'a> ::buffa::ViewEncode<'a> for CreateDepositAddressRequestView<'a> {
1165            #[allow(clippy::needless_borrow, clippy::let_and_return)]
1166            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1167                #[allow(unused_imports)]
1168                use ::buffa::Enumeration as _;
1169                let mut size = 0u32;
1170                if self.subaccount_id != 0u64 {
1171                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
1172                }
1173                if self.chain_id != 0u32 {
1174                    size
1175                        += 1u32
1176                            + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
1177                }
1178                size += self.__buffa_unknown_fields.encoded_len() as u32;
1179                size
1180            }
1181            #[allow(clippy::needless_borrow)]
1182            fn write_to(
1183                &self,
1184                _cache: &mut ::buffa::SizeCache,
1185                buf: &mut impl ::buffa::bytes::BufMut,
1186            ) {
1187                #[allow(unused_imports)]
1188                use ::buffa::Enumeration as _;
1189                if self.subaccount_id != 0u64 {
1190                    ::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
1191                }
1192                if self.chain_id != 0u32 {
1193                    ::buffa::types::put_uint32_field(2u32, self.chain_id, buf);
1194                }
1195                self.__buffa_unknown_fields.write_to(buf);
1196            }
1197        }
1198        /// Serializes this view as protobuf JSON.
1199        ///
1200        /// Implicit-presence fields with default values are omitted, `required`
1201        /// fields are always emitted, explicit-presence (`optional`) fields are
1202        /// emitted only when set, bytes fields are base64-encoded, and enum
1203        /// values are their proto name strings.
1204        ///
1205        /// This impl uses `serialize_map(None)` because the number of emitted
1206        /// fields depends on default-omission rules; serializers that require
1207        /// known map lengths (e.g. `bincode`) will return a runtime error.
1208        /// Use the owned message type for those formats.
1209        impl<'__a> ::serde::Serialize for CreateDepositAddressRequestView<'__a> {
1210            fn serialize<__S: ::serde::Serializer>(
1211                &self,
1212                __s: __S,
1213            ) -> ::core::result::Result<__S::Ok, __S::Error> {
1214                use ::serde::ser::SerializeMap as _;
1215                let mut __map = __s.serialize_map(::core::option::Option::None)?;
1216                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
1217                    __map
1218                        .serialize_entry(
1219                            "subaccountId",
1220                            &::buffa::json_helpers::ProtoJson(&self.subaccount_id),
1221                        )?;
1222                }
1223                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.chain_id) {
1224                    __map
1225                        .serialize_entry(
1226                            "chainId",
1227                            &::buffa::json_helpers::ProtoJson(&self.chain_id),
1228                        )?;
1229                }
1230                __map.end()
1231            }
1232        }
1233        impl<'a> ::buffa::MessageName for CreateDepositAddressRequestView<'a> {
1234            const PACKAGE: &'static str = "chain.deposit.v1";
1235            const NAME: &'static str = "CreateDepositAddressRequest";
1236            const FULL_NAME: &'static str = "chain.deposit.v1.CreateDepositAddressRequest";
1237            const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.CreateDepositAddressRequest";
1238        }
1239        ::buffa::impl_default_view_instance!(CreateDepositAddressRequestView);
1240        ::buffa::impl_view_reborrow!(CreateDepositAddressRequestView);
1241        /** Self-contained, `'static` owned view of a `CreateDepositAddressRequest` message.
1242
1243 Wraps [`::buffa::OwnedView`]`<`[`CreateDepositAddressRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
1244
1245 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`CreateDepositAddressRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
1246        #[derive(Clone, Debug)]
1247        pub struct CreateDepositAddressRequestOwnedView(
1248            ::buffa::OwnedView<CreateDepositAddressRequestView<'static>>,
1249        );
1250        impl CreateDepositAddressRequestOwnedView {
1251            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
1252            ///
1253            /// The view borrows directly from the buffer's data; the buffer is
1254            /// retained inside the returned handle.
1255            ///
1256            /// # Errors
1257            ///
1258            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
1259            /// protobuf data.
1260            pub fn decode(
1261                bytes: ::buffa::bytes::Bytes,
1262            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1263                ::core::result::Result::Ok(
1264                    CreateDepositAddressRequestOwnedView(
1265                        ::buffa::OwnedView::decode(bytes)?,
1266                    ),
1267                )
1268            }
1269            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
1270            /// max message size).
1271            ///
1272            /// # Errors
1273            ///
1274            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
1275            /// exceeds the configured limits.
1276            pub fn decode_with_options(
1277                bytes: ::buffa::bytes::Bytes,
1278                opts: &::buffa::DecodeOptions,
1279            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1280                ::core::result::Result::Ok(
1281                    CreateDepositAddressRequestOwnedView(
1282                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
1283                    ),
1284                )
1285            }
1286            /// Build from an owned message via an encode → decode round-trip.
1287            ///
1288            /// # Errors
1289            ///
1290            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
1291            /// somehow invalid (should not happen for well-formed messages).
1292            pub fn from_owned(
1293                msg: &super::super::CreateDepositAddressRequest,
1294            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1295                ::core::result::Result::Ok(
1296                    CreateDepositAddressRequestOwnedView(
1297                        ::buffa::OwnedView::from_owned(msg)?,
1298                    ),
1299                )
1300            }
1301            /// Borrow the full [`CreateDepositAddressRequestView`] with its lifetime tied to `&self`.
1302            #[must_use]
1303            pub fn view(&self) -> &CreateDepositAddressRequestView<'_> {
1304                self.0.reborrow()
1305            }
1306            /// Convert to the owned message type.
1307            ///
1308            /// # Errors
1309            ///
1310            /// Returns an error if re-materializing preserved unknown fields
1311            /// fails (e.g. the unknown-field limit is exceeded).
1312            pub fn to_owned_message(
1313                &self,
1314            ) -> ::core::result::Result<
1315                super::super::CreateDepositAddressRequest,
1316                ::buffa::DecodeError,
1317            > {
1318                self.0.to_owned_message()
1319            }
1320            /// The underlying bytes buffer.
1321            #[must_use]
1322            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
1323                self.0.bytes()
1324            }
1325            /// Consume the handle, returning the underlying bytes buffer.
1326            #[must_use]
1327            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
1328                self.0.into_bytes()
1329            }
1330            /// Optional subaccount public id. When omitted, the authenticated caller's
1331            /// root account is used as the target account.
1332            ///
1333            /// Field 1: `subaccount_id`
1334            #[must_use]
1335            pub fn subaccount_id(&self) -> u64 {
1336                self.0.reborrow().subaccount_id
1337            }
1338            /// PolyChain-registered source chain id to assign the deposit address for.
1339            ///
1340            /// Field 2: `chain_id`
1341            #[must_use]
1342            pub fn chain_id(&self) -> u32 {
1343                self.0.reborrow().chain_id
1344            }
1345        }
1346        impl ::core::convert::From<
1347            ::buffa::OwnedView<CreateDepositAddressRequestView<'static>>,
1348        > for CreateDepositAddressRequestOwnedView {
1349            fn from(
1350                inner: ::buffa::OwnedView<CreateDepositAddressRequestView<'static>>,
1351            ) -> Self {
1352                CreateDepositAddressRequestOwnedView(inner)
1353            }
1354        }
1355        impl ::core::convert::From<CreateDepositAddressRequestOwnedView>
1356        for ::buffa::OwnedView<CreateDepositAddressRequestView<'static>> {
1357            fn from(wrapper: CreateDepositAddressRequestOwnedView) -> Self {
1358                wrapper.0
1359            }
1360        }
1361        impl ::core::convert::AsRef<
1362            ::buffa::OwnedView<CreateDepositAddressRequestView<'static>>,
1363        > for CreateDepositAddressRequestOwnedView {
1364            fn as_ref(
1365                &self,
1366            ) -> &::buffa::OwnedView<CreateDepositAddressRequestView<'static>> {
1367                &self.0
1368            }
1369        }
1370        impl ::buffa::HasMessageView for super::super::CreateDepositAddressRequest {
1371            type View<'a> = CreateDepositAddressRequestView<'a>;
1372            type ViewHandle = CreateDepositAddressRequestOwnedView;
1373        }
1374        impl ::serde::Serialize for CreateDepositAddressRequestOwnedView {
1375            fn serialize<__S: ::serde::Serializer>(
1376                &self,
1377                __s: __S,
1378            ) -> ::core::result::Result<__S::Ok, __S::Error> {
1379                ::serde::Serialize::serialize(&self.0, __s)
1380            }
1381        }
1382        /// CreateDepositAddressResponse returns the assigned deposit address for the
1383        /// requested target and chain.
1384        #[derive(Clone, Debug, Default)]
1385        pub struct CreateDepositAddressResponseView<'a> {
1386            /// Assigned deposit address for the requested target and chain.
1387            ///
1388            /// Field 1: `deposit_address`
1389            pub deposit_address: ::buffa::MessageFieldView<
1390                super::super::__buffa::view::DepositAddressView<'a>,
1391            >,
1392            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1393        }
1394        impl<'a> ::buffa::MessageView<'a> for CreateDepositAddressResponseView<'a> {
1395            type Owned = super::super::CreateDepositAddressResponse;
1396            fn decode_view(
1397                buf: &'a [u8],
1398            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1399                let __limit = ::core::cell::Cell::new(
1400                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
1401                );
1402                <Self as ::buffa::MessageView>::decode_view_ctx(
1403                    buf,
1404                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
1405                )
1406            }
1407            fn decode_view_with_ctx(
1408                buf: &'a [u8],
1409                ctx: ::buffa::DecodeContext<'_>,
1410            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1411                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
1412            }
1413            fn merge_view_field(
1414                &mut self,
1415                tag: ::buffa::encoding::Tag,
1416                cur: &'a [u8],
1417                before_tag: &'a [u8],
1418                ctx: ::buffa::DecodeContext<'_>,
1419            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
1420                let _ = ctx;
1421                #[allow(unused_variables)]
1422                let view = self;
1423                let mut cur = cur;
1424                match tag.field_number() {
1425                    1u32 => {
1426                        ::buffa::encoding::check_wire_type(
1427                            tag,
1428                            ::buffa::encoding::WireType::LengthDelimited,
1429                        )?;
1430                        let __sub_ctx = ctx.descend()?;
1431                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
1432                        match view.deposit_address.as_mut() {
1433                            Some(existing) => {
1434                                ::buffa::MessageView::merge_into_view(
1435                                    existing,
1436                                    sub,
1437                                    __sub_ctx,
1438                                )?
1439                            }
1440                            None => {
1441                                view.deposit_address = ::buffa::MessageFieldView::set(
1442                                    <super::super::__buffa::view::DepositAddressView as ::buffa::MessageView>::decode_view_ctx(
1443                                        sub,
1444                                        __sub_ctx,
1445                                    )?,
1446                                );
1447                            }
1448                        }
1449                    }
1450                    _ => {
1451                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
1452                        let span_len = before_tag.len() - cur.len();
1453                        view.__buffa_unknown_fields
1454                            .push_record(before_tag, span_len, ctx)?;
1455                    }
1456                }
1457                ::core::result::Result::Ok(cur)
1458            }
1459            fn to_owned_message(
1460                &self,
1461            ) -> ::core::result::Result<
1462                super::super::CreateDepositAddressResponse,
1463                ::buffa::DecodeError,
1464            > {
1465                self.to_owned_from_source(None)
1466            }
1467            #[allow(clippy::useless_conversion, clippy::needless_update)]
1468            fn to_owned_from_source(
1469                &self,
1470                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1471            ) -> ::core::result::Result<
1472                super::super::CreateDepositAddressResponse,
1473                ::buffa::DecodeError,
1474            > {
1475                #[allow(unused_imports)]
1476                use ::buffa::alloc::string::ToString as _;
1477                let _ = __buffa_src;
1478                ::core::result::Result::Ok(super::super::CreateDepositAddressResponse {
1479                    deposit_address: match self.deposit_address.as_option() {
1480                        Some(v) => {
1481                            ::buffa::MessageField::<
1482                                super::super::DepositAddress,
1483                            >::some(v.to_owned_from_source(__buffa_src)?)
1484                        }
1485                        None => ::buffa::MessageField::none(),
1486                    },
1487                    __buffa_unknown_fields: self
1488                        .__buffa_unknown_fields
1489                        .to_owned()?
1490                        .into(),
1491                    ..::core::default::Default::default()
1492                })
1493            }
1494        }
1495        impl<'a> ::buffa::ViewEncode<'a> for CreateDepositAddressResponseView<'a> {
1496            #[allow(clippy::needless_borrow, clippy::let_and_return)]
1497            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1498                #[allow(unused_imports)]
1499                use ::buffa::Enumeration as _;
1500                let mut size = 0u32;
1501                if self.deposit_address.is_set() {
1502                    let __slot = __cache.reserve();
1503                    let inner_size = self.deposit_address.compute_size(__cache);
1504                    __cache.set(__slot, inner_size);
1505                    size
1506                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1507                            + inner_size;
1508                }
1509                size += self.__buffa_unknown_fields.encoded_len() as u32;
1510                size
1511            }
1512            #[allow(clippy::needless_borrow)]
1513            fn write_to(
1514                &self,
1515                __cache: &mut ::buffa::SizeCache,
1516                buf: &mut impl ::buffa::bytes::BufMut,
1517            ) {
1518                #[allow(unused_imports)]
1519                use ::buffa::Enumeration as _;
1520                if self.deposit_address.is_set() {
1521                    ::buffa::types::put_len_delimited_header(
1522                        1u32,
1523                        __cache.consume_next(),
1524                        buf,
1525                    );
1526                    self.deposit_address.write_to(__cache, buf);
1527                }
1528                self.__buffa_unknown_fields.write_to(buf);
1529            }
1530        }
1531        /// Serializes this view as protobuf JSON.
1532        ///
1533        /// Implicit-presence fields with default values are omitted, `required`
1534        /// fields are always emitted, explicit-presence (`optional`) fields are
1535        /// emitted only when set, bytes fields are base64-encoded, and enum
1536        /// values are their proto name strings.
1537        ///
1538        /// This impl uses `serialize_map(None)` because the number of emitted
1539        /// fields depends on default-omission rules; serializers that require
1540        /// known map lengths (e.g. `bincode`) will return a runtime error.
1541        /// Use the owned message type for those formats.
1542        impl<'__a> ::serde::Serialize for CreateDepositAddressResponseView<'__a> {
1543            fn serialize<__S: ::serde::Serializer>(
1544                &self,
1545                __s: __S,
1546            ) -> ::core::result::Result<__S::Ok, __S::Error> {
1547                use ::serde::ser::SerializeMap as _;
1548                let mut __map = __s.serialize_map(::core::option::Option::None)?;
1549                {
1550                    if let ::core::option::Option::Some(__v) = self
1551                        .deposit_address
1552                        .as_option()
1553                    {
1554                        __map.serialize_entry("depositAddress", __v)?;
1555                    }
1556                }
1557                __map.end()
1558            }
1559        }
1560        impl<'a> ::buffa::MessageName for CreateDepositAddressResponseView<'a> {
1561            const PACKAGE: &'static str = "chain.deposit.v1";
1562            const NAME: &'static str = "CreateDepositAddressResponse";
1563            const FULL_NAME: &'static str = "chain.deposit.v1.CreateDepositAddressResponse";
1564            const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.CreateDepositAddressResponse";
1565        }
1566        ::buffa::impl_default_view_instance!(CreateDepositAddressResponseView);
1567        ::buffa::impl_view_reborrow!(CreateDepositAddressResponseView);
1568        /** Self-contained, `'static` owned view of a `CreateDepositAddressResponse` message.
1569
1570 Wraps [`::buffa::OwnedView`]`<`[`CreateDepositAddressResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
1571
1572 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`CreateDepositAddressResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
1573        #[derive(Clone, Debug)]
1574        pub struct CreateDepositAddressResponseOwnedView(
1575            ::buffa::OwnedView<CreateDepositAddressResponseView<'static>>,
1576        );
1577        impl CreateDepositAddressResponseOwnedView {
1578            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
1579            ///
1580            /// The view borrows directly from the buffer's data; the buffer is
1581            /// retained inside the returned handle.
1582            ///
1583            /// # Errors
1584            ///
1585            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
1586            /// protobuf data.
1587            pub fn decode(
1588                bytes: ::buffa::bytes::Bytes,
1589            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1590                ::core::result::Result::Ok(
1591                    CreateDepositAddressResponseOwnedView(
1592                        ::buffa::OwnedView::decode(bytes)?,
1593                    ),
1594                )
1595            }
1596            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
1597            /// max message size).
1598            ///
1599            /// # Errors
1600            ///
1601            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
1602            /// exceeds the configured limits.
1603            pub fn decode_with_options(
1604                bytes: ::buffa::bytes::Bytes,
1605                opts: &::buffa::DecodeOptions,
1606            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1607                ::core::result::Result::Ok(
1608                    CreateDepositAddressResponseOwnedView(
1609                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
1610                    ),
1611                )
1612            }
1613            /// Build from an owned message via an encode → decode round-trip.
1614            ///
1615            /// # Errors
1616            ///
1617            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
1618            /// somehow invalid (should not happen for well-formed messages).
1619            pub fn from_owned(
1620                msg: &super::super::CreateDepositAddressResponse,
1621            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1622                ::core::result::Result::Ok(
1623                    CreateDepositAddressResponseOwnedView(
1624                        ::buffa::OwnedView::from_owned(msg)?,
1625                    ),
1626                )
1627            }
1628            /// Borrow the full [`CreateDepositAddressResponseView`] with its lifetime tied to `&self`.
1629            #[must_use]
1630            pub fn view(&self) -> &CreateDepositAddressResponseView<'_> {
1631                self.0.reborrow()
1632            }
1633            /// Convert to the owned message type.
1634            ///
1635            /// # Errors
1636            ///
1637            /// Returns an error if re-materializing preserved unknown fields
1638            /// fails (e.g. the unknown-field limit is exceeded).
1639            pub fn to_owned_message(
1640                &self,
1641            ) -> ::core::result::Result<
1642                super::super::CreateDepositAddressResponse,
1643                ::buffa::DecodeError,
1644            > {
1645                self.0.to_owned_message()
1646            }
1647            /// The underlying bytes buffer.
1648            #[must_use]
1649            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
1650                self.0.bytes()
1651            }
1652            /// Consume the handle, returning the underlying bytes buffer.
1653            #[must_use]
1654            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
1655                self.0.into_bytes()
1656            }
1657            /// Assigned deposit address for the requested target and chain.
1658            ///
1659            /// Field 1: `deposit_address`
1660            #[must_use]
1661            pub fn deposit_address(
1662                &self,
1663            ) -> &::buffa::MessageFieldView<
1664                super::super::__buffa::view::DepositAddressView<'_>,
1665            > {
1666                &self.0.reborrow().deposit_address
1667            }
1668        }
1669        impl ::core::convert::From<
1670            ::buffa::OwnedView<CreateDepositAddressResponseView<'static>>,
1671        > for CreateDepositAddressResponseOwnedView {
1672            fn from(
1673                inner: ::buffa::OwnedView<CreateDepositAddressResponseView<'static>>,
1674            ) -> Self {
1675                CreateDepositAddressResponseOwnedView(inner)
1676            }
1677        }
1678        impl ::core::convert::From<CreateDepositAddressResponseOwnedView>
1679        for ::buffa::OwnedView<CreateDepositAddressResponseView<'static>> {
1680            fn from(wrapper: CreateDepositAddressResponseOwnedView) -> Self {
1681                wrapper.0
1682            }
1683        }
1684        impl ::core::convert::AsRef<
1685            ::buffa::OwnedView<CreateDepositAddressResponseView<'static>>,
1686        > for CreateDepositAddressResponseOwnedView {
1687            fn as_ref(
1688                &self,
1689            ) -> &::buffa::OwnedView<CreateDepositAddressResponseView<'static>> {
1690                &self.0
1691            }
1692        }
1693        impl ::buffa::HasMessageView for super::super::CreateDepositAddressResponse {
1694            type View<'a> = CreateDepositAddressResponseView<'a>;
1695            type ViewHandle = CreateDepositAddressResponseOwnedView;
1696        }
1697        impl ::serde::Serialize for CreateDepositAddressResponseOwnedView {
1698            fn serialize<__S: ::serde::Serializer>(
1699                &self,
1700                __s: __S,
1701            ) -> ::core::result::Result<__S::Ok, __S::Error> {
1702                ::serde::Serialize::serialize(&self.0, __s)
1703            }
1704        }
1705        /// ListDepositAddressesRequest lists known deposit addresses for one selected
1706        /// account target.
1707        #[derive(Clone, Debug, Default)]
1708        pub struct ListDepositAddressesRequestView<'a> {
1709            /// Optional subaccount public id. When omitted, the authenticated caller's
1710            /// root account is used as the target account.
1711            ///
1712            /// Field 1: `subaccount_id`
1713            pub subaccount_id: u64,
1714            /// Optional PolyChain-registered source chain id filter. When omitted, the
1715            /// response returns all known deposit addresses for the selected target,
1716            /// ordered by ascending chain id.
1717            ///
1718            /// Field 2: `chain_id`
1719            pub chain_id: u32,
1720            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
1721        }
1722        impl<'a> ::buffa::MessageView<'a> for ListDepositAddressesRequestView<'a> {
1723            type Owned = super::super::ListDepositAddressesRequest;
1724            fn decode_view(
1725                buf: &'a [u8],
1726            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1727                let __limit = ::core::cell::Cell::new(
1728                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
1729                );
1730                <Self as ::buffa::MessageView>::decode_view_ctx(
1731                    buf,
1732                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
1733                )
1734            }
1735            fn decode_view_with_ctx(
1736                buf: &'a [u8],
1737                ctx: ::buffa::DecodeContext<'_>,
1738            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1739                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
1740            }
1741            fn merge_view_field(
1742                &mut self,
1743                tag: ::buffa::encoding::Tag,
1744                cur: &'a [u8],
1745                before_tag: &'a [u8],
1746                ctx: ::buffa::DecodeContext<'_>,
1747            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
1748                let _ = ctx;
1749                #[allow(unused_variables)]
1750                let view = self;
1751                let mut cur = cur;
1752                match tag.field_number() {
1753                    1u32 => {
1754                        ::buffa::encoding::check_wire_type(
1755                            tag,
1756                            ::buffa::encoding::WireType::Fixed64,
1757                        )?;
1758                        view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
1759                    }
1760                    2u32 => {
1761                        ::buffa::encoding::check_wire_type(
1762                            tag,
1763                            ::buffa::encoding::WireType::Varint,
1764                        )?;
1765                        view.chain_id = ::buffa::types::decode_uint32(&mut cur)?;
1766                    }
1767                    _ => {
1768                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
1769                        let span_len = before_tag.len() - cur.len();
1770                        view.__buffa_unknown_fields
1771                            .push_record(before_tag, span_len, ctx)?;
1772                    }
1773                }
1774                ::core::result::Result::Ok(cur)
1775            }
1776            fn to_owned_message(
1777                &self,
1778            ) -> ::core::result::Result<
1779                super::super::ListDepositAddressesRequest,
1780                ::buffa::DecodeError,
1781            > {
1782                self.to_owned_from_source(None)
1783            }
1784            #[allow(clippy::useless_conversion, clippy::needless_update)]
1785            fn to_owned_from_source(
1786                &self,
1787                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
1788            ) -> ::core::result::Result<
1789                super::super::ListDepositAddressesRequest,
1790                ::buffa::DecodeError,
1791            > {
1792                #[allow(unused_imports)]
1793                use ::buffa::alloc::string::ToString as _;
1794                let _ = __buffa_src;
1795                ::core::result::Result::Ok(super::super::ListDepositAddressesRequest {
1796                    subaccount_id: self.subaccount_id,
1797                    chain_id: self.chain_id,
1798                    __buffa_unknown_fields: self
1799                        .__buffa_unknown_fields
1800                        .to_owned()?
1801                        .into(),
1802                    ..::core::default::Default::default()
1803                })
1804            }
1805        }
1806        impl<'a> ::buffa::ViewEncode<'a> for ListDepositAddressesRequestView<'a> {
1807            #[allow(clippy::needless_borrow, clippy::let_and_return)]
1808            fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1809                #[allow(unused_imports)]
1810                use ::buffa::Enumeration as _;
1811                let mut size = 0u32;
1812                if self.subaccount_id != 0u64 {
1813                    size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
1814                }
1815                if self.chain_id != 0u32 {
1816                    size
1817                        += 1u32
1818                            + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
1819                }
1820                size += self.__buffa_unknown_fields.encoded_len() as u32;
1821                size
1822            }
1823            #[allow(clippy::needless_borrow)]
1824            fn write_to(
1825                &self,
1826                _cache: &mut ::buffa::SizeCache,
1827                buf: &mut impl ::buffa::bytes::BufMut,
1828            ) {
1829                #[allow(unused_imports)]
1830                use ::buffa::Enumeration as _;
1831                if self.subaccount_id != 0u64 {
1832                    ::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
1833                }
1834                if self.chain_id != 0u32 {
1835                    ::buffa::types::put_uint32_field(2u32, self.chain_id, buf);
1836                }
1837                self.__buffa_unknown_fields.write_to(buf);
1838            }
1839        }
1840        /// Serializes this view as protobuf JSON.
1841        ///
1842        /// Implicit-presence fields with default values are omitted, `required`
1843        /// fields are always emitted, explicit-presence (`optional`) fields are
1844        /// emitted only when set, bytes fields are base64-encoded, and enum
1845        /// values are their proto name strings.
1846        ///
1847        /// This impl uses `serialize_map(None)` because the number of emitted
1848        /// fields depends on default-omission rules; serializers that require
1849        /// known map lengths (e.g. `bincode`) will return a runtime error.
1850        /// Use the owned message type for those formats.
1851        impl<'__a> ::serde::Serialize for ListDepositAddressesRequestView<'__a> {
1852            fn serialize<__S: ::serde::Serializer>(
1853                &self,
1854                __s: __S,
1855            ) -> ::core::result::Result<__S::Ok, __S::Error> {
1856                use ::serde::ser::SerializeMap as _;
1857                let mut __map = __s.serialize_map(::core::option::Option::None)?;
1858                if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
1859                    __map
1860                        .serialize_entry(
1861                            "subaccountId",
1862                            &::buffa::json_helpers::ProtoJson(&self.subaccount_id),
1863                        )?;
1864                }
1865                if !::buffa::json_helpers::skip_if::is_zero_u32(&self.chain_id) {
1866                    __map
1867                        .serialize_entry(
1868                            "chainId",
1869                            &::buffa::json_helpers::ProtoJson(&self.chain_id),
1870                        )?;
1871                }
1872                __map.end()
1873            }
1874        }
1875        impl<'a> ::buffa::MessageName for ListDepositAddressesRequestView<'a> {
1876            const PACKAGE: &'static str = "chain.deposit.v1";
1877            const NAME: &'static str = "ListDepositAddressesRequest";
1878            const FULL_NAME: &'static str = "chain.deposit.v1.ListDepositAddressesRequest";
1879            const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.ListDepositAddressesRequest";
1880        }
1881        ::buffa::impl_default_view_instance!(ListDepositAddressesRequestView);
1882        ::buffa::impl_view_reborrow!(ListDepositAddressesRequestView);
1883        /** Self-contained, `'static` owned view of a `ListDepositAddressesRequest` message.
1884
1885 Wraps [`::buffa::OwnedView`]`<`[`ListDepositAddressesRequestView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
1886
1887 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListDepositAddressesRequestView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
1888        #[derive(Clone, Debug)]
1889        pub struct ListDepositAddressesRequestOwnedView(
1890            ::buffa::OwnedView<ListDepositAddressesRequestView<'static>>,
1891        );
1892        impl ListDepositAddressesRequestOwnedView {
1893            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
1894            ///
1895            /// The view borrows directly from the buffer's data; the buffer is
1896            /// retained inside the returned handle.
1897            ///
1898            /// # Errors
1899            ///
1900            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
1901            /// protobuf data.
1902            pub fn decode(
1903                bytes: ::buffa::bytes::Bytes,
1904            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1905                ::core::result::Result::Ok(
1906                    ListDepositAddressesRequestOwnedView(
1907                        ::buffa::OwnedView::decode(bytes)?,
1908                    ),
1909                )
1910            }
1911            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
1912            /// max message size).
1913            ///
1914            /// # Errors
1915            ///
1916            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
1917            /// exceeds the configured limits.
1918            pub fn decode_with_options(
1919                bytes: ::buffa::bytes::Bytes,
1920                opts: &::buffa::DecodeOptions,
1921            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1922                ::core::result::Result::Ok(
1923                    ListDepositAddressesRequestOwnedView(
1924                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
1925                    ),
1926                )
1927            }
1928            /// Build from an owned message via an encode → decode round-trip.
1929            ///
1930            /// # Errors
1931            ///
1932            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
1933            /// somehow invalid (should not happen for well-formed messages).
1934            pub fn from_owned(
1935                msg: &super::super::ListDepositAddressesRequest,
1936            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
1937                ::core::result::Result::Ok(
1938                    ListDepositAddressesRequestOwnedView(
1939                        ::buffa::OwnedView::from_owned(msg)?,
1940                    ),
1941                )
1942            }
1943            /// Borrow the full [`ListDepositAddressesRequestView`] with its lifetime tied to `&self`.
1944            #[must_use]
1945            pub fn view(&self) -> &ListDepositAddressesRequestView<'_> {
1946                self.0.reborrow()
1947            }
1948            /// Convert to the owned message type.
1949            ///
1950            /// # Errors
1951            ///
1952            /// Returns an error if re-materializing preserved unknown fields
1953            /// fails (e.g. the unknown-field limit is exceeded).
1954            pub fn to_owned_message(
1955                &self,
1956            ) -> ::core::result::Result<
1957                super::super::ListDepositAddressesRequest,
1958                ::buffa::DecodeError,
1959            > {
1960                self.0.to_owned_message()
1961            }
1962            /// The underlying bytes buffer.
1963            #[must_use]
1964            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
1965                self.0.bytes()
1966            }
1967            /// Consume the handle, returning the underlying bytes buffer.
1968            #[must_use]
1969            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
1970                self.0.into_bytes()
1971            }
1972            /// Optional subaccount public id. When omitted, the authenticated caller's
1973            /// root account is used as the target account.
1974            ///
1975            /// Field 1: `subaccount_id`
1976            #[must_use]
1977            pub fn subaccount_id(&self) -> u64 {
1978                self.0.reborrow().subaccount_id
1979            }
1980            /// Optional PolyChain-registered source chain id filter. When omitted, the
1981            /// response returns all known deposit addresses for the selected target,
1982            /// ordered by ascending chain id.
1983            ///
1984            /// Field 2: `chain_id`
1985            #[must_use]
1986            pub fn chain_id(&self) -> u32 {
1987                self.0.reborrow().chain_id
1988            }
1989        }
1990        impl ::core::convert::From<
1991            ::buffa::OwnedView<ListDepositAddressesRequestView<'static>>,
1992        > for ListDepositAddressesRequestOwnedView {
1993            fn from(
1994                inner: ::buffa::OwnedView<ListDepositAddressesRequestView<'static>>,
1995            ) -> Self {
1996                ListDepositAddressesRequestOwnedView(inner)
1997            }
1998        }
1999        impl ::core::convert::From<ListDepositAddressesRequestOwnedView>
2000        for ::buffa::OwnedView<ListDepositAddressesRequestView<'static>> {
2001            fn from(wrapper: ListDepositAddressesRequestOwnedView) -> Self {
2002                wrapper.0
2003            }
2004        }
2005        impl ::core::convert::AsRef<
2006            ::buffa::OwnedView<ListDepositAddressesRequestView<'static>>,
2007        > for ListDepositAddressesRequestOwnedView {
2008            fn as_ref(
2009                &self,
2010            ) -> &::buffa::OwnedView<ListDepositAddressesRequestView<'static>> {
2011                &self.0
2012            }
2013        }
2014        impl ::buffa::HasMessageView for super::super::ListDepositAddressesRequest {
2015            type View<'a> = ListDepositAddressesRequestView<'a>;
2016            type ViewHandle = ListDepositAddressesRequestOwnedView;
2017        }
2018        impl ::serde::Serialize for ListDepositAddressesRequestOwnedView {
2019            fn serialize<__S: ::serde::Serializer>(
2020                &self,
2021                __s: __S,
2022            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2023                ::serde::Serialize::serialize(&self.0, __s)
2024            }
2025        }
2026        /// ListDepositAddressesResponse returns the known deposit addresses for the
2027        /// selected target, ordered by ascending chain id.
2028        #[derive(Clone, Debug, Default)]
2029        pub struct ListDepositAddressesResponseView<'a> {
2030            /// Known deposit addresses for the selected target.
2031            ///
2032            /// Field 1: `deposit_addresses`
2033            pub deposit_addresses: ::buffa::RepeatedView<
2034                'a,
2035                super::super::__buffa::view::DepositAddressView<'a>,
2036            >,
2037            pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2038        }
2039        impl<'a> ::buffa::MessageView<'a> for ListDepositAddressesResponseView<'a> {
2040            type Owned = super::super::ListDepositAddressesResponse;
2041            fn decode_view(
2042                buf: &'a [u8],
2043            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2044                let __limit = ::core::cell::Cell::new(
2045                    ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
2046                );
2047                <Self as ::buffa::MessageView>::decode_view_ctx(
2048                    buf,
2049                    ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2050                )
2051            }
2052            fn decode_view_with_ctx(
2053                buf: &'a [u8],
2054                ctx: ::buffa::DecodeContext<'_>,
2055            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2056                <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2057            }
2058            fn merge_view_field(
2059                &mut self,
2060                tag: ::buffa::encoding::Tag,
2061                cur: &'a [u8],
2062                before_tag: &'a [u8],
2063                ctx: ::buffa::DecodeContext<'_>,
2064            ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2065                let _ = ctx;
2066                #[allow(unused_variables)]
2067                let view = self;
2068                let mut cur = cur;
2069                match tag.field_number() {
2070                    1u32 => {
2071                        ::buffa::encoding::check_wire_type(
2072                            tag,
2073                            ::buffa::encoding::WireType::LengthDelimited,
2074                        )?;
2075                        let __sub_ctx = ctx.descend()?;
2076                        let sub = ::buffa::types::borrow_bytes(&mut cur)?;
2077                        view.deposit_addresses
2078                            .push(
2079                                <super::super::__buffa::view::DepositAddressView as ::buffa::MessageView>::decode_view_ctx(
2080                                    sub,
2081                                    __sub_ctx,
2082                                )?,
2083                            );
2084                    }
2085                    _ => {
2086                        ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
2087                        let span_len = before_tag.len() - cur.len();
2088                        view.__buffa_unknown_fields
2089                            .push_record(before_tag, span_len, ctx)?;
2090                    }
2091                }
2092                ::core::result::Result::Ok(cur)
2093            }
2094            fn to_owned_message(
2095                &self,
2096            ) -> ::core::result::Result<
2097                super::super::ListDepositAddressesResponse,
2098                ::buffa::DecodeError,
2099            > {
2100                self.to_owned_from_source(None)
2101            }
2102            #[allow(clippy::useless_conversion, clippy::needless_update)]
2103            fn to_owned_from_source(
2104                &self,
2105                __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2106            ) -> ::core::result::Result<
2107                super::super::ListDepositAddressesResponse,
2108                ::buffa::DecodeError,
2109            > {
2110                #[allow(unused_imports)]
2111                use ::buffa::alloc::string::ToString as _;
2112                let _ = __buffa_src;
2113                ::core::result::Result::Ok(super::super::ListDepositAddressesResponse {
2114                    deposit_addresses: self
2115                        .deposit_addresses
2116                        .iter()
2117                        .map(|v| v.to_owned_from_source(__buffa_src))
2118                        .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
2119                    __buffa_unknown_fields: self
2120                        .__buffa_unknown_fields
2121                        .to_owned()?
2122                        .into(),
2123                    ..::core::default::Default::default()
2124                })
2125            }
2126        }
2127        impl<'a> ::buffa::ViewEncode<'a> for ListDepositAddressesResponseView<'a> {
2128            #[allow(clippy::needless_borrow, clippy::let_and_return)]
2129            fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2130                #[allow(unused_imports)]
2131                use ::buffa::Enumeration as _;
2132                let mut size = 0u32;
2133                for v in &self.deposit_addresses {
2134                    let __slot = __cache.reserve();
2135                    let inner_size = v.compute_size(__cache);
2136                    __cache.set(__slot, inner_size);
2137                    size
2138                        += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2139                            + inner_size;
2140                }
2141                size += self.__buffa_unknown_fields.encoded_len() as u32;
2142                size
2143            }
2144            #[allow(clippy::needless_borrow)]
2145            fn write_to(
2146                &self,
2147                __cache: &mut ::buffa::SizeCache,
2148                buf: &mut impl ::buffa::bytes::BufMut,
2149            ) {
2150                #[allow(unused_imports)]
2151                use ::buffa::Enumeration as _;
2152                for v in &self.deposit_addresses {
2153                    ::buffa::types::put_len_delimited_header(
2154                        1u32,
2155                        __cache.consume_next(),
2156                        buf,
2157                    );
2158                    v.write_to(__cache, buf);
2159                }
2160                self.__buffa_unknown_fields.write_to(buf);
2161            }
2162        }
2163        /// Serializes this view as protobuf JSON.
2164        ///
2165        /// Implicit-presence fields with default values are omitted, `required`
2166        /// fields are always emitted, explicit-presence (`optional`) fields are
2167        /// emitted only when set, bytes fields are base64-encoded, and enum
2168        /// values are their proto name strings.
2169        ///
2170        /// This impl uses `serialize_map(None)` because the number of emitted
2171        /// fields depends on default-omission rules; serializers that require
2172        /// known map lengths (e.g. `bincode`) will return a runtime error.
2173        /// Use the owned message type for those formats.
2174        impl<'__a> ::serde::Serialize for ListDepositAddressesResponseView<'__a> {
2175            fn serialize<__S: ::serde::Serializer>(
2176                &self,
2177                __s: __S,
2178            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2179                use ::serde::ser::SerializeMap as _;
2180                let mut __map = __s.serialize_map(::core::option::Option::None)?;
2181                if !self.deposit_addresses.is_empty() {
2182                    __map.serialize_entry("depositAddresses", &*self.deposit_addresses)?;
2183                }
2184                __map.end()
2185            }
2186        }
2187        impl<'a> ::buffa::MessageName for ListDepositAddressesResponseView<'a> {
2188            const PACKAGE: &'static str = "chain.deposit.v1";
2189            const NAME: &'static str = "ListDepositAddressesResponse";
2190            const FULL_NAME: &'static str = "chain.deposit.v1.ListDepositAddressesResponse";
2191            const TYPE_URL: &'static str = "type.googleapis.com/chain.deposit.v1.ListDepositAddressesResponse";
2192        }
2193        ::buffa::impl_default_view_instance!(ListDepositAddressesResponseView);
2194        ::buffa::impl_view_reborrow!(ListDepositAddressesResponseView);
2195        /** Self-contained, `'static` owned view of a `ListDepositAddressesResponse` message.
2196
2197 Wraps [`::buffa::OwnedView`]`<`[`ListDepositAddressesResponseView`]`<'static>>`: the decoded view and the [`::buffa::bytes::Bytes`] buffer it borrows from travel together, so the handle is `'static` and `Send + Sync` — suitable for async handlers, spawned tasks, and anywhere a `'static` bound is required.
2198
2199 Field accessors return borrows tied to `&self`. Use [`Self::view`] to get the full [`ListDepositAddressesResponseView`] when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.*/
2200        #[derive(Clone, Debug)]
2201        pub struct ListDepositAddressesResponseOwnedView(
2202            ::buffa::OwnedView<ListDepositAddressesResponseView<'static>>,
2203        );
2204        impl ListDepositAddressesResponseOwnedView {
2205            /// Decode an owned view from a [`::buffa::bytes::Bytes`] buffer.
2206            ///
2207            /// The view borrows directly from the buffer's data; the buffer is
2208            /// retained inside the returned handle.
2209            ///
2210            /// # Errors
2211            ///
2212            /// Returns [`::buffa::DecodeError`] if the buffer contains invalid
2213            /// protobuf data.
2214            pub fn decode(
2215                bytes: ::buffa::bytes::Bytes,
2216            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2217                ::core::result::Result::Ok(
2218                    ListDepositAddressesResponseOwnedView(
2219                        ::buffa::OwnedView::decode(bytes)?,
2220                    ),
2221                )
2222            }
2223            /// Decode with custom [`::buffa::DecodeOptions`] (recursion limit,
2224            /// max message size).
2225            ///
2226            /// # Errors
2227            ///
2228            /// Returns [`::buffa::DecodeError`] if the buffer is invalid or
2229            /// exceeds the configured limits.
2230            pub fn decode_with_options(
2231                bytes: ::buffa::bytes::Bytes,
2232                opts: &::buffa::DecodeOptions,
2233            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2234                ::core::result::Result::Ok(
2235                    ListDepositAddressesResponseOwnedView(
2236                        ::buffa::OwnedView::decode_with_options(bytes, opts)?,
2237                    ),
2238                )
2239            }
2240            /// Build from an owned message via an encode → decode round-trip.
2241            ///
2242            /// # Errors
2243            ///
2244            /// Returns [`::buffa::DecodeError`] if the re-encoded bytes are
2245            /// somehow invalid (should not happen for well-formed messages).
2246            pub fn from_owned(
2247                msg: &super::super::ListDepositAddressesResponse,
2248            ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2249                ::core::result::Result::Ok(
2250                    ListDepositAddressesResponseOwnedView(
2251                        ::buffa::OwnedView::from_owned(msg)?,
2252                    ),
2253                )
2254            }
2255            /// Borrow the full [`ListDepositAddressesResponseView`] with its lifetime tied to `&self`.
2256            #[must_use]
2257            pub fn view(&self) -> &ListDepositAddressesResponseView<'_> {
2258                self.0.reborrow()
2259            }
2260            /// Convert to the owned message type.
2261            ///
2262            /// # Errors
2263            ///
2264            /// Returns an error if re-materializing preserved unknown fields
2265            /// fails (e.g. the unknown-field limit is exceeded).
2266            pub fn to_owned_message(
2267                &self,
2268            ) -> ::core::result::Result<
2269                super::super::ListDepositAddressesResponse,
2270                ::buffa::DecodeError,
2271            > {
2272                self.0.to_owned_message()
2273            }
2274            /// The underlying bytes buffer.
2275            #[must_use]
2276            pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2277                self.0.bytes()
2278            }
2279            /// Consume the handle, returning the underlying bytes buffer.
2280            #[must_use]
2281            pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2282                self.0.into_bytes()
2283            }
2284            /// Known deposit addresses for the selected target.
2285            ///
2286            /// Field 1: `deposit_addresses`
2287            #[must_use]
2288            pub fn deposit_addresses(
2289                &self,
2290            ) -> &::buffa::RepeatedView<
2291                '_,
2292                super::super::__buffa::view::DepositAddressView<'_>,
2293            > {
2294                &self.0.reborrow().deposit_addresses
2295            }
2296        }
2297        impl ::core::convert::From<
2298            ::buffa::OwnedView<ListDepositAddressesResponseView<'static>>,
2299        > for ListDepositAddressesResponseOwnedView {
2300            fn from(
2301                inner: ::buffa::OwnedView<ListDepositAddressesResponseView<'static>>,
2302            ) -> Self {
2303                ListDepositAddressesResponseOwnedView(inner)
2304            }
2305        }
2306        impl ::core::convert::From<ListDepositAddressesResponseOwnedView>
2307        for ::buffa::OwnedView<ListDepositAddressesResponseView<'static>> {
2308            fn from(wrapper: ListDepositAddressesResponseOwnedView) -> Self {
2309                wrapper.0
2310            }
2311        }
2312        impl ::core::convert::AsRef<
2313            ::buffa::OwnedView<ListDepositAddressesResponseView<'static>>,
2314        > for ListDepositAddressesResponseOwnedView {
2315            fn as_ref(
2316                &self,
2317            ) -> &::buffa::OwnedView<ListDepositAddressesResponseView<'static>> {
2318                &self.0
2319            }
2320        }
2321        impl ::buffa::HasMessageView for super::super::ListDepositAddressesResponse {
2322            type View<'a> = ListDepositAddressesResponseView<'a>;
2323            type ViewHandle = ListDepositAddressesResponseOwnedView;
2324        }
2325        impl ::serde::Serialize for ListDepositAddressesResponseOwnedView {
2326            fn serialize<__S: ::serde::Serializer>(
2327                &self,
2328                __s: __S,
2329            ) -> ::core::result::Result<__S::Ok, __S::Error> {
2330                ::serde::Serialize::serialize(&self.0, __s)
2331            }
2332        }
2333    }
2334    /// Register this package's `Any` type entries and extension entries.
2335    pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
2336        reg.register_json_any(super::__DEPOSIT_ADDRESS_JSON_ANY);
2337        reg.register_json_any(super::__CREATE_DEPOSIT_ADDRESS_REQUEST_JSON_ANY);
2338        reg.register_json_any(super::__CREATE_DEPOSIT_ADDRESS_RESPONSE_JSON_ANY);
2339        reg.register_json_any(super::__LIST_DEPOSIT_ADDRESSES_REQUEST_JSON_ANY);
2340        reg.register_json_any(super::__LIST_DEPOSIT_ADDRESSES_RESPONSE_JSON_ANY);
2341    }
2342}
2343#[doc(inline)]
2344pub use self::__buffa::view::DepositAddressView;
2345#[doc(inline)]
2346pub use self::__buffa::view::DepositAddressOwnedView;
2347#[doc(inline)]
2348pub use self::__buffa::view::CreateDepositAddressRequestView;
2349#[doc(inline)]
2350pub use self::__buffa::view::CreateDepositAddressRequestOwnedView;
2351#[doc(inline)]
2352pub use self::__buffa::view::CreateDepositAddressResponseView;
2353#[doc(inline)]
2354pub use self::__buffa::view::CreateDepositAddressResponseOwnedView;
2355#[doc(inline)]
2356pub use self::__buffa::view::ListDepositAddressesRequestView;
2357#[doc(inline)]
2358pub use self::__buffa::view::ListDepositAddressesRequestOwnedView;
2359#[doc(inline)]
2360pub use self::__buffa::view::ListDepositAddressesResponseView;
2361#[doc(inline)]
2362pub use self::__buffa::view::ListDepositAddressesResponseOwnedView;
2363#[doc(inline)]
2364pub use self::__buffa::register_types;