1#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
7#[repr(i32)]
8pub enum ZipperReasonCode {
9 REASON_UNSPECIFIED = 0i32,
11 DEPOSIT_WAIT_EXPIRED = 1001i32,
13 DEPOSIT_AMOUNT_INVALID = 1002i32,
15 DEPOSIT_AMOUNT_BELOW_MINIMUM = 1003i32,
17 DEPOSIT_AMOUNT_NOT_ABOVE_FEE = 1004i32,
19 DEPOSIT_NET_AMOUNT_BELOW_MINIMUM = 1005i32,
21 EVM_DEPOSIT_SOURCE_TX_INVALID = 1101i32,
23 EVM_DEPOSIT_SOURCE_TX_ZERO = 1102i32,
25 EVM_DEPOSIT_SOURCE_TX_NOT_FOUND = 1103i32,
27 EVM_DEPOSIT_SOURCE_TX_REVERTED = 1104i32,
29 EVM_DEPOSIT_TRANSFER_MISMATCH = 1105i32,
31 UTXO_DEPOSIT_TRANSACTION_MISMATCH = 1201i32,
33 BTC_DEPOSIT_TRANSACTION_MISMATCH = 1202i32,
35 BCH_DEPOSIT_TRANSACTION_MISMATCH = 1203i32,
37 DOGE_DEPOSIT_TRANSACTION_MISMATCH = 1204i32,
39 LTC_DEPOSIT_TRANSACTION_MISMATCH = 1205i32,
41 UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS = 1206i32,
43 SOLANA_DEPOSIT_SIGNATURE_INVALID = 1301i32,
45 SOLANA_DEPOSIT_TRANSACTION_FAILED = 1302i32,
47 SOLANA_DEPOSIT_TRANSFER_MISMATCH = 1303i32,
49 XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID = 1401i32,
51 XRP_DEPOSIT_SOURCE_ADDRESS_INVALID = 1402i32,
53 XRP_DEPOSIT_ADDRESS_INVALID = 1403i32,
55 XRP_DEPOSIT_PAYMENT_MISMATCH = 1404i32,
57 REJECTION_UNMAPPED = 1999i32,
59 WITHDRAWAL_AMOUNT_INVALID = 2001i32,
61 WITHDRAWAL_AMOUNT_BELOW_MINIMUM = 2002i32,
63 WITHDRAWAL_ASSET_INVALID = 2003i32,
65 WITHDRAWAL_SENDER_INVALID = 2004i32,
67 WITHDRAWAL_DESTINATION_INVALID = 2005i32,
69 WITHDRAWAL_ASSET_UNAVAILABLE = 2006i32,
71 EVM_WITHDRAWAL_DESTINATION_INVALID = 2101i32,
73 BTC_WITHDRAWAL_DESTINATION_INVALID = 2201i32,
75 BCH_WITHDRAWAL_DESTINATION_INVALID = 2202i32,
77 DOGE_WITHDRAWAL_DESTINATION_INVALID = 2203i32,
79 LTC_WITHDRAWAL_DESTINATION_INVALID = 2204i32,
81 SOLANA_WITHDRAWAL_DESTINATION_INVALID = 2301i32,
83 XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID = 2401i32,
85 XRP_WITHDRAWAL_DESTINATION_TAG_INVALID = 2402i32,
87 WITHDRAWAL_LIQUIDITY_INSUFFICIENT = 3001i32,
89 COMPLIANCE_HIGH_RISK_ADDRESS = 3002i32,
91 REQUEST_VERIFICATION_REJECTED = 3901i32,
93 REJECTED = 3902i32,
95 ERROR_UNMAPPED = 9000i32,
97 ERROR_NETWORK_UNSUPPORTED = 9001i32,
99 ERROR_REQUEST_PROCESSING_FAILED = 9002i32,
101 ERROR_REQUEST_VERIFICATION_FAILED = 9003i32,
103 ERROR_RESULT_SUBMISSION_FAILED = 9004i32,
105 ERROR_STATUS_UNKNOWN = 9005i32,
107}
108impl ZipperReasonCode {
109 #[allow(non_upper_case_globals)]
111 pub const ReasonUnspecified: Self = Self::REASON_UNSPECIFIED;
112 #[allow(non_upper_case_globals)]
114 pub const DepositWaitExpired: Self = Self::DEPOSIT_WAIT_EXPIRED;
115 #[allow(non_upper_case_globals)]
117 pub const DepositAmountInvalid: Self = Self::DEPOSIT_AMOUNT_INVALID;
118 #[allow(non_upper_case_globals)]
120 pub const DepositAmountBelowMinimum: Self = Self::DEPOSIT_AMOUNT_BELOW_MINIMUM;
121 #[allow(non_upper_case_globals)]
123 pub const DepositAmountNotAboveFee: Self = Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE;
124 #[allow(non_upper_case_globals)]
126 pub const DepositNetAmountBelowMinimum: Self = Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM;
127 #[allow(non_upper_case_globals)]
129 pub const EvmDepositSourceTxInvalid: Self = Self::EVM_DEPOSIT_SOURCE_TX_INVALID;
130 #[allow(non_upper_case_globals)]
132 pub const EvmDepositSourceTxZero: Self = Self::EVM_DEPOSIT_SOURCE_TX_ZERO;
133 #[allow(non_upper_case_globals)]
135 pub const EvmDepositSourceTxNotFound: Self = Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND;
136 #[allow(non_upper_case_globals)]
138 pub const EvmDepositSourceTxReverted: Self = Self::EVM_DEPOSIT_SOURCE_TX_REVERTED;
139 #[allow(non_upper_case_globals)]
141 pub const EvmDepositTransferMismatch: Self = Self::EVM_DEPOSIT_TRANSFER_MISMATCH;
142 #[allow(non_upper_case_globals)]
144 pub const UtxoDepositTransactionMismatch: Self = Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH;
145 #[allow(non_upper_case_globals)]
147 pub const BtcDepositTransactionMismatch: Self = Self::BTC_DEPOSIT_TRANSACTION_MISMATCH;
148 #[allow(non_upper_case_globals)]
150 pub const BchDepositTransactionMismatch: Self = Self::BCH_DEPOSIT_TRANSACTION_MISMATCH;
151 #[allow(non_upper_case_globals)]
153 pub const DogeDepositTransactionMismatch: Self = Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH;
154 #[allow(non_upper_case_globals)]
156 pub const LtcDepositTransactionMismatch: Self = Self::LTC_DEPOSIT_TRANSACTION_MISMATCH;
157 #[allow(non_upper_case_globals)]
159 pub const UtxoDepositSourceIsDepositAddress: Self = Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS;
160 #[allow(non_upper_case_globals)]
162 pub const SolanaDepositSignatureInvalid: Self = Self::SOLANA_DEPOSIT_SIGNATURE_INVALID;
163 #[allow(non_upper_case_globals)]
165 pub const SolanaDepositTransactionFailed: Self = Self::SOLANA_DEPOSIT_TRANSACTION_FAILED;
166 #[allow(non_upper_case_globals)]
168 pub const SolanaDepositTransferMismatch: Self = Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH;
169 #[allow(non_upper_case_globals)]
171 pub const XrpDepositSourceHashIndexInvalid: Self = Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID;
172 #[allow(non_upper_case_globals)]
174 pub const XrpDepositSourceAddressInvalid: Self = Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID;
175 #[allow(non_upper_case_globals)]
177 pub const XrpDepositAddressInvalid: Self = Self::XRP_DEPOSIT_ADDRESS_INVALID;
178 #[allow(non_upper_case_globals)]
180 pub const XrpDepositPaymentMismatch: Self = Self::XRP_DEPOSIT_PAYMENT_MISMATCH;
181 #[allow(non_upper_case_globals)]
183 pub const RejectionUnmapped: Self = Self::REJECTION_UNMAPPED;
184 #[allow(non_upper_case_globals)]
186 pub const WithdrawalAmountInvalid: Self = Self::WITHDRAWAL_AMOUNT_INVALID;
187 #[allow(non_upper_case_globals)]
189 pub const WithdrawalAmountBelowMinimum: Self = Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM;
190 #[allow(non_upper_case_globals)]
192 pub const WithdrawalAssetInvalid: Self = Self::WITHDRAWAL_ASSET_INVALID;
193 #[allow(non_upper_case_globals)]
195 pub const WithdrawalSenderInvalid: Self = Self::WITHDRAWAL_SENDER_INVALID;
196 #[allow(non_upper_case_globals)]
198 pub const WithdrawalDestinationInvalid: Self = Self::WITHDRAWAL_DESTINATION_INVALID;
199 #[allow(non_upper_case_globals)]
201 pub const WithdrawalAssetUnavailable: Self = Self::WITHDRAWAL_ASSET_UNAVAILABLE;
202 #[allow(non_upper_case_globals)]
204 pub const EvmWithdrawalDestinationInvalid: Self = Self::EVM_WITHDRAWAL_DESTINATION_INVALID;
205 #[allow(non_upper_case_globals)]
207 pub const BtcWithdrawalDestinationInvalid: Self = Self::BTC_WITHDRAWAL_DESTINATION_INVALID;
208 #[allow(non_upper_case_globals)]
210 pub const BchWithdrawalDestinationInvalid: Self = Self::BCH_WITHDRAWAL_DESTINATION_INVALID;
211 #[allow(non_upper_case_globals)]
213 pub const DogeWithdrawalDestinationInvalid: Self = Self::DOGE_WITHDRAWAL_DESTINATION_INVALID;
214 #[allow(non_upper_case_globals)]
216 pub const LtcWithdrawalDestinationInvalid: Self = Self::LTC_WITHDRAWAL_DESTINATION_INVALID;
217 #[allow(non_upper_case_globals)]
219 pub const SolanaWithdrawalDestinationInvalid: Self = Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID;
220 #[allow(non_upper_case_globals)]
222 pub const XrpWithdrawalClassicAddressInvalid: Self = Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID;
223 #[allow(non_upper_case_globals)]
225 pub const XrpWithdrawalDestinationTagInvalid: Self = Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID;
226 #[allow(non_upper_case_globals)]
228 pub const WithdrawalLiquidityInsufficient: Self = Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT;
229 #[allow(non_upper_case_globals)]
231 pub const ComplianceHighRiskAddress: Self = Self::COMPLIANCE_HIGH_RISK_ADDRESS;
232 #[allow(non_upper_case_globals)]
234 pub const RequestVerificationRejected: Self = Self::REQUEST_VERIFICATION_REJECTED;
235 #[allow(non_upper_case_globals)]
237 pub const Rejected: Self = Self::REJECTED;
238 #[allow(non_upper_case_globals)]
240 pub const ErrorUnmapped: Self = Self::ERROR_UNMAPPED;
241 #[allow(non_upper_case_globals)]
243 pub const ErrorNetworkUnsupported: Self = Self::ERROR_NETWORK_UNSUPPORTED;
244 #[allow(non_upper_case_globals)]
246 pub const ErrorRequestProcessingFailed: Self = Self::ERROR_REQUEST_PROCESSING_FAILED;
247 #[allow(non_upper_case_globals)]
249 pub const ErrorRequestVerificationFailed: Self = Self::ERROR_REQUEST_VERIFICATION_FAILED;
250 #[allow(non_upper_case_globals)]
252 pub const ErrorResultSubmissionFailed: Self = Self::ERROR_RESULT_SUBMISSION_FAILED;
253 #[allow(non_upper_case_globals)]
255 pub const ErrorStatusUnknown: Self = Self::ERROR_STATUS_UNKNOWN;
256}
257impl ::core::default::Default for ZipperReasonCode {
258 fn default() -> Self {
259 Self::REASON_UNSPECIFIED
260 }
261}
262impl ::serde::Serialize for ZipperReasonCode {
263 fn serialize<S: ::serde::Serializer>(
264 &self,
265 s: S,
266 ) -> ::core::result::Result<S::Ok, S::Error> {
267 s.serialize_str(::buffa::Enumeration::proto_name(self))
268 }
269}
270impl<'de> ::serde::Deserialize<'de> for ZipperReasonCode {
271 fn deserialize<D: ::serde::Deserializer<'de>>(
272 d: D,
273 ) -> ::core::result::Result<Self, D::Error> {
274 struct _V;
275 impl ::serde::de::Visitor<'_> for _V {
276 type Value = ZipperReasonCode;
277 fn expecting(
278 &self,
279 f: &mut ::core::fmt::Formatter<'_>,
280 ) -> ::core::fmt::Result {
281 f.write_str(
282 concat!(
283 "a string, integer, or null for ", stringify!(ZipperReasonCode)
284 ),
285 )
286 }
287 fn visit_str<E: ::serde::de::Error>(
288 self,
289 v: &str,
290 ) -> ::core::result::Result<ZipperReasonCode, E> {
291 <ZipperReasonCode as ::buffa::Enumeration>::from_proto_name(v)
292 .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
293 }
294 fn visit_i64<E: ::serde::de::Error>(
295 self,
296 v: i64,
297 ) -> ::core::result::Result<ZipperReasonCode, E> {
298 let v32 = i32::try_from(v)
299 .map_err(|_| {
300 ::serde::de::Error::custom(
301 ::buffa::alloc::format!("enum value {v} out of i32 range"),
302 )
303 })?;
304 <ZipperReasonCode as ::buffa::Enumeration>::from_i32(v32)
305 .ok_or_else(|| {
306 ::serde::de::Error::custom(
307 ::buffa::alloc::format!("unknown enum value {v32}"),
308 )
309 })
310 }
311 fn visit_u64<E: ::serde::de::Error>(
312 self,
313 v: u64,
314 ) -> ::core::result::Result<ZipperReasonCode, E> {
315 let v32 = i32::try_from(v)
316 .map_err(|_| {
317 ::serde::de::Error::custom(
318 ::buffa::alloc::format!("enum value {v} out of i32 range"),
319 )
320 })?;
321 <ZipperReasonCode as ::buffa::Enumeration>::from_i32(v32)
322 .ok_or_else(|| {
323 ::serde::de::Error::custom(
324 ::buffa::alloc::format!("unknown enum value {v32}"),
325 )
326 })
327 }
328 fn visit_unit<E: ::serde::de::Error>(
329 self,
330 ) -> ::core::result::Result<ZipperReasonCode, E> {
331 ::core::result::Result::Ok(::core::default::Default::default())
332 }
333 }
334 d.deserialize_any(_V)
335 }
336}
337impl ::buffa::json_helpers::ProtoElemJson for ZipperReasonCode {
338 fn serialize_proto_json<S: ::serde::Serializer>(
339 v: &Self,
340 s: S,
341 ) -> ::core::result::Result<S::Ok, S::Error> {
342 ::serde::Serialize::serialize(v, s)
343 }
344 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
345 d: D,
346 ) -> ::core::result::Result<Self, D::Error> {
347 <Self as ::serde::Deserialize>::deserialize(d)
348 }
349}
350impl ::buffa::Enumeration for ZipperReasonCode {
351 fn from_i32(value: i32) -> ::core::option::Option<Self> {
352 match value {
353 0i32 => ::core::option::Option::Some(Self::REASON_UNSPECIFIED),
354 1001i32 => ::core::option::Option::Some(Self::DEPOSIT_WAIT_EXPIRED),
355 1002i32 => ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_INVALID),
356 1003i32 => ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_BELOW_MINIMUM),
357 1004i32 => ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE),
358 1005i32 => {
359 ::core::option::Option::Some(Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM)
360 }
361 1101i32 => ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_INVALID),
362 1102i32 => ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_ZERO),
363 1103i32 => {
364 ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND)
365 }
366 1104i32 => ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_REVERTED),
367 1105i32 => ::core::option::Option::Some(Self::EVM_DEPOSIT_TRANSFER_MISMATCH),
368 1201i32 => {
369 ::core::option::Option::Some(Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH)
370 }
371 1202i32 => {
372 ::core::option::Option::Some(Self::BTC_DEPOSIT_TRANSACTION_MISMATCH)
373 }
374 1203i32 => {
375 ::core::option::Option::Some(Self::BCH_DEPOSIT_TRANSACTION_MISMATCH)
376 }
377 1204i32 => {
378 ::core::option::Option::Some(Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH)
379 }
380 1205i32 => {
381 ::core::option::Option::Some(Self::LTC_DEPOSIT_TRANSACTION_MISMATCH)
382 }
383 1206i32 => {
384 ::core::option::Option::Some(
385 Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS,
386 )
387 }
388 1301i32 => {
389 ::core::option::Option::Some(Self::SOLANA_DEPOSIT_SIGNATURE_INVALID)
390 }
391 1302i32 => {
392 ::core::option::Option::Some(Self::SOLANA_DEPOSIT_TRANSACTION_FAILED)
393 }
394 1303i32 => {
395 ::core::option::Option::Some(Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH)
396 }
397 1401i32 => {
398 ::core::option::Option::Some(Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID)
399 }
400 1402i32 => {
401 ::core::option::Option::Some(Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID)
402 }
403 1403i32 => ::core::option::Option::Some(Self::XRP_DEPOSIT_ADDRESS_INVALID),
404 1404i32 => ::core::option::Option::Some(Self::XRP_DEPOSIT_PAYMENT_MISMATCH),
405 1999i32 => ::core::option::Option::Some(Self::REJECTION_UNMAPPED),
406 2001i32 => ::core::option::Option::Some(Self::WITHDRAWAL_AMOUNT_INVALID),
407 2002i32 => {
408 ::core::option::Option::Some(Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM)
409 }
410 2003i32 => ::core::option::Option::Some(Self::WITHDRAWAL_ASSET_INVALID),
411 2004i32 => ::core::option::Option::Some(Self::WITHDRAWAL_SENDER_INVALID),
412 2005i32 => ::core::option::Option::Some(Self::WITHDRAWAL_DESTINATION_INVALID),
413 2006i32 => ::core::option::Option::Some(Self::WITHDRAWAL_ASSET_UNAVAILABLE),
414 2101i32 => {
415 ::core::option::Option::Some(Self::EVM_WITHDRAWAL_DESTINATION_INVALID)
416 }
417 2201i32 => {
418 ::core::option::Option::Some(Self::BTC_WITHDRAWAL_DESTINATION_INVALID)
419 }
420 2202i32 => {
421 ::core::option::Option::Some(Self::BCH_WITHDRAWAL_DESTINATION_INVALID)
422 }
423 2203i32 => {
424 ::core::option::Option::Some(Self::DOGE_WITHDRAWAL_DESTINATION_INVALID)
425 }
426 2204i32 => {
427 ::core::option::Option::Some(Self::LTC_WITHDRAWAL_DESTINATION_INVALID)
428 }
429 2301i32 => {
430 ::core::option::Option::Some(Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID)
431 }
432 2401i32 => {
433 ::core::option::Option::Some(
434 Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID,
435 )
436 }
437 2402i32 => {
438 ::core::option::Option::Some(
439 Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID,
440 )
441 }
442 3001i32 => {
443 ::core::option::Option::Some(Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT)
444 }
445 3002i32 => ::core::option::Option::Some(Self::COMPLIANCE_HIGH_RISK_ADDRESS),
446 3901i32 => ::core::option::Option::Some(Self::REQUEST_VERIFICATION_REJECTED),
447 3902i32 => ::core::option::Option::Some(Self::REJECTED),
448 9000i32 => ::core::option::Option::Some(Self::ERROR_UNMAPPED),
449 9001i32 => ::core::option::Option::Some(Self::ERROR_NETWORK_UNSUPPORTED),
450 9002i32 => {
451 ::core::option::Option::Some(Self::ERROR_REQUEST_PROCESSING_FAILED)
452 }
453 9003i32 => {
454 ::core::option::Option::Some(Self::ERROR_REQUEST_VERIFICATION_FAILED)
455 }
456 9004i32 => ::core::option::Option::Some(Self::ERROR_RESULT_SUBMISSION_FAILED),
457 9005i32 => ::core::option::Option::Some(Self::ERROR_STATUS_UNKNOWN),
458 _ => ::core::option::Option::None,
459 }
460 }
461 fn to_i32(&self) -> i32 {
462 *self as i32
463 }
464 fn proto_name(&self) -> &'static str {
465 match self {
466 Self::REASON_UNSPECIFIED => "REASON_UNSPECIFIED",
467 Self::DEPOSIT_WAIT_EXPIRED => "DEPOSIT_WAIT_EXPIRED",
468 Self::DEPOSIT_AMOUNT_INVALID => "DEPOSIT_AMOUNT_INVALID",
469 Self::DEPOSIT_AMOUNT_BELOW_MINIMUM => "DEPOSIT_AMOUNT_BELOW_MINIMUM",
470 Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE => "DEPOSIT_AMOUNT_NOT_ABOVE_FEE",
471 Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM => "DEPOSIT_NET_AMOUNT_BELOW_MINIMUM",
472 Self::EVM_DEPOSIT_SOURCE_TX_INVALID => "EVM_DEPOSIT_SOURCE_TX_INVALID",
473 Self::EVM_DEPOSIT_SOURCE_TX_ZERO => "EVM_DEPOSIT_SOURCE_TX_ZERO",
474 Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND => "EVM_DEPOSIT_SOURCE_TX_NOT_FOUND",
475 Self::EVM_DEPOSIT_SOURCE_TX_REVERTED => "EVM_DEPOSIT_SOURCE_TX_REVERTED",
476 Self::EVM_DEPOSIT_TRANSFER_MISMATCH => "EVM_DEPOSIT_TRANSFER_MISMATCH",
477 Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH => {
478 "UTXO_DEPOSIT_TRANSACTION_MISMATCH"
479 }
480 Self::BTC_DEPOSIT_TRANSACTION_MISMATCH => "BTC_DEPOSIT_TRANSACTION_MISMATCH",
481 Self::BCH_DEPOSIT_TRANSACTION_MISMATCH => "BCH_DEPOSIT_TRANSACTION_MISMATCH",
482 Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH => {
483 "DOGE_DEPOSIT_TRANSACTION_MISMATCH"
484 }
485 Self::LTC_DEPOSIT_TRANSACTION_MISMATCH => "LTC_DEPOSIT_TRANSACTION_MISMATCH",
486 Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS => {
487 "UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS"
488 }
489 Self::SOLANA_DEPOSIT_SIGNATURE_INVALID => "SOLANA_DEPOSIT_SIGNATURE_INVALID",
490 Self::SOLANA_DEPOSIT_TRANSACTION_FAILED => {
491 "SOLANA_DEPOSIT_TRANSACTION_FAILED"
492 }
493 Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH => "SOLANA_DEPOSIT_TRANSFER_MISMATCH",
494 Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID => {
495 "XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID"
496 }
497 Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID => {
498 "XRP_DEPOSIT_SOURCE_ADDRESS_INVALID"
499 }
500 Self::XRP_DEPOSIT_ADDRESS_INVALID => "XRP_DEPOSIT_ADDRESS_INVALID",
501 Self::XRP_DEPOSIT_PAYMENT_MISMATCH => "XRP_DEPOSIT_PAYMENT_MISMATCH",
502 Self::REJECTION_UNMAPPED => "REJECTION_UNMAPPED",
503 Self::WITHDRAWAL_AMOUNT_INVALID => "WITHDRAWAL_AMOUNT_INVALID",
504 Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM => "WITHDRAWAL_AMOUNT_BELOW_MINIMUM",
505 Self::WITHDRAWAL_ASSET_INVALID => "WITHDRAWAL_ASSET_INVALID",
506 Self::WITHDRAWAL_SENDER_INVALID => "WITHDRAWAL_SENDER_INVALID",
507 Self::WITHDRAWAL_DESTINATION_INVALID => "WITHDRAWAL_DESTINATION_INVALID",
508 Self::WITHDRAWAL_ASSET_UNAVAILABLE => "WITHDRAWAL_ASSET_UNAVAILABLE",
509 Self::EVM_WITHDRAWAL_DESTINATION_INVALID => {
510 "EVM_WITHDRAWAL_DESTINATION_INVALID"
511 }
512 Self::BTC_WITHDRAWAL_DESTINATION_INVALID => {
513 "BTC_WITHDRAWAL_DESTINATION_INVALID"
514 }
515 Self::BCH_WITHDRAWAL_DESTINATION_INVALID => {
516 "BCH_WITHDRAWAL_DESTINATION_INVALID"
517 }
518 Self::DOGE_WITHDRAWAL_DESTINATION_INVALID => {
519 "DOGE_WITHDRAWAL_DESTINATION_INVALID"
520 }
521 Self::LTC_WITHDRAWAL_DESTINATION_INVALID => {
522 "LTC_WITHDRAWAL_DESTINATION_INVALID"
523 }
524 Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID => {
525 "SOLANA_WITHDRAWAL_DESTINATION_INVALID"
526 }
527 Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID => {
528 "XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID"
529 }
530 Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID => {
531 "XRP_WITHDRAWAL_DESTINATION_TAG_INVALID"
532 }
533 Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT => {
534 "WITHDRAWAL_LIQUIDITY_INSUFFICIENT"
535 }
536 Self::COMPLIANCE_HIGH_RISK_ADDRESS => "COMPLIANCE_HIGH_RISK_ADDRESS",
537 Self::REQUEST_VERIFICATION_REJECTED => "REQUEST_VERIFICATION_REJECTED",
538 Self::REJECTED => "REJECTED",
539 Self::ERROR_UNMAPPED => "ERROR_UNMAPPED",
540 Self::ERROR_NETWORK_UNSUPPORTED => "ERROR_NETWORK_UNSUPPORTED",
541 Self::ERROR_REQUEST_PROCESSING_FAILED => "ERROR_REQUEST_PROCESSING_FAILED",
542 Self::ERROR_REQUEST_VERIFICATION_FAILED => {
543 "ERROR_REQUEST_VERIFICATION_FAILED"
544 }
545 Self::ERROR_RESULT_SUBMISSION_FAILED => "ERROR_RESULT_SUBMISSION_FAILED",
546 Self::ERROR_STATUS_UNKNOWN => "ERROR_STATUS_UNKNOWN",
547 }
548 }
549 fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
550 match name {
551 "REASON_UNSPECIFIED" => {
552 ::core::option::Option::Some(Self::REASON_UNSPECIFIED)
553 }
554 "DEPOSIT_WAIT_EXPIRED" => {
555 ::core::option::Option::Some(Self::DEPOSIT_WAIT_EXPIRED)
556 }
557 "DEPOSIT_AMOUNT_INVALID" => {
558 ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_INVALID)
559 }
560 "DEPOSIT_AMOUNT_BELOW_MINIMUM" => {
561 ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_BELOW_MINIMUM)
562 }
563 "DEPOSIT_AMOUNT_NOT_ABOVE_FEE" => {
564 ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE)
565 }
566 "DEPOSIT_NET_AMOUNT_BELOW_MINIMUM" => {
567 ::core::option::Option::Some(Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM)
568 }
569 "EVM_DEPOSIT_SOURCE_TX_INVALID" => {
570 ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_INVALID)
571 }
572 "EVM_DEPOSIT_SOURCE_TX_ZERO" => {
573 ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_ZERO)
574 }
575 "EVM_DEPOSIT_SOURCE_TX_NOT_FOUND" => {
576 ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND)
577 }
578 "EVM_DEPOSIT_SOURCE_TX_REVERTED" => {
579 ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_REVERTED)
580 }
581 "EVM_DEPOSIT_TRANSFER_MISMATCH" => {
582 ::core::option::Option::Some(Self::EVM_DEPOSIT_TRANSFER_MISMATCH)
583 }
584 "UTXO_DEPOSIT_TRANSACTION_MISMATCH" => {
585 ::core::option::Option::Some(Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH)
586 }
587 "BTC_DEPOSIT_TRANSACTION_MISMATCH" => {
588 ::core::option::Option::Some(Self::BTC_DEPOSIT_TRANSACTION_MISMATCH)
589 }
590 "BCH_DEPOSIT_TRANSACTION_MISMATCH" => {
591 ::core::option::Option::Some(Self::BCH_DEPOSIT_TRANSACTION_MISMATCH)
592 }
593 "DOGE_DEPOSIT_TRANSACTION_MISMATCH" => {
594 ::core::option::Option::Some(Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH)
595 }
596 "LTC_DEPOSIT_TRANSACTION_MISMATCH" => {
597 ::core::option::Option::Some(Self::LTC_DEPOSIT_TRANSACTION_MISMATCH)
598 }
599 "UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS" => {
600 ::core::option::Option::Some(
601 Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS,
602 )
603 }
604 "SOLANA_DEPOSIT_SIGNATURE_INVALID" => {
605 ::core::option::Option::Some(Self::SOLANA_DEPOSIT_SIGNATURE_INVALID)
606 }
607 "SOLANA_DEPOSIT_TRANSACTION_FAILED" => {
608 ::core::option::Option::Some(Self::SOLANA_DEPOSIT_TRANSACTION_FAILED)
609 }
610 "SOLANA_DEPOSIT_TRANSFER_MISMATCH" => {
611 ::core::option::Option::Some(Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH)
612 }
613 "XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID" => {
614 ::core::option::Option::Some(Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID)
615 }
616 "XRP_DEPOSIT_SOURCE_ADDRESS_INVALID" => {
617 ::core::option::Option::Some(Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID)
618 }
619 "XRP_DEPOSIT_ADDRESS_INVALID" => {
620 ::core::option::Option::Some(Self::XRP_DEPOSIT_ADDRESS_INVALID)
621 }
622 "XRP_DEPOSIT_PAYMENT_MISMATCH" => {
623 ::core::option::Option::Some(Self::XRP_DEPOSIT_PAYMENT_MISMATCH)
624 }
625 "REJECTION_UNMAPPED" => {
626 ::core::option::Option::Some(Self::REJECTION_UNMAPPED)
627 }
628 "WITHDRAWAL_AMOUNT_INVALID" => {
629 ::core::option::Option::Some(Self::WITHDRAWAL_AMOUNT_INVALID)
630 }
631 "WITHDRAWAL_AMOUNT_BELOW_MINIMUM" => {
632 ::core::option::Option::Some(Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM)
633 }
634 "WITHDRAWAL_ASSET_INVALID" => {
635 ::core::option::Option::Some(Self::WITHDRAWAL_ASSET_INVALID)
636 }
637 "WITHDRAWAL_SENDER_INVALID" => {
638 ::core::option::Option::Some(Self::WITHDRAWAL_SENDER_INVALID)
639 }
640 "WITHDRAWAL_DESTINATION_INVALID" => {
641 ::core::option::Option::Some(Self::WITHDRAWAL_DESTINATION_INVALID)
642 }
643 "WITHDRAWAL_ASSET_UNAVAILABLE" => {
644 ::core::option::Option::Some(Self::WITHDRAWAL_ASSET_UNAVAILABLE)
645 }
646 "EVM_WITHDRAWAL_DESTINATION_INVALID" => {
647 ::core::option::Option::Some(Self::EVM_WITHDRAWAL_DESTINATION_INVALID)
648 }
649 "BTC_WITHDRAWAL_DESTINATION_INVALID" => {
650 ::core::option::Option::Some(Self::BTC_WITHDRAWAL_DESTINATION_INVALID)
651 }
652 "BCH_WITHDRAWAL_DESTINATION_INVALID" => {
653 ::core::option::Option::Some(Self::BCH_WITHDRAWAL_DESTINATION_INVALID)
654 }
655 "DOGE_WITHDRAWAL_DESTINATION_INVALID" => {
656 ::core::option::Option::Some(Self::DOGE_WITHDRAWAL_DESTINATION_INVALID)
657 }
658 "LTC_WITHDRAWAL_DESTINATION_INVALID" => {
659 ::core::option::Option::Some(Self::LTC_WITHDRAWAL_DESTINATION_INVALID)
660 }
661 "SOLANA_WITHDRAWAL_DESTINATION_INVALID" => {
662 ::core::option::Option::Some(Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID)
663 }
664 "XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID" => {
665 ::core::option::Option::Some(
666 Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID,
667 )
668 }
669 "XRP_WITHDRAWAL_DESTINATION_TAG_INVALID" => {
670 ::core::option::Option::Some(
671 Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID,
672 )
673 }
674 "WITHDRAWAL_LIQUIDITY_INSUFFICIENT" => {
675 ::core::option::Option::Some(Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT)
676 }
677 "COMPLIANCE_HIGH_RISK_ADDRESS" => {
678 ::core::option::Option::Some(Self::COMPLIANCE_HIGH_RISK_ADDRESS)
679 }
680 "REQUEST_VERIFICATION_REJECTED" => {
681 ::core::option::Option::Some(Self::REQUEST_VERIFICATION_REJECTED)
682 }
683 "REJECTED" => ::core::option::Option::Some(Self::REJECTED),
684 "ERROR_UNMAPPED" => ::core::option::Option::Some(Self::ERROR_UNMAPPED),
685 "ERROR_NETWORK_UNSUPPORTED" => {
686 ::core::option::Option::Some(Self::ERROR_NETWORK_UNSUPPORTED)
687 }
688 "ERROR_REQUEST_PROCESSING_FAILED" => {
689 ::core::option::Option::Some(Self::ERROR_REQUEST_PROCESSING_FAILED)
690 }
691 "ERROR_REQUEST_VERIFICATION_FAILED" => {
692 ::core::option::Option::Some(Self::ERROR_REQUEST_VERIFICATION_FAILED)
693 }
694 "ERROR_RESULT_SUBMISSION_FAILED" => {
695 ::core::option::Option::Some(Self::ERROR_RESULT_SUBMISSION_FAILED)
696 }
697 "ERROR_STATUS_UNKNOWN" => {
698 ::core::option::Option::Some(Self::ERROR_STATUS_UNKNOWN)
699 }
700 _ => ::core::option::Option::None,
701 }
702 }
703 fn values() -> &'static [Self] {
704 &[
705 Self::REASON_UNSPECIFIED,
706 Self::DEPOSIT_WAIT_EXPIRED,
707 Self::DEPOSIT_AMOUNT_INVALID,
708 Self::DEPOSIT_AMOUNT_BELOW_MINIMUM,
709 Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE,
710 Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM,
711 Self::EVM_DEPOSIT_SOURCE_TX_INVALID,
712 Self::EVM_DEPOSIT_SOURCE_TX_ZERO,
713 Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND,
714 Self::EVM_DEPOSIT_SOURCE_TX_REVERTED,
715 Self::EVM_DEPOSIT_TRANSFER_MISMATCH,
716 Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH,
717 Self::BTC_DEPOSIT_TRANSACTION_MISMATCH,
718 Self::BCH_DEPOSIT_TRANSACTION_MISMATCH,
719 Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH,
720 Self::LTC_DEPOSIT_TRANSACTION_MISMATCH,
721 Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS,
722 Self::SOLANA_DEPOSIT_SIGNATURE_INVALID,
723 Self::SOLANA_DEPOSIT_TRANSACTION_FAILED,
724 Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH,
725 Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID,
726 Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID,
727 Self::XRP_DEPOSIT_ADDRESS_INVALID,
728 Self::XRP_DEPOSIT_PAYMENT_MISMATCH,
729 Self::REJECTION_UNMAPPED,
730 Self::WITHDRAWAL_AMOUNT_INVALID,
731 Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM,
732 Self::WITHDRAWAL_ASSET_INVALID,
733 Self::WITHDRAWAL_SENDER_INVALID,
734 Self::WITHDRAWAL_DESTINATION_INVALID,
735 Self::WITHDRAWAL_ASSET_UNAVAILABLE,
736 Self::EVM_WITHDRAWAL_DESTINATION_INVALID,
737 Self::BTC_WITHDRAWAL_DESTINATION_INVALID,
738 Self::BCH_WITHDRAWAL_DESTINATION_INVALID,
739 Self::DOGE_WITHDRAWAL_DESTINATION_INVALID,
740 Self::LTC_WITHDRAWAL_DESTINATION_INVALID,
741 Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID,
742 Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID,
743 Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID,
744 Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT,
745 Self::COMPLIANCE_HIGH_RISK_ADDRESS,
746 Self::REQUEST_VERIFICATION_REJECTED,
747 Self::REJECTED,
748 Self::ERROR_UNMAPPED,
749 Self::ERROR_NETWORK_UNSUPPORTED,
750 Self::ERROR_REQUEST_PROCESSING_FAILED,
751 Self::ERROR_REQUEST_VERIFICATION_FAILED,
752 Self::ERROR_RESULT_SUBMISSION_FAILED,
753 Self::ERROR_STATUS_UNKNOWN,
754 ]
755 }
756}
757#[derive(Clone, PartialEq, Default)]
759#[derive(::serde::Serialize, ::serde::Deserialize)]
760#[serde(default)]
761pub struct ZipperReasonDetails {
762 #[serde(
766 rename = "code",
767 with = "::buffa::json_helpers::proto_enum",
768 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
769 )]
770 pub code: ::buffa::EnumValue<ZipperReasonCode>,
771 #[serde(
775 rename = "reasonId",
776 alias = "reason_id",
777 with = "::buffa::json_helpers::proto_string",
778 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
779 )]
780 pub reason_id: ::buffa::alloc::string::String,
781 #[serde(
785 rename = "message",
786 with = "::buffa::json_helpers::proto_string",
787 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
788 )]
789 pub message: ::buffa::alloc::string::String,
790 #[serde(skip)]
791 #[doc(hidden)]
792 pub __buffa_unknown_fields: ::buffa::UnknownFields,
793}
794impl ::core::fmt::Debug for ZipperReasonDetails {
795 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
796 f.debug_struct("ZipperReasonDetails")
797 .field("code", &self.code)
798 .field("reason_id", &self.reason_id)
799 .field("message", &self.message)
800 .finish()
801 }
802}
803impl ZipperReasonDetails {
804 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZipperReasonDetails";
809}
810::buffa::impl_default_instance!(ZipperReasonDetails);
811impl ::buffa::MessageName for ZipperReasonDetails {
812 const PACKAGE: &'static str = "chain.zipper.v1";
813 const NAME: &'static str = "ZipperReasonDetails";
814 const FULL_NAME: &'static str = "chain.zipper.v1.ZipperReasonDetails";
815 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZipperReasonDetails";
816}
817impl ::buffa::Message for ZipperReasonDetails {
818 #[allow(clippy::let_and_return)]
824 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
825 #[allow(unused_imports)]
826 use ::buffa::Enumeration as _;
827 let mut size = 0u32;
828 {
829 let val = self.code.to_i32();
830 if val != 0 {
831 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
832 }
833 }
834 if !self.reason_id.is_empty() {
835 size += 1u32 + ::buffa::types::string_encoded_len(&self.reason_id) as u32;
836 }
837 if !self.message.is_empty() {
838 size += 1u32 + ::buffa::types::string_encoded_len(&self.message) as u32;
839 }
840 size += self.__buffa_unknown_fields.encoded_len() as u32;
841 size
842 }
843 fn write_to(
844 &self,
845 _cache: &mut ::buffa::SizeCache,
846 buf: &mut impl ::buffa::bytes::BufMut,
847 ) {
848 #[allow(unused_imports)]
849 use ::buffa::Enumeration as _;
850 {
851 let val = self.code.to_i32();
852 if val != 0 {
853 ::buffa::types::put_int32_field(1u32, val, buf);
854 }
855 }
856 if !self.reason_id.is_empty() {
857 ::buffa::types::put_string_field(2u32, &self.reason_id, buf);
858 }
859 if !self.message.is_empty() {
860 ::buffa::types::put_string_field(3u32, &self.message, buf);
861 }
862 self.__buffa_unknown_fields.write_to(buf);
863 }
864 fn merge_field(
865 &mut self,
866 tag: ::buffa::encoding::Tag,
867 buf: &mut impl ::buffa::bytes::Buf,
868 ctx: ::buffa::DecodeContext<'_>,
869 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
870 #[allow(unused_imports)]
871 use ::buffa::bytes::Buf as _;
872 #[allow(unused_imports)]
873 use ::buffa::Enumeration as _;
874 match tag.field_number() {
875 1u32 => {
876 ::buffa::encoding::check_wire_type(
877 tag,
878 ::buffa::encoding::WireType::Varint,
879 )?;
880 self.code = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
881 }
882 2u32 => {
883 ::buffa::encoding::check_wire_type(
884 tag,
885 ::buffa::encoding::WireType::LengthDelimited,
886 )?;
887 ::buffa::types::merge_string(&mut self.reason_id, buf)?;
888 }
889 3u32 => {
890 ::buffa::encoding::check_wire_type(
891 tag,
892 ::buffa::encoding::WireType::LengthDelimited,
893 )?;
894 ::buffa::types::merge_string(&mut self.message, buf)?;
895 }
896 _ => {
897 self.__buffa_unknown_fields
898 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
899 }
900 }
901 ::core::result::Result::Ok(())
902 }
903 fn clear(&mut self) {
904 self.code = ::buffa::EnumValue::from(0);
905 self.reason_id.clear();
906 self.message.clear();
907 self.__buffa_unknown_fields.clear();
908 }
909}
910impl ::buffa::ExtensionSet for ZipperReasonDetails {
911 const PROTO_FQN: &'static str = "chain.zipper.v1.ZipperReasonDetails";
912 fn unknown_fields(&self) -> &::buffa::UnknownFields {
913 &self.__buffa_unknown_fields
914 }
915 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
916 &mut self.__buffa_unknown_fields
917 }
918}
919impl ::buffa::json_helpers::ProtoElemJson for ZipperReasonDetails {
920 fn serialize_proto_json<S: ::serde::Serializer>(
921 v: &Self,
922 s: S,
923 ) -> ::core::result::Result<S::Ok, S::Error> {
924 ::serde::Serialize::serialize(v, s)
925 }
926 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
927 d: D,
928 ) -> ::core::result::Result<Self, D::Error> {
929 <Self as ::serde::Deserialize>::deserialize(d)
930 }
931}
932#[doc(hidden)]
933pub const __ZIPPER_REASON_DETAILS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
934 type_url: "type.googleapis.com/chain.zipper.v1.ZipperReasonDetails",
935 to_json: ::buffa::type_registry::any_to_json::<ZipperReasonDetails>,
936 from_json: ::buffa::type_registry::any_from_json::<ZipperReasonDetails>,
937 is_wkt: false,
938};
939#[derive(Clone, PartialEq, Default)]
941#[derive(::serde::Serialize, ::serde::Deserialize)]
942#[serde(default)]
943pub struct ChainConfig {
944 #[serde(
948 rename = "chainId",
949 alias = "chain_id",
950 with = "::buffa::json_helpers::uint32",
951 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
952 )]
953 pub chain_id: u32,
954 #[serde(
958 rename = "code",
959 with = "::buffa::json_helpers::proto_string",
960 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
961 )]
962 pub code: ::buffa::alloc::string::String,
963 #[serde(
967 rename = "name",
968 with = "::buffa::json_helpers::proto_string",
969 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
970 )]
971 pub name: ::buffa::alloc::string::String,
972 #[serde(
978 rename = "nativeChainId",
979 alias = "native_chain_id",
980 with = "::buffa::json_helpers::proto_string",
981 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
982 )]
983 pub native_chain_id: ::buffa::alloc::string::String,
984 #[serde(
988 rename = "nativeCurrencySymbol",
989 alias = "native_currency_symbol",
990 with = "::buffa::json_helpers::proto_string",
991 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
992 )]
993 pub native_currency_symbol: ::buffa::alloc::string::String,
994 #[serde(
998 rename = "explorerUrl",
999 alias = "explorer_url",
1000 with = "::buffa::json_helpers::proto_string",
1001 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1002 )]
1003 pub explorer_url: ::buffa::alloc::string::String,
1004 #[serde(
1008 rename = "icon",
1009 with = "::buffa::json_helpers::proto_string",
1010 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1011 )]
1012 pub icon: ::buffa::alloc::string::String,
1013 #[serde(
1017 rename = "requiredConfirmations",
1018 alias = "required_confirmations",
1019 with = "::buffa::json_helpers::uint32",
1020 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1021 )]
1022 pub required_confirmations: u32,
1023 #[serde(
1027 rename = "confirmationTimeSeconds",
1028 alias = "confirmation_time_seconds",
1029 with = "::buffa::json_helpers::uint32",
1030 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1031 )]
1032 pub confirmation_time_seconds: u32,
1033 #[serde(
1037 rename = "isCaseSensitive",
1038 alias = "is_case_sensitive",
1039 with = "::buffa::json_helpers::proto_bool",
1040 skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
1041 )]
1042 pub is_case_sensitive: bool,
1043 #[serde(
1047 rename = "minAddressLength",
1048 alias = "min_address_length",
1049 with = "::buffa::json_helpers::uint32",
1050 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1051 )]
1052 pub min_address_length: u32,
1053 #[serde(
1057 rename = "maxAddressLength",
1058 alias = "max_address_length",
1059 with = "::buffa::json_helpers::uint32",
1060 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1061 )]
1062 pub max_address_length: u32,
1063 #[serde(skip)]
1064 #[doc(hidden)]
1065 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1066}
1067impl ::core::fmt::Debug for ChainConfig {
1068 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1069 f.debug_struct("ChainConfig")
1070 .field("chain_id", &self.chain_id)
1071 .field("code", &self.code)
1072 .field("name", &self.name)
1073 .field("native_chain_id", &self.native_chain_id)
1074 .field("native_currency_symbol", &self.native_currency_symbol)
1075 .field("explorer_url", &self.explorer_url)
1076 .field("icon", &self.icon)
1077 .field("required_confirmations", &self.required_confirmations)
1078 .field("confirmation_time_seconds", &self.confirmation_time_seconds)
1079 .field("is_case_sensitive", &self.is_case_sensitive)
1080 .field("min_address_length", &self.min_address_length)
1081 .field("max_address_length", &self.max_address_length)
1082 .finish()
1083 }
1084}
1085impl ChainConfig {
1086 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainConfig";
1091}
1092::buffa::impl_default_instance!(ChainConfig);
1093impl ::buffa::MessageName for ChainConfig {
1094 const PACKAGE: &'static str = "chain.zipper.v1";
1095 const NAME: &'static str = "ChainConfig";
1096 const FULL_NAME: &'static str = "chain.zipper.v1.ChainConfig";
1097 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainConfig";
1098}
1099impl ::buffa::Message for ChainConfig {
1100 #[allow(clippy::let_and_return)]
1106 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1107 #[allow(unused_imports)]
1108 use ::buffa::Enumeration as _;
1109 let mut size = 0u32;
1110 if self.chain_id != 0u32 {
1111 size += 1u32 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
1112 }
1113 if !self.code.is_empty() {
1114 size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
1115 }
1116 if !self.name.is_empty() {
1117 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1118 }
1119 if !self.native_chain_id.is_empty() {
1120 size
1121 += 1u32
1122 + ::buffa::types::string_encoded_len(&self.native_chain_id) as u32;
1123 }
1124 if !self.native_currency_symbol.is_empty() {
1125 size
1126 += 1u32
1127 + ::buffa::types::string_encoded_len(&self.native_currency_symbol)
1128 as u32;
1129 }
1130 if !self.explorer_url.is_empty() {
1131 size += 1u32 + ::buffa::types::string_encoded_len(&self.explorer_url) as u32;
1132 }
1133 if !self.icon.is_empty() {
1134 size += 1u32 + ::buffa::types::string_encoded_len(&self.icon) as u32;
1135 }
1136 if self.required_confirmations != 0u32 {
1137 size
1138 += 1u32
1139 + ::buffa::types::uint32_encoded_len(self.required_confirmations)
1140 as u32;
1141 }
1142 if self.confirmation_time_seconds != 0u32 {
1143 size
1144 += 1u32
1145 + ::buffa::types::uint32_encoded_len(self.confirmation_time_seconds)
1146 as u32;
1147 }
1148 if self.is_case_sensitive {
1149 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1150 }
1151 if self.min_address_length != 0u32 {
1152 size
1153 += 1u32
1154 + ::buffa::types::uint32_encoded_len(self.min_address_length) as u32;
1155 }
1156 if self.max_address_length != 0u32 {
1157 size
1158 += 1u32
1159 + ::buffa::types::uint32_encoded_len(self.max_address_length) as u32;
1160 }
1161 size += self.__buffa_unknown_fields.encoded_len() as u32;
1162 size
1163 }
1164 fn write_to(
1165 &self,
1166 _cache: &mut ::buffa::SizeCache,
1167 buf: &mut impl ::buffa::bytes::BufMut,
1168 ) {
1169 #[allow(unused_imports)]
1170 use ::buffa::Enumeration as _;
1171 if self.chain_id != 0u32 {
1172 ::buffa::types::put_uint32_field(1u32, self.chain_id, buf);
1173 }
1174 if !self.code.is_empty() {
1175 ::buffa::types::put_string_field(2u32, &self.code, buf);
1176 }
1177 if !self.name.is_empty() {
1178 ::buffa::types::put_string_field(3u32, &self.name, buf);
1179 }
1180 if !self.native_chain_id.is_empty() {
1181 ::buffa::types::put_string_field(4u32, &self.native_chain_id, buf);
1182 }
1183 if !self.native_currency_symbol.is_empty() {
1184 ::buffa::types::put_string_field(5u32, &self.native_currency_symbol, buf);
1185 }
1186 if !self.explorer_url.is_empty() {
1187 ::buffa::types::put_string_field(6u32, &self.explorer_url, buf);
1188 }
1189 if !self.icon.is_empty() {
1190 ::buffa::types::put_string_field(7u32, &self.icon, buf);
1191 }
1192 if self.required_confirmations != 0u32 {
1193 ::buffa::types::put_uint32_field(8u32, self.required_confirmations, buf);
1194 }
1195 if self.confirmation_time_seconds != 0u32 {
1196 ::buffa::types::put_uint32_field(9u32, self.confirmation_time_seconds, buf);
1197 }
1198 if self.is_case_sensitive {
1199 ::buffa::types::put_bool_field(10u32, self.is_case_sensitive, buf);
1200 }
1201 if self.min_address_length != 0u32 {
1202 ::buffa::types::put_uint32_field(11u32, self.min_address_length, buf);
1203 }
1204 if self.max_address_length != 0u32 {
1205 ::buffa::types::put_uint32_field(12u32, self.max_address_length, buf);
1206 }
1207 self.__buffa_unknown_fields.write_to(buf);
1208 }
1209 fn merge_field(
1210 &mut self,
1211 tag: ::buffa::encoding::Tag,
1212 buf: &mut impl ::buffa::bytes::Buf,
1213 ctx: ::buffa::DecodeContext<'_>,
1214 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1215 #[allow(unused_imports)]
1216 use ::buffa::bytes::Buf as _;
1217 #[allow(unused_imports)]
1218 use ::buffa::Enumeration as _;
1219 match tag.field_number() {
1220 1u32 => {
1221 ::buffa::encoding::check_wire_type(
1222 tag,
1223 ::buffa::encoding::WireType::Varint,
1224 )?;
1225 self.chain_id = ::buffa::types::decode_uint32(buf)?;
1226 }
1227 2u32 => {
1228 ::buffa::encoding::check_wire_type(
1229 tag,
1230 ::buffa::encoding::WireType::LengthDelimited,
1231 )?;
1232 ::buffa::types::merge_string(&mut self.code, buf)?;
1233 }
1234 3u32 => {
1235 ::buffa::encoding::check_wire_type(
1236 tag,
1237 ::buffa::encoding::WireType::LengthDelimited,
1238 )?;
1239 ::buffa::types::merge_string(&mut self.name, buf)?;
1240 }
1241 4u32 => {
1242 ::buffa::encoding::check_wire_type(
1243 tag,
1244 ::buffa::encoding::WireType::LengthDelimited,
1245 )?;
1246 ::buffa::types::merge_string(&mut self.native_chain_id, buf)?;
1247 }
1248 5u32 => {
1249 ::buffa::encoding::check_wire_type(
1250 tag,
1251 ::buffa::encoding::WireType::LengthDelimited,
1252 )?;
1253 ::buffa::types::merge_string(&mut self.native_currency_symbol, buf)?;
1254 }
1255 6u32 => {
1256 ::buffa::encoding::check_wire_type(
1257 tag,
1258 ::buffa::encoding::WireType::LengthDelimited,
1259 )?;
1260 ::buffa::types::merge_string(&mut self.explorer_url, buf)?;
1261 }
1262 7u32 => {
1263 ::buffa::encoding::check_wire_type(
1264 tag,
1265 ::buffa::encoding::WireType::LengthDelimited,
1266 )?;
1267 ::buffa::types::merge_string(&mut self.icon, buf)?;
1268 }
1269 8u32 => {
1270 ::buffa::encoding::check_wire_type(
1271 tag,
1272 ::buffa::encoding::WireType::Varint,
1273 )?;
1274 self.required_confirmations = ::buffa::types::decode_uint32(buf)?;
1275 }
1276 9u32 => {
1277 ::buffa::encoding::check_wire_type(
1278 tag,
1279 ::buffa::encoding::WireType::Varint,
1280 )?;
1281 self.confirmation_time_seconds = ::buffa::types::decode_uint32(buf)?;
1282 }
1283 10u32 => {
1284 ::buffa::encoding::check_wire_type(
1285 tag,
1286 ::buffa::encoding::WireType::Varint,
1287 )?;
1288 self.is_case_sensitive = ::buffa::types::decode_bool(buf)?;
1289 }
1290 11u32 => {
1291 ::buffa::encoding::check_wire_type(
1292 tag,
1293 ::buffa::encoding::WireType::Varint,
1294 )?;
1295 self.min_address_length = ::buffa::types::decode_uint32(buf)?;
1296 }
1297 12u32 => {
1298 ::buffa::encoding::check_wire_type(
1299 tag,
1300 ::buffa::encoding::WireType::Varint,
1301 )?;
1302 self.max_address_length = ::buffa::types::decode_uint32(buf)?;
1303 }
1304 _ => {
1305 self.__buffa_unknown_fields
1306 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1307 }
1308 }
1309 ::core::result::Result::Ok(())
1310 }
1311 fn clear(&mut self) {
1312 self.chain_id = 0u32;
1313 self.code.clear();
1314 self.name.clear();
1315 self.native_chain_id.clear();
1316 self.native_currency_symbol.clear();
1317 self.explorer_url.clear();
1318 self.icon.clear();
1319 self.required_confirmations = 0u32;
1320 self.confirmation_time_seconds = 0u32;
1321 self.is_case_sensitive = false;
1322 self.min_address_length = 0u32;
1323 self.max_address_length = 0u32;
1324 self.__buffa_unknown_fields.clear();
1325 }
1326}
1327impl ::buffa::ExtensionSet for ChainConfig {
1328 const PROTO_FQN: &'static str = "chain.zipper.v1.ChainConfig";
1329 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1330 &self.__buffa_unknown_fields
1331 }
1332 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1333 &mut self.__buffa_unknown_fields
1334 }
1335}
1336impl ::buffa::json_helpers::ProtoElemJson for ChainConfig {
1337 fn serialize_proto_json<S: ::serde::Serializer>(
1338 v: &Self,
1339 s: S,
1340 ) -> ::core::result::Result<S::Ok, S::Error> {
1341 ::serde::Serialize::serialize(v, s)
1342 }
1343 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1344 d: D,
1345 ) -> ::core::result::Result<Self, D::Error> {
1346 <Self as ::serde::Deserialize>::deserialize(d)
1347 }
1348}
1349#[doc(hidden)]
1350pub const __CHAIN_CONFIG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1351 type_url: "type.googleapis.com/chain.zipper.v1.ChainConfig",
1352 to_json: ::buffa::type_registry::any_to_json::<ChainConfig>,
1353 from_json: ::buffa::type_registry::any_from_json::<ChainConfig>,
1354 is_wkt: false,
1355};
1356#[derive(Clone, PartialEq, Default)]
1359#[derive(::serde::Serialize, ::serde::Deserialize)]
1360#[serde(default)]
1361pub struct AssetChainVariant {
1362 #[serde(
1366 rename = "zippedAssetId",
1367 alias = "zipped_asset_id",
1368 with = "::buffa::json_helpers::uint32",
1369 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1370 )]
1371 pub zipped_asset_id: u32,
1372 #[serde(
1376 rename = "chainId",
1377 alias = "chain_id",
1378 with = "::buffa::json_helpers::uint32",
1379 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1380 )]
1381 pub chain_id: u32,
1382 #[serde(
1386 rename = "isNativeAsset",
1387 alias = "is_native_asset",
1388 with = "::buffa::json_helpers::proto_bool",
1389 skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
1390 )]
1391 pub is_native_asset: bool,
1392 #[serde(
1397 rename = "networkFee",
1398 alias = "network_fee",
1399 with = "::buffa::json_helpers::proto_string",
1400 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1401 )]
1402 pub network_fee: ::buffa::alloc::string::String,
1403 #[serde(
1407 rename = "ztokenAddress",
1408 alias = "ztoken_address",
1409 with = "::buffa::json_helpers::proto_string",
1410 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1411 )]
1412 pub ztoken_address: ::buffa::alloc::string::String,
1413 #[serde(
1417 rename = "sourceAddress",
1418 alias = "source_address",
1419 with = "::buffa::json_helpers::proto_string",
1420 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1421 )]
1422 pub source_address: ::buffa::alloc::string::String,
1423 #[serde(
1427 rename = "sourceDecimals",
1428 alias = "source_decimals",
1429 with = "::buffa::json_helpers::uint32",
1430 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1431 )]
1432 pub source_decimals: u32,
1433 #[serde(
1437 rename = "ztokenDecimals",
1438 alias = "ztoken_decimals",
1439 with = "::buffa::json_helpers::uint32",
1440 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1441 )]
1442 pub ztoken_decimals: u32,
1443 #[serde(
1447 rename = "depositMinAmount",
1448 alias = "deposit_min_amount",
1449 with = "::buffa::json_helpers::proto_string",
1450 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1451 )]
1452 pub deposit_min_amount: ::buffa::alloc::string::String,
1453 #[serde(
1457 rename = "withdrawMinAmount",
1458 alias = "withdraw_min_amount",
1459 with = "::buffa::json_helpers::proto_string",
1460 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1461 )]
1462 pub withdraw_min_amount: ::buffa::alloc::string::String,
1463 #[serde(
1468 rename = "supplyQ",
1469 alias = "supply_q",
1470 with = "::buffa::json_helpers::uint64",
1471 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
1472 )]
1473 pub supply_q: u64,
1474 #[serde(skip)]
1475 #[doc(hidden)]
1476 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1477}
1478impl ::core::fmt::Debug for AssetChainVariant {
1479 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1480 f.debug_struct("AssetChainVariant")
1481 .field("zipped_asset_id", &self.zipped_asset_id)
1482 .field("chain_id", &self.chain_id)
1483 .field("is_native_asset", &self.is_native_asset)
1484 .field("network_fee", &self.network_fee)
1485 .field("ztoken_address", &self.ztoken_address)
1486 .field("source_address", &self.source_address)
1487 .field("source_decimals", &self.source_decimals)
1488 .field("ztoken_decimals", &self.ztoken_decimals)
1489 .field("deposit_min_amount", &self.deposit_min_amount)
1490 .field("withdraw_min_amount", &self.withdraw_min_amount)
1491 .field("supply_q", &self.supply_q)
1492 .finish()
1493 }
1494}
1495impl AssetChainVariant {
1496 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetChainVariant";
1501}
1502::buffa::impl_default_instance!(AssetChainVariant);
1503impl ::buffa::MessageName for AssetChainVariant {
1504 const PACKAGE: &'static str = "chain.zipper.v1";
1505 const NAME: &'static str = "AssetChainVariant";
1506 const FULL_NAME: &'static str = "chain.zipper.v1.AssetChainVariant";
1507 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetChainVariant";
1508}
1509impl ::buffa::Message for AssetChainVariant {
1510 #[allow(clippy::let_and_return)]
1516 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1517 #[allow(unused_imports)]
1518 use ::buffa::Enumeration as _;
1519 let mut size = 0u32;
1520 if self.zipped_asset_id != 0u32 {
1521 size
1522 += 1u32
1523 + ::buffa::types::uint32_encoded_len(self.zipped_asset_id) as u32;
1524 }
1525 if self.chain_id != 0u32 {
1526 size += 1u32 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
1527 }
1528 if self.is_native_asset {
1529 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1530 }
1531 if !self.network_fee.is_empty() {
1532 size += 1u32 + ::buffa::types::string_encoded_len(&self.network_fee) as u32;
1533 }
1534 if !self.ztoken_address.is_empty() {
1535 size
1536 += 1u32
1537 + ::buffa::types::string_encoded_len(&self.ztoken_address) as u32;
1538 }
1539 if !self.source_address.is_empty() {
1540 size
1541 += 1u32
1542 + ::buffa::types::string_encoded_len(&self.source_address) as u32;
1543 }
1544 if self.source_decimals != 0u32 {
1545 size
1546 += 1u32
1547 + ::buffa::types::uint32_encoded_len(self.source_decimals) as u32;
1548 }
1549 if self.ztoken_decimals != 0u32 {
1550 size
1551 += 1u32
1552 + ::buffa::types::uint32_encoded_len(self.ztoken_decimals) as u32;
1553 }
1554 if !self.deposit_min_amount.is_empty() {
1555 size
1556 += 1u32
1557 + ::buffa::types::string_encoded_len(&self.deposit_min_amount)
1558 as u32;
1559 }
1560 if !self.withdraw_min_amount.is_empty() {
1561 size
1562 += 1u32
1563 + ::buffa::types::string_encoded_len(&self.withdraw_min_amount)
1564 as u32;
1565 }
1566 if self.supply_q != 0u64 {
1567 size += 1u32 + ::buffa::types::uint64_encoded_len(self.supply_q) as u32;
1568 }
1569 size += self.__buffa_unknown_fields.encoded_len() as u32;
1570 size
1571 }
1572 fn write_to(
1573 &self,
1574 _cache: &mut ::buffa::SizeCache,
1575 buf: &mut impl ::buffa::bytes::BufMut,
1576 ) {
1577 #[allow(unused_imports)]
1578 use ::buffa::Enumeration as _;
1579 if self.zipped_asset_id != 0u32 {
1580 ::buffa::types::put_uint32_field(1u32, self.zipped_asset_id, buf);
1581 }
1582 if self.chain_id != 0u32 {
1583 ::buffa::types::put_uint32_field(2u32, self.chain_id, buf);
1584 }
1585 if self.is_native_asset {
1586 ::buffa::types::put_bool_field(3u32, self.is_native_asset, buf);
1587 }
1588 if !self.network_fee.is_empty() {
1589 ::buffa::types::put_string_field(4u32, &self.network_fee, buf);
1590 }
1591 if !self.ztoken_address.is_empty() {
1592 ::buffa::types::put_string_field(6u32, &self.ztoken_address, buf);
1593 }
1594 if !self.source_address.is_empty() {
1595 ::buffa::types::put_string_field(7u32, &self.source_address, buf);
1596 }
1597 if self.source_decimals != 0u32 {
1598 ::buffa::types::put_uint32_field(8u32, self.source_decimals, buf);
1599 }
1600 if self.ztoken_decimals != 0u32 {
1601 ::buffa::types::put_uint32_field(9u32, self.ztoken_decimals, buf);
1602 }
1603 if !self.deposit_min_amount.is_empty() {
1604 ::buffa::types::put_string_field(10u32, &self.deposit_min_amount, buf);
1605 }
1606 if !self.withdraw_min_amount.is_empty() {
1607 ::buffa::types::put_string_field(11u32, &self.withdraw_min_amount, buf);
1608 }
1609 if self.supply_q != 0u64 {
1610 ::buffa::types::put_uint64_field(12u32, self.supply_q, buf);
1611 }
1612 self.__buffa_unknown_fields.write_to(buf);
1613 }
1614 fn merge_field(
1615 &mut self,
1616 tag: ::buffa::encoding::Tag,
1617 buf: &mut impl ::buffa::bytes::Buf,
1618 ctx: ::buffa::DecodeContext<'_>,
1619 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1620 #[allow(unused_imports)]
1621 use ::buffa::bytes::Buf as _;
1622 #[allow(unused_imports)]
1623 use ::buffa::Enumeration as _;
1624 match tag.field_number() {
1625 1u32 => {
1626 ::buffa::encoding::check_wire_type(
1627 tag,
1628 ::buffa::encoding::WireType::Varint,
1629 )?;
1630 self.zipped_asset_id = ::buffa::types::decode_uint32(buf)?;
1631 }
1632 2u32 => {
1633 ::buffa::encoding::check_wire_type(
1634 tag,
1635 ::buffa::encoding::WireType::Varint,
1636 )?;
1637 self.chain_id = ::buffa::types::decode_uint32(buf)?;
1638 }
1639 3u32 => {
1640 ::buffa::encoding::check_wire_type(
1641 tag,
1642 ::buffa::encoding::WireType::Varint,
1643 )?;
1644 self.is_native_asset = ::buffa::types::decode_bool(buf)?;
1645 }
1646 4u32 => {
1647 ::buffa::encoding::check_wire_type(
1648 tag,
1649 ::buffa::encoding::WireType::LengthDelimited,
1650 )?;
1651 ::buffa::types::merge_string(&mut self.network_fee, buf)?;
1652 }
1653 6u32 => {
1654 ::buffa::encoding::check_wire_type(
1655 tag,
1656 ::buffa::encoding::WireType::LengthDelimited,
1657 )?;
1658 ::buffa::types::merge_string(&mut self.ztoken_address, buf)?;
1659 }
1660 7u32 => {
1661 ::buffa::encoding::check_wire_type(
1662 tag,
1663 ::buffa::encoding::WireType::LengthDelimited,
1664 )?;
1665 ::buffa::types::merge_string(&mut self.source_address, buf)?;
1666 }
1667 8u32 => {
1668 ::buffa::encoding::check_wire_type(
1669 tag,
1670 ::buffa::encoding::WireType::Varint,
1671 )?;
1672 self.source_decimals = ::buffa::types::decode_uint32(buf)?;
1673 }
1674 9u32 => {
1675 ::buffa::encoding::check_wire_type(
1676 tag,
1677 ::buffa::encoding::WireType::Varint,
1678 )?;
1679 self.ztoken_decimals = ::buffa::types::decode_uint32(buf)?;
1680 }
1681 10u32 => {
1682 ::buffa::encoding::check_wire_type(
1683 tag,
1684 ::buffa::encoding::WireType::LengthDelimited,
1685 )?;
1686 ::buffa::types::merge_string(&mut self.deposit_min_amount, buf)?;
1687 }
1688 11u32 => {
1689 ::buffa::encoding::check_wire_type(
1690 tag,
1691 ::buffa::encoding::WireType::LengthDelimited,
1692 )?;
1693 ::buffa::types::merge_string(&mut self.withdraw_min_amount, buf)?;
1694 }
1695 12u32 => {
1696 ::buffa::encoding::check_wire_type(
1697 tag,
1698 ::buffa::encoding::WireType::Varint,
1699 )?;
1700 self.supply_q = ::buffa::types::decode_uint64(buf)?;
1701 }
1702 _ => {
1703 self.__buffa_unknown_fields
1704 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1705 }
1706 }
1707 ::core::result::Result::Ok(())
1708 }
1709 fn clear(&mut self) {
1710 self.zipped_asset_id = 0u32;
1711 self.chain_id = 0u32;
1712 self.is_native_asset = false;
1713 self.network_fee.clear();
1714 self.ztoken_address.clear();
1715 self.source_address.clear();
1716 self.source_decimals = 0u32;
1717 self.ztoken_decimals = 0u32;
1718 self.deposit_min_amount.clear();
1719 self.withdraw_min_amount.clear();
1720 self.supply_q = 0u64;
1721 self.__buffa_unknown_fields.clear();
1722 }
1723}
1724impl ::buffa::ExtensionSet for AssetChainVariant {
1725 const PROTO_FQN: &'static str = "chain.zipper.v1.AssetChainVariant";
1726 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1727 &self.__buffa_unknown_fields
1728 }
1729 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1730 &mut self.__buffa_unknown_fields
1731 }
1732}
1733impl ::buffa::json_helpers::ProtoElemJson for AssetChainVariant {
1734 fn serialize_proto_json<S: ::serde::Serializer>(
1735 v: &Self,
1736 s: S,
1737 ) -> ::core::result::Result<S::Ok, S::Error> {
1738 ::serde::Serialize::serialize(v, s)
1739 }
1740 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1741 d: D,
1742 ) -> ::core::result::Result<Self, D::Error> {
1743 <Self as ::serde::Deserialize>::deserialize(d)
1744 }
1745}
1746#[doc(hidden)]
1747pub const __ASSET_CHAIN_VARIANT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1748 type_url: "type.googleapis.com/chain.zipper.v1.AssetChainVariant",
1749 to_json: ::buffa::type_registry::any_to_json::<AssetChainVariant>,
1750 from_json: ::buffa::type_registry::any_from_json::<AssetChainVariant>,
1751 is_wkt: false,
1752};
1753#[derive(Clone, PartialEq, Default)]
1756#[derive(::serde::Serialize, ::serde::Deserialize)]
1757#[serde(default)]
1758pub struct ZippedAssetSupplyUpdate {
1759 #[serde(
1763 rename = "zippedAssetId",
1764 alias = "zipped_asset_id",
1765 with = "::buffa::json_helpers::uint32",
1766 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
1767 )]
1768 pub zipped_asset_id: u32,
1769 #[serde(
1774 rename = "supplyQ",
1775 alias = "supply_q",
1776 with = "::buffa::json_helpers::uint64",
1777 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
1778 )]
1779 pub supply_q: u64,
1780 #[serde(skip)]
1781 #[doc(hidden)]
1782 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1783}
1784impl ::core::fmt::Debug for ZippedAssetSupplyUpdate {
1785 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1786 f.debug_struct("ZippedAssetSupplyUpdate")
1787 .field("zipped_asset_id", &self.zipped_asset_id)
1788 .field("supply_q", &self.supply_q)
1789 .finish()
1790 }
1791}
1792impl ZippedAssetSupplyUpdate {
1793 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyUpdate";
1798}
1799::buffa::impl_default_instance!(ZippedAssetSupplyUpdate);
1800impl ::buffa::MessageName for ZippedAssetSupplyUpdate {
1801 const PACKAGE: &'static str = "chain.zipper.v1";
1802 const NAME: &'static str = "ZippedAssetSupplyUpdate";
1803 const FULL_NAME: &'static str = "chain.zipper.v1.ZippedAssetSupplyUpdate";
1804 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyUpdate";
1805}
1806impl ::buffa::Message for ZippedAssetSupplyUpdate {
1807 #[allow(clippy::let_and_return)]
1813 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1814 #[allow(unused_imports)]
1815 use ::buffa::Enumeration as _;
1816 let mut size = 0u32;
1817 if self.zipped_asset_id != 0u32 {
1818 size
1819 += 1u32
1820 + ::buffa::types::uint32_encoded_len(self.zipped_asset_id) as u32;
1821 }
1822 if self.supply_q != 0u64 {
1823 size += 1u32 + ::buffa::types::uint64_encoded_len(self.supply_q) as u32;
1824 }
1825 size += self.__buffa_unknown_fields.encoded_len() as u32;
1826 size
1827 }
1828 fn write_to(
1829 &self,
1830 _cache: &mut ::buffa::SizeCache,
1831 buf: &mut impl ::buffa::bytes::BufMut,
1832 ) {
1833 #[allow(unused_imports)]
1834 use ::buffa::Enumeration as _;
1835 if self.zipped_asset_id != 0u32 {
1836 ::buffa::types::put_uint32_field(1u32, self.zipped_asset_id, buf);
1837 }
1838 if self.supply_q != 0u64 {
1839 ::buffa::types::put_uint64_field(2u32, self.supply_q, buf);
1840 }
1841 self.__buffa_unknown_fields.write_to(buf);
1842 }
1843 fn merge_field(
1844 &mut self,
1845 tag: ::buffa::encoding::Tag,
1846 buf: &mut impl ::buffa::bytes::Buf,
1847 ctx: ::buffa::DecodeContext<'_>,
1848 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1849 #[allow(unused_imports)]
1850 use ::buffa::bytes::Buf as _;
1851 #[allow(unused_imports)]
1852 use ::buffa::Enumeration as _;
1853 match tag.field_number() {
1854 1u32 => {
1855 ::buffa::encoding::check_wire_type(
1856 tag,
1857 ::buffa::encoding::WireType::Varint,
1858 )?;
1859 self.zipped_asset_id = ::buffa::types::decode_uint32(buf)?;
1860 }
1861 2u32 => {
1862 ::buffa::encoding::check_wire_type(
1863 tag,
1864 ::buffa::encoding::WireType::Varint,
1865 )?;
1866 self.supply_q = ::buffa::types::decode_uint64(buf)?;
1867 }
1868 _ => {
1869 self.__buffa_unknown_fields
1870 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1871 }
1872 }
1873 ::core::result::Result::Ok(())
1874 }
1875 fn clear(&mut self) {
1876 self.zipped_asset_id = 0u32;
1877 self.supply_q = 0u64;
1878 self.__buffa_unknown_fields.clear();
1879 }
1880}
1881impl ::buffa::ExtensionSet for ZippedAssetSupplyUpdate {
1882 const PROTO_FQN: &'static str = "chain.zipper.v1.ZippedAssetSupplyUpdate";
1883 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1884 &self.__buffa_unknown_fields
1885 }
1886 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1887 &mut self.__buffa_unknown_fields
1888 }
1889}
1890impl ::buffa::json_helpers::ProtoElemJson for ZippedAssetSupplyUpdate {
1891 fn serialize_proto_json<S: ::serde::Serializer>(
1892 v: &Self,
1893 s: S,
1894 ) -> ::core::result::Result<S::Ok, S::Error> {
1895 ::serde::Serialize::serialize(v, s)
1896 }
1897 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1898 d: D,
1899 ) -> ::core::result::Result<Self, D::Error> {
1900 <Self as ::serde::Deserialize>::deserialize(d)
1901 }
1902}
1903#[doc(hidden)]
1904pub const __ZIPPED_ASSET_SUPPLY_UPDATE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1905 type_url: "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyUpdate",
1906 to_json: ::buffa::type_registry::any_to_json::<ZippedAssetSupplyUpdate>,
1907 from_json: ::buffa::type_registry::any_from_json::<ZippedAssetSupplyUpdate>,
1908 is_wkt: false,
1909};
1910#[derive(Clone, PartialEq, Default)]
1912#[derive(::serde::Serialize, ::serde::Deserialize)]
1913#[serde(default)]
1914pub struct ZippedAssetSupplyBatch {
1915 #[serde(
1919 rename = "updates",
1920 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1921 deserialize_with = "::buffa::json_helpers::null_as_default"
1922 )]
1923 pub updates: ::buffa::alloc::vec::Vec<ZippedAssetSupplyUpdate>,
1924 #[serde(skip)]
1925 #[doc(hidden)]
1926 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1927}
1928impl ::core::fmt::Debug for ZippedAssetSupplyBatch {
1929 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1930 f.debug_struct("ZippedAssetSupplyBatch").field("updates", &self.updates).finish()
1931 }
1932}
1933impl ZippedAssetSupplyBatch {
1934 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyBatch";
1939}
1940::buffa::impl_default_instance!(ZippedAssetSupplyBatch);
1941impl ::buffa::MessageName for ZippedAssetSupplyBatch {
1942 const PACKAGE: &'static str = "chain.zipper.v1";
1943 const NAME: &'static str = "ZippedAssetSupplyBatch";
1944 const FULL_NAME: &'static str = "chain.zipper.v1.ZippedAssetSupplyBatch";
1945 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyBatch";
1946}
1947impl ::buffa::Message for ZippedAssetSupplyBatch {
1948 #[allow(clippy::let_and_return)]
1954 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1955 #[allow(unused_imports)]
1956 use ::buffa::Enumeration as _;
1957 let mut size = 0u32;
1958 for v in &self.updates {
1959 let __slot = __cache.reserve();
1960 let inner_size = v.compute_size(__cache);
1961 __cache.set(__slot, inner_size);
1962 size
1963 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1964 + inner_size;
1965 }
1966 size += self.__buffa_unknown_fields.encoded_len() as u32;
1967 size
1968 }
1969 fn write_to(
1970 &self,
1971 __cache: &mut ::buffa::SizeCache,
1972 buf: &mut impl ::buffa::bytes::BufMut,
1973 ) {
1974 #[allow(unused_imports)]
1975 use ::buffa::Enumeration as _;
1976 for v in &self.updates {
1977 ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
1978 v.write_to(__cache, buf);
1979 }
1980 self.__buffa_unknown_fields.write_to(buf);
1981 }
1982 fn merge_field(
1983 &mut self,
1984 tag: ::buffa::encoding::Tag,
1985 buf: &mut impl ::buffa::bytes::Buf,
1986 ctx: ::buffa::DecodeContext<'_>,
1987 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1988 #[allow(unused_imports)]
1989 use ::buffa::bytes::Buf as _;
1990 #[allow(unused_imports)]
1991 use ::buffa::Enumeration as _;
1992 match tag.field_number() {
1993 1u32 => {
1994 ::buffa::encoding::check_wire_type(
1995 tag,
1996 ::buffa::encoding::WireType::LengthDelimited,
1997 )?;
1998 let mut elem = ::core::default::Default::default();
1999 ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2000 self.updates.push(elem);
2001 }
2002 _ => {
2003 self.__buffa_unknown_fields
2004 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2005 }
2006 }
2007 ::core::result::Result::Ok(())
2008 }
2009 fn clear(&mut self) {
2010 self.updates.clear();
2011 self.__buffa_unknown_fields.clear();
2012 }
2013}
2014impl ::buffa::ExtensionSet for ZippedAssetSupplyBatch {
2015 const PROTO_FQN: &'static str = "chain.zipper.v1.ZippedAssetSupplyBatch";
2016 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2017 &self.__buffa_unknown_fields
2018 }
2019 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2020 &mut self.__buffa_unknown_fields
2021 }
2022}
2023impl ::buffa::json_helpers::ProtoElemJson for ZippedAssetSupplyBatch {
2024 fn serialize_proto_json<S: ::serde::Serializer>(
2025 v: &Self,
2026 s: S,
2027 ) -> ::core::result::Result<S::Ok, S::Error> {
2028 ::serde::Serialize::serialize(v, s)
2029 }
2030 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2031 d: D,
2032 ) -> ::core::result::Result<Self, D::Error> {
2033 <Self as ::serde::Deserialize>::deserialize(d)
2034 }
2035}
2036#[doc(hidden)]
2037pub const __ZIPPED_ASSET_SUPPLY_BATCH_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2038 type_url: "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyBatch",
2039 to_json: ::buffa::type_registry::any_to_json::<ZippedAssetSupplyBatch>,
2040 from_json: ::buffa::type_registry::any_from_json::<ZippedAssetSupplyBatch>,
2041 is_wkt: false,
2042};
2043#[derive(Clone, PartialEq, Default)]
2046#[derive(::serde::Serialize, ::serde::Deserialize)]
2047#[serde(default)]
2048pub struct AssetConfig {
2049 #[serde(
2053 rename = "asset",
2054 with = "::buffa::json_helpers::proto_string",
2055 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2056 )]
2057 pub asset: ::buffa::alloc::string::String,
2058 #[serde(
2062 rename = "ledgerId",
2063 alias = "ledger_id",
2064 with = "::buffa::json_helpers::uint32",
2065 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2066 )]
2067 pub ledger_id: u32,
2068 #[serde(
2072 rename = "name",
2073 with = "::buffa::json_helpers::proto_string",
2074 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2075 )]
2076 pub name: ::buffa::alloc::string::String,
2077 #[serde(
2081 rename = "icon",
2082 with = "::buffa::json_helpers::proto_string",
2083 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2084 )]
2085 pub icon: ::buffa::alloc::string::String,
2086 #[serde(
2092 rename = "quantityScale",
2093 alias = "quantity_scale",
2094 with = "::buffa::json_helpers::uint32",
2095 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2096 )]
2097 pub quantity_scale: u32,
2098 #[serde(
2102 rename = "quantityDisplayDecimals",
2103 alias = "quantity_display_decimals",
2104 with = "::buffa::json_helpers::uint32",
2105 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2106 )]
2107 pub quantity_display_decimals: u32,
2108 #[serde(
2112 rename = "variants",
2113 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2114 deserialize_with = "::buffa::json_helpers::null_as_default"
2115 )]
2116 pub variants: ::buffa::alloc::vec::Vec<AssetChainVariant>,
2117 #[serde(
2121 rename = "uAssetId",
2122 alias = "u_asset_id",
2123 with = "::buffa::json_helpers::proto_string",
2124 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2125 )]
2126 pub u_asset_id: ::buffa::alloc::string::String,
2127 #[serde(skip)]
2128 #[doc(hidden)]
2129 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2130}
2131impl ::core::fmt::Debug for AssetConfig {
2132 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2133 f.debug_struct("AssetConfig")
2134 .field("asset", &self.asset)
2135 .field("ledger_id", &self.ledger_id)
2136 .field("name", &self.name)
2137 .field("icon", &self.icon)
2138 .field("quantity_scale", &self.quantity_scale)
2139 .field("quantity_display_decimals", &self.quantity_display_decimals)
2140 .field("variants", &self.variants)
2141 .field("u_asset_id", &self.u_asset_id)
2142 .finish()
2143 }
2144}
2145impl AssetConfig {
2146 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetConfig";
2151}
2152::buffa::impl_default_instance!(AssetConfig);
2153impl ::buffa::MessageName for AssetConfig {
2154 const PACKAGE: &'static str = "chain.zipper.v1";
2155 const NAME: &'static str = "AssetConfig";
2156 const FULL_NAME: &'static str = "chain.zipper.v1.AssetConfig";
2157 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetConfig";
2158}
2159impl ::buffa::Message for AssetConfig {
2160 #[allow(clippy::let_and_return)]
2166 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2167 #[allow(unused_imports)]
2168 use ::buffa::Enumeration as _;
2169 let mut size = 0u32;
2170 if !self.asset.is_empty() {
2171 size += 1u32 + ::buffa::types::string_encoded_len(&self.asset) as u32;
2172 }
2173 if self.ledger_id != 0u32 {
2174 size += 1u32 + ::buffa::types::uint32_encoded_len(self.ledger_id) as u32;
2175 }
2176 if !self.name.is_empty() {
2177 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2178 }
2179 if !self.icon.is_empty() {
2180 size += 1u32 + ::buffa::types::string_encoded_len(&self.icon) as u32;
2181 }
2182 if self.quantity_scale != 0u32 {
2183 size
2184 += 1u32 + ::buffa::types::uint32_encoded_len(self.quantity_scale) as u32;
2185 }
2186 if self.quantity_display_decimals != 0u32 {
2187 size
2188 += 1u32
2189 + ::buffa::types::uint32_encoded_len(self.quantity_display_decimals)
2190 as u32;
2191 }
2192 for v in &self.variants {
2193 let __slot = __cache.reserve();
2194 let inner_size = v.compute_size(__cache);
2195 __cache.set(__slot, inner_size);
2196 size
2197 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2198 + inner_size;
2199 }
2200 if !self.u_asset_id.is_empty() {
2201 size += 1u32 + ::buffa::types::string_encoded_len(&self.u_asset_id) as u32;
2202 }
2203 size += self.__buffa_unknown_fields.encoded_len() as u32;
2204 size
2205 }
2206 fn write_to(
2207 &self,
2208 __cache: &mut ::buffa::SizeCache,
2209 buf: &mut impl ::buffa::bytes::BufMut,
2210 ) {
2211 #[allow(unused_imports)]
2212 use ::buffa::Enumeration as _;
2213 if !self.asset.is_empty() {
2214 ::buffa::types::put_string_field(1u32, &self.asset, buf);
2215 }
2216 if self.ledger_id != 0u32 {
2217 ::buffa::types::put_uint32_field(2u32, self.ledger_id, buf);
2218 }
2219 if !self.name.is_empty() {
2220 ::buffa::types::put_string_field(3u32, &self.name, buf);
2221 }
2222 if !self.icon.is_empty() {
2223 ::buffa::types::put_string_field(4u32, &self.icon, buf);
2224 }
2225 if self.quantity_scale != 0u32 {
2226 ::buffa::types::put_uint32_field(5u32, self.quantity_scale, buf);
2227 }
2228 if self.quantity_display_decimals != 0u32 {
2229 ::buffa::types::put_uint32_field(6u32, self.quantity_display_decimals, buf);
2230 }
2231 for v in &self.variants {
2232 ::buffa::types::put_len_delimited_header(7u32, __cache.consume_next(), buf);
2233 v.write_to(__cache, buf);
2234 }
2235 if !self.u_asset_id.is_empty() {
2236 ::buffa::types::put_string_field(8u32, &self.u_asset_id, buf);
2237 }
2238 self.__buffa_unknown_fields.write_to(buf);
2239 }
2240 fn merge_field(
2241 &mut self,
2242 tag: ::buffa::encoding::Tag,
2243 buf: &mut impl ::buffa::bytes::Buf,
2244 ctx: ::buffa::DecodeContext<'_>,
2245 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2246 #[allow(unused_imports)]
2247 use ::buffa::bytes::Buf as _;
2248 #[allow(unused_imports)]
2249 use ::buffa::Enumeration as _;
2250 match tag.field_number() {
2251 1u32 => {
2252 ::buffa::encoding::check_wire_type(
2253 tag,
2254 ::buffa::encoding::WireType::LengthDelimited,
2255 )?;
2256 ::buffa::types::merge_string(&mut self.asset, buf)?;
2257 }
2258 2u32 => {
2259 ::buffa::encoding::check_wire_type(
2260 tag,
2261 ::buffa::encoding::WireType::Varint,
2262 )?;
2263 self.ledger_id = ::buffa::types::decode_uint32(buf)?;
2264 }
2265 3u32 => {
2266 ::buffa::encoding::check_wire_type(
2267 tag,
2268 ::buffa::encoding::WireType::LengthDelimited,
2269 )?;
2270 ::buffa::types::merge_string(&mut self.name, buf)?;
2271 }
2272 4u32 => {
2273 ::buffa::encoding::check_wire_type(
2274 tag,
2275 ::buffa::encoding::WireType::LengthDelimited,
2276 )?;
2277 ::buffa::types::merge_string(&mut self.icon, buf)?;
2278 }
2279 5u32 => {
2280 ::buffa::encoding::check_wire_type(
2281 tag,
2282 ::buffa::encoding::WireType::Varint,
2283 )?;
2284 self.quantity_scale = ::buffa::types::decode_uint32(buf)?;
2285 }
2286 6u32 => {
2287 ::buffa::encoding::check_wire_type(
2288 tag,
2289 ::buffa::encoding::WireType::Varint,
2290 )?;
2291 self.quantity_display_decimals = ::buffa::types::decode_uint32(buf)?;
2292 }
2293 7u32 => {
2294 ::buffa::encoding::check_wire_type(
2295 tag,
2296 ::buffa::encoding::WireType::LengthDelimited,
2297 )?;
2298 let mut elem = ::core::default::Default::default();
2299 ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2300 self.variants.push(elem);
2301 }
2302 8u32 => {
2303 ::buffa::encoding::check_wire_type(
2304 tag,
2305 ::buffa::encoding::WireType::LengthDelimited,
2306 )?;
2307 ::buffa::types::merge_string(&mut self.u_asset_id, buf)?;
2308 }
2309 _ => {
2310 self.__buffa_unknown_fields
2311 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2312 }
2313 }
2314 ::core::result::Result::Ok(())
2315 }
2316 fn clear(&mut self) {
2317 self.asset.clear();
2318 self.ledger_id = 0u32;
2319 self.name.clear();
2320 self.icon.clear();
2321 self.quantity_scale = 0u32;
2322 self.quantity_display_decimals = 0u32;
2323 self.variants.clear();
2324 self.u_asset_id.clear();
2325 self.__buffa_unknown_fields.clear();
2326 }
2327}
2328impl ::buffa::ExtensionSet for AssetConfig {
2329 const PROTO_FQN: &'static str = "chain.zipper.v1.AssetConfig";
2330 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2331 &self.__buffa_unknown_fields
2332 }
2333 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2334 &mut self.__buffa_unknown_fields
2335 }
2336}
2337impl ::buffa::json_helpers::ProtoElemJson for AssetConfig {
2338 fn serialize_proto_json<S: ::serde::Serializer>(
2339 v: &Self,
2340 s: S,
2341 ) -> ::core::result::Result<S::Ok, S::Error> {
2342 ::serde::Serialize::serialize(v, s)
2343 }
2344 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2345 d: D,
2346 ) -> ::core::result::Result<Self, D::Error> {
2347 <Self as ::serde::Deserialize>::deserialize(d)
2348 }
2349}
2350#[doc(hidden)]
2351pub const __ASSET_CONFIG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2352 type_url: "type.googleapis.com/chain.zipper.v1.AssetConfig",
2353 to_json: ::buffa::type_registry::any_to_json::<AssetConfig>,
2354 from_json: ::buffa::type_registry::any_from_json::<AssetConfig>,
2355 is_wkt: false,
2356};
2357#[derive(Clone, PartialEq, Default)]
2360#[derive(::serde::Serialize, ::serde::Deserialize)]
2361#[serde(default)]
2362pub struct ChainContractConfig {
2363 #[serde(
2367 rename = "name",
2368 with = "::buffa::json_helpers::proto_string",
2369 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2370 )]
2371 pub name: ::buffa::alloc::string::String,
2372 #[serde(
2376 rename = "address",
2377 with = "::buffa::json_helpers::proto_string",
2378 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2379 )]
2380 pub address: ::buffa::alloc::string::String,
2381 #[serde(
2385 rename = "type",
2386 with = "::buffa::json_helpers::proto_string",
2387 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2388 )]
2389 pub r#type: ::buffa::alloc::string::String,
2390 #[serde(
2394 rename = "description",
2395 with = "::buffa::json_helpers::proto_string",
2396 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2397 )]
2398 pub description: ::buffa::alloc::string::String,
2399 #[serde(
2404 rename = "version",
2405 with = "::buffa::json_helpers::uint32",
2406 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2407 )]
2408 pub version: u32,
2409 #[serde(skip)]
2410 #[doc(hidden)]
2411 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2412}
2413impl ::core::fmt::Debug for ChainContractConfig {
2414 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2415 f.debug_struct("ChainContractConfig")
2416 .field("name", &self.name)
2417 .field("address", &self.address)
2418 .field("type", &self.r#type)
2419 .field("description", &self.description)
2420 .field("version", &self.version)
2421 .finish()
2422 }
2423}
2424impl ChainContractConfig {
2425 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainContractConfig";
2430}
2431::buffa::impl_default_instance!(ChainContractConfig);
2432impl ::buffa::MessageName for ChainContractConfig {
2433 const PACKAGE: &'static str = "chain.zipper.v1";
2434 const NAME: &'static str = "ChainContractConfig";
2435 const FULL_NAME: &'static str = "chain.zipper.v1.ChainContractConfig";
2436 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainContractConfig";
2437}
2438impl ::buffa::Message for ChainContractConfig {
2439 #[allow(clippy::let_and_return)]
2445 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2446 #[allow(unused_imports)]
2447 use ::buffa::Enumeration as _;
2448 let mut size = 0u32;
2449 if !self.name.is_empty() {
2450 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2451 }
2452 if !self.address.is_empty() {
2453 size += 1u32 + ::buffa::types::string_encoded_len(&self.address) as u32;
2454 }
2455 if !self.r#type.is_empty() {
2456 size += 1u32 + ::buffa::types::string_encoded_len(&self.r#type) as u32;
2457 }
2458 if !self.description.is_empty() {
2459 size += 1u32 + ::buffa::types::string_encoded_len(&self.description) as u32;
2460 }
2461 if self.version != 0u32 {
2462 size += 1u32 + ::buffa::types::uint32_encoded_len(self.version) as u32;
2463 }
2464 size += self.__buffa_unknown_fields.encoded_len() as u32;
2465 size
2466 }
2467 fn write_to(
2468 &self,
2469 _cache: &mut ::buffa::SizeCache,
2470 buf: &mut impl ::buffa::bytes::BufMut,
2471 ) {
2472 #[allow(unused_imports)]
2473 use ::buffa::Enumeration as _;
2474 if !self.name.is_empty() {
2475 ::buffa::types::put_string_field(1u32, &self.name, buf);
2476 }
2477 if !self.address.is_empty() {
2478 ::buffa::types::put_string_field(2u32, &self.address, buf);
2479 }
2480 if !self.r#type.is_empty() {
2481 ::buffa::types::put_string_field(3u32, &self.r#type, buf);
2482 }
2483 if !self.description.is_empty() {
2484 ::buffa::types::put_string_field(4u32, &self.description, buf);
2485 }
2486 if self.version != 0u32 {
2487 ::buffa::types::put_uint32_field(5u32, self.version, buf);
2488 }
2489 self.__buffa_unknown_fields.write_to(buf);
2490 }
2491 fn merge_field(
2492 &mut self,
2493 tag: ::buffa::encoding::Tag,
2494 buf: &mut impl ::buffa::bytes::Buf,
2495 ctx: ::buffa::DecodeContext<'_>,
2496 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2497 #[allow(unused_imports)]
2498 use ::buffa::bytes::Buf as _;
2499 #[allow(unused_imports)]
2500 use ::buffa::Enumeration as _;
2501 match tag.field_number() {
2502 1u32 => {
2503 ::buffa::encoding::check_wire_type(
2504 tag,
2505 ::buffa::encoding::WireType::LengthDelimited,
2506 )?;
2507 ::buffa::types::merge_string(&mut self.name, buf)?;
2508 }
2509 2u32 => {
2510 ::buffa::encoding::check_wire_type(
2511 tag,
2512 ::buffa::encoding::WireType::LengthDelimited,
2513 )?;
2514 ::buffa::types::merge_string(&mut self.address, buf)?;
2515 }
2516 3u32 => {
2517 ::buffa::encoding::check_wire_type(
2518 tag,
2519 ::buffa::encoding::WireType::LengthDelimited,
2520 )?;
2521 ::buffa::types::merge_string(&mut self.r#type, buf)?;
2522 }
2523 4u32 => {
2524 ::buffa::encoding::check_wire_type(
2525 tag,
2526 ::buffa::encoding::WireType::LengthDelimited,
2527 )?;
2528 ::buffa::types::merge_string(&mut self.description, buf)?;
2529 }
2530 5u32 => {
2531 ::buffa::encoding::check_wire_type(
2532 tag,
2533 ::buffa::encoding::WireType::Varint,
2534 )?;
2535 self.version = ::buffa::types::decode_uint32(buf)?;
2536 }
2537 _ => {
2538 self.__buffa_unknown_fields
2539 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2540 }
2541 }
2542 ::core::result::Result::Ok(())
2543 }
2544 fn clear(&mut self) {
2545 self.name.clear();
2546 self.address.clear();
2547 self.r#type.clear();
2548 self.description.clear();
2549 self.version = 0u32;
2550 self.__buffa_unknown_fields.clear();
2551 }
2552}
2553impl ::buffa::ExtensionSet for ChainContractConfig {
2554 const PROTO_FQN: &'static str = "chain.zipper.v1.ChainContractConfig";
2555 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2556 &self.__buffa_unknown_fields
2557 }
2558 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2559 &mut self.__buffa_unknown_fields
2560 }
2561}
2562impl ::buffa::json_helpers::ProtoElemJson for ChainContractConfig {
2563 fn serialize_proto_json<S: ::serde::Serializer>(
2564 v: &Self,
2565 s: S,
2566 ) -> ::core::result::Result<S::Ok, S::Error> {
2567 ::serde::Serialize::serialize(v, s)
2568 }
2569 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2570 d: D,
2571 ) -> ::core::result::Result<Self, D::Error> {
2572 <Self as ::serde::Deserialize>::deserialize(d)
2573 }
2574}
2575#[doc(hidden)]
2576pub const __CHAIN_CONTRACT_CONFIG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2577 type_url: "type.googleapis.com/chain.zipper.v1.ChainContractConfig",
2578 to_json: ::buffa::type_registry::any_to_json::<ChainContractConfig>,
2579 from_json: ::buffa::type_registry::any_from_json::<ChainContractConfig>,
2580 is_wkt: false,
2581};
2582#[derive(Clone, PartialEq, Default)]
2583#[derive(::serde::Serialize, ::serde::Deserialize)]
2584#[serde(default)]
2585pub struct GetDepositWithdrawConfigRequest {
2586 #[serde(skip)]
2587 #[doc(hidden)]
2588 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2589}
2590impl ::core::fmt::Debug for GetDepositWithdrawConfigRequest {
2591 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2592 f.debug_struct("GetDepositWithdrawConfigRequest").finish()
2593 }
2594}
2595impl GetDepositWithdrawConfigRequest {
2596 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigRequest";
2601}
2602::buffa::impl_default_instance!(GetDepositWithdrawConfigRequest);
2603impl ::buffa::MessageName for GetDepositWithdrawConfigRequest {
2604 const PACKAGE: &'static str = "chain.zipper.v1";
2605 const NAME: &'static str = "GetDepositWithdrawConfigRequest";
2606 const FULL_NAME: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigRequest";
2607 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigRequest";
2608}
2609impl ::buffa::Message for GetDepositWithdrawConfigRequest {
2610 #[allow(clippy::let_and_return)]
2616 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2617 #[allow(unused_imports)]
2618 use ::buffa::Enumeration as _;
2619 let mut size = 0u32;
2620 size += self.__buffa_unknown_fields.encoded_len() as u32;
2621 size
2622 }
2623 fn write_to(
2624 &self,
2625 _cache: &mut ::buffa::SizeCache,
2626 buf: &mut impl ::buffa::bytes::BufMut,
2627 ) {
2628 #[allow(unused_imports)]
2629 use ::buffa::Enumeration as _;
2630 self.__buffa_unknown_fields.write_to(buf);
2631 }
2632 fn merge_field(
2633 &mut self,
2634 tag: ::buffa::encoding::Tag,
2635 buf: &mut impl ::buffa::bytes::Buf,
2636 ctx: ::buffa::DecodeContext<'_>,
2637 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2638 #[allow(unused_imports)]
2639 use ::buffa::bytes::Buf as _;
2640 #[allow(unused_imports)]
2641 use ::buffa::Enumeration as _;
2642 match tag.field_number() {
2643 _ => {
2644 self.__buffa_unknown_fields
2645 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2646 }
2647 }
2648 ::core::result::Result::Ok(())
2649 }
2650 fn clear(&mut self) {
2651 self.__buffa_unknown_fields.clear();
2652 }
2653}
2654impl ::buffa::ExtensionSet for GetDepositWithdrawConfigRequest {
2655 const PROTO_FQN: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigRequest";
2656 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2657 &self.__buffa_unknown_fields
2658 }
2659 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2660 &mut self.__buffa_unknown_fields
2661 }
2662}
2663impl ::buffa::json_helpers::ProtoElemJson for GetDepositWithdrawConfigRequest {
2664 fn serialize_proto_json<S: ::serde::Serializer>(
2665 v: &Self,
2666 s: S,
2667 ) -> ::core::result::Result<S::Ok, S::Error> {
2668 ::serde::Serialize::serialize(v, s)
2669 }
2670 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2671 d: D,
2672 ) -> ::core::result::Result<Self, D::Error> {
2673 <Self as ::serde::Deserialize>::deserialize(d)
2674 }
2675}
2676#[doc(hidden)]
2677pub const __GET_DEPOSIT_WITHDRAW_CONFIG_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2678 type_url: "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigRequest",
2679 to_json: ::buffa::type_registry::any_to_json::<GetDepositWithdrawConfigRequest>,
2680 from_json: ::buffa::type_registry::any_from_json::<GetDepositWithdrawConfigRequest>,
2681 is_wkt: false,
2682};
2683#[derive(Clone, PartialEq, Default)]
2684#[derive(::serde::Serialize, ::serde::Deserialize)]
2685#[serde(default)]
2686pub struct GetDepositWithdrawConfigResponse {
2687 #[serde(
2691 rename = "chains",
2692 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2693 deserialize_with = "::buffa::json_helpers::null_as_default"
2694 )]
2695 pub chains: ::buffa::alloc::vec::Vec<ChainConfig>,
2696 #[serde(
2700 rename = "assets",
2701 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2702 deserialize_with = "::buffa::json_helpers::null_as_default"
2703 )]
2704 pub assets: ::buffa::alloc::vec::Vec<AssetConfig>,
2705 #[serde(
2709 rename = "tsSec",
2710 alias = "ts_sec",
2711 with = "::buffa::json_helpers::uint64",
2712 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
2713 )]
2714 pub ts_sec: u64,
2715 #[serde(
2719 rename = "polyesterChainId",
2720 alias = "polyester_chain_id",
2721 with = "::buffa::json_helpers::uint32",
2722 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
2723 )]
2724 pub polyester_chain_id: u32,
2725 #[serde(
2729 rename = "contracts",
2730 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2731 deserialize_with = "::buffa::json_helpers::null_as_default"
2732 )]
2733 pub contracts: ::buffa::alloc::vec::Vec<ChainContractConfig>,
2734 #[serde(skip)]
2735 #[doc(hidden)]
2736 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2737}
2738impl ::core::fmt::Debug for GetDepositWithdrawConfigResponse {
2739 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2740 f.debug_struct("GetDepositWithdrawConfigResponse")
2741 .field("chains", &self.chains)
2742 .field("assets", &self.assets)
2743 .field("ts_sec", &self.ts_sec)
2744 .field("polyester_chain_id", &self.polyester_chain_id)
2745 .field("contracts", &self.contracts)
2746 .finish()
2747 }
2748}
2749impl GetDepositWithdrawConfigResponse {
2750 pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigResponse";
2755}
2756::buffa::impl_default_instance!(GetDepositWithdrawConfigResponse);
2757impl ::buffa::MessageName for GetDepositWithdrawConfigResponse {
2758 const PACKAGE: &'static str = "chain.zipper.v1";
2759 const NAME: &'static str = "GetDepositWithdrawConfigResponse";
2760 const FULL_NAME: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigResponse";
2761 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigResponse";
2762}
2763impl ::buffa::Message for GetDepositWithdrawConfigResponse {
2764 #[allow(clippy::let_and_return)]
2770 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
2771 #[allow(unused_imports)]
2772 use ::buffa::Enumeration as _;
2773 let mut size = 0u32;
2774 for v in &self.chains {
2775 let __slot = __cache.reserve();
2776 let inner_size = v.compute_size(__cache);
2777 __cache.set(__slot, inner_size);
2778 size
2779 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2780 + inner_size;
2781 }
2782 for v in &self.assets {
2783 let __slot = __cache.reserve();
2784 let inner_size = v.compute_size(__cache);
2785 __cache.set(__slot, inner_size);
2786 size
2787 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2788 + inner_size;
2789 }
2790 if self.ts_sec != 0u64 {
2791 size += 1u32 + ::buffa::types::uint64_encoded_len(self.ts_sec) as u32;
2792 }
2793 if self.polyester_chain_id != 0u32 {
2794 size
2795 += 1u32
2796 + ::buffa::types::uint32_encoded_len(self.polyester_chain_id) as u32;
2797 }
2798 for v in &self.contracts {
2799 let __slot = __cache.reserve();
2800 let inner_size = v.compute_size(__cache);
2801 __cache.set(__slot, inner_size);
2802 size
2803 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
2804 + inner_size;
2805 }
2806 size += self.__buffa_unknown_fields.encoded_len() as u32;
2807 size
2808 }
2809 fn write_to(
2810 &self,
2811 __cache: &mut ::buffa::SizeCache,
2812 buf: &mut impl ::buffa::bytes::BufMut,
2813 ) {
2814 #[allow(unused_imports)]
2815 use ::buffa::Enumeration as _;
2816 for v in &self.chains {
2817 ::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
2818 v.write_to(__cache, buf);
2819 }
2820 for v in &self.assets {
2821 ::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
2822 v.write_to(__cache, buf);
2823 }
2824 if self.ts_sec != 0u64 {
2825 ::buffa::types::put_uint64_field(3u32, self.ts_sec, buf);
2826 }
2827 if self.polyester_chain_id != 0u32 {
2828 ::buffa::types::put_uint32_field(4u32, self.polyester_chain_id, buf);
2829 }
2830 for v in &self.contracts {
2831 ::buffa::types::put_len_delimited_header(5u32, __cache.consume_next(), buf);
2832 v.write_to(__cache, buf);
2833 }
2834 self.__buffa_unknown_fields.write_to(buf);
2835 }
2836 fn merge_field(
2837 &mut self,
2838 tag: ::buffa::encoding::Tag,
2839 buf: &mut impl ::buffa::bytes::Buf,
2840 ctx: ::buffa::DecodeContext<'_>,
2841 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2842 #[allow(unused_imports)]
2843 use ::buffa::bytes::Buf as _;
2844 #[allow(unused_imports)]
2845 use ::buffa::Enumeration as _;
2846 match tag.field_number() {
2847 1u32 => {
2848 ::buffa::encoding::check_wire_type(
2849 tag,
2850 ::buffa::encoding::WireType::LengthDelimited,
2851 )?;
2852 let mut elem = ::core::default::Default::default();
2853 ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2854 self.chains.push(elem);
2855 }
2856 2u32 => {
2857 ::buffa::encoding::check_wire_type(
2858 tag,
2859 ::buffa::encoding::WireType::LengthDelimited,
2860 )?;
2861 let mut elem = ::core::default::Default::default();
2862 ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2863 self.assets.push(elem);
2864 }
2865 3u32 => {
2866 ::buffa::encoding::check_wire_type(
2867 tag,
2868 ::buffa::encoding::WireType::Varint,
2869 )?;
2870 self.ts_sec = ::buffa::types::decode_uint64(buf)?;
2871 }
2872 4u32 => {
2873 ::buffa::encoding::check_wire_type(
2874 tag,
2875 ::buffa::encoding::WireType::Varint,
2876 )?;
2877 self.polyester_chain_id = ::buffa::types::decode_uint32(buf)?;
2878 }
2879 5u32 => {
2880 ::buffa::encoding::check_wire_type(
2881 tag,
2882 ::buffa::encoding::WireType::LengthDelimited,
2883 )?;
2884 let mut elem = ::core::default::Default::default();
2885 ::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
2886 self.contracts.push(elem);
2887 }
2888 _ => {
2889 self.__buffa_unknown_fields
2890 .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
2891 }
2892 }
2893 ::core::result::Result::Ok(())
2894 }
2895 fn clear(&mut self) {
2896 self.chains.clear();
2897 self.assets.clear();
2898 self.ts_sec = 0u64;
2899 self.polyester_chain_id = 0u32;
2900 self.contracts.clear();
2901 self.__buffa_unknown_fields.clear();
2902 }
2903}
2904impl ::buffa::ExtensionSet for GetDepositWithdrawConfigResponse {
2905 const PROTO_FQN: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigResponse";
2906 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2907 &self.__buffa_unknown_fields
2908 }
2909 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2910 &mut self.__buffa_unknown_fields
2911 }
2912}
2913impl ::buffa::json_helpers::ProtoElemJson for GetDepositWithdrawConfigResponse {
2914 fn serialize_proto_json<S: ::serde::Serializer>(
2915 v: &Self,
2916 s: S,
2917 ) -> ::core::result::Result<S::Ok, S::Error> {
2918 ::serde::Serialize::serialize(v, s)
2919 }
2920 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2921 d: D,
2922 ) -> ::core::result::Result<Self, D::Error> {
2923 <Self as ::serde::Deserialize>::deserialize(d)
2924 }
2925}
2926#[doc(hidden)]
2927pub const __GET_DEPOSIT_WITHDRAW_CONFIG_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2928 type_url: "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigResponse",
2929 to_json: ::buffa::type_registry::any_to_json::<GetDepositWithdrawConfigResponse>,
2930 from_json: ::buffa::type_registry::any_from_json::<GetDepositWithdrawConfigResponse>,
2931 is_wkt: false,
2932};
2933#[allow(
2934 non_camel_case_types,
2935 dead_code,
2936 unused_imports,
2937 unused_qualifications,
2938 clippy::derivable_impls,
2939 clippy::match_single_binding,
2940 clippy::uninlined_format_args,
2941 clippy::doc_lazy_continuation,
2942 clippy::module_inception
2943)]
2944pub mod __buffa {
2945 #[allow(unused_imports)]
2946 use super::*;
2947 pub mod view {
2948 #[allow(unused_imports)]
2949 use super::*;
2950 #[derive(Clone, Debug, Default)]
2952 pub struct ZipperReasonDetailsView<'a> {
2953 pub code: ::buffa::EnumValue<super::super::ZipperReasonCode>,
2957 pub reason_id: &'a str,
2961 pub message: &'a str,
2965 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2966 }
2967 impl<'a> ::buffa::MessageView<'a> for ZipperReasonDetailsView<'a> {
2968 type Owned = super::super::ZipperReasonDetails;
2969 fn decode_view(
2970 buf: &'a [u8],
2971 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2972 let __limit = ::core::cell::Cell::new(
2973 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
2974 );
2975 <Self as ::buffa::MessageView>::decode_view_ctx(
2976 buf,
2977 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
2978 )
2979 }
2980 fn decode_view_with_ctx(
2981 buf: &'a [u8],
2982 ctx: ::buffa::DecodeContext<'_>,
2983 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2984 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
2985 }
2986 fn merge_view_field(
2987 &mut self,
2988 tag: ::buffa::encoding::Tag,
2989 cur: &'a [u8],
2990 before_tag: &'a [u8],
2991 ctx: ::buffa::DecodeContext<'_>,
2992 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
2993 let _ = ctx;
2994 #[allow(unused_variables)]
2995 let view = self;
2996 let mut cur = cur;
2997 match tag.field_number() {
2998 1u32 => {
2999 ::buffa::encoding::check_wire_type(
3000 tag,
3001 ::buffa::encoding::WireType::Varint,
3002 )?;
3003 view.code = ::buffa::EnumValue::from(
3004 ::buffa::types::decode_int32(&mut cur)?,
3005 );
3006 }
3007 2u32 => {
3008 ::buffa::encoding::check_wire_type(
3009 tag,
3010 ::buffa::encoding::WireType::LengthDelimited,
3011 )?;
3012 view.reason_id = ::buffa::types::borrow_str(&mut cur)?;
3013 }
3014 3u32 => {
3015 ::buffa::encoding::check_wire_type(
3016 tag,
3017 ::buffa::encoding::WireType::LengthDelimited,
3018 )?;
3019 view.message = ::buffa::types::borrow_str(&mut cur)?;
3020 }
3021 _ => {
3022 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
3023 let span_len = before_tag.len() - cur.len();
3024 view.__buffa_unknown_fields
3025 .push_record(before_tag, span_len, ctx)?;
3026 }
3027 }
3028 ::core::result::Result::Ok(cur)
3029 }
3030 fn to_owned_message(
3031 &self,
3032 ) -> ::core::result::Result<
3033 super::super::ZipperReasonDetails,
3034 ::buffa::DecodeError,
3035 > {
3036 self.to_owned_from_source(None)
3037 }
3038 #[allow(clippy::useless_conversion, clippy::needless_update)]
3039 fn to_owned_from_source(
3040 &self,
3041 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3042 ) -> ::core::result::Result<
3043 super::super::ZipperReasonDetails,
3044 ::buffa::DecodeError,
3045 > {
3046 #[allow(unused_imports)]
3047 use ::buffa::alloc::string::ToString as _;
3048 let _ = __buffa_src;
3049 ::core::result::Result::Ok(super::super::ZipperReasonDetails {
3050 code: self.code,
3051 reason_id: self.reason_id.to_string(),
3052 message: self.message.to_string(),
3053 __buffa_unknown_fields: self
3054 .__buffa_unknown_fields
3055 .to_owned()?
3056 .into(),
3057 ..::core::default::Default::default()
3058 })
3059 }
3060 }
3061 impl<'a> ::buffa::ViewEncode<'a> for ZipperReasonDetailsView<'a> {
3062 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3063 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3064 #[allow(unused_imports)]
3065 use ::buffa::Enumeration as _;
3066 let mut size = 0u32;
3067 {
3068 let val = self.code.to_i32();
3069 if val != 0 {
3070 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
3071 }
3072 }
3073 if !self.reason_id.is_empty() {
3074 size
3075 += 1u32
3076 + ::buffa::types::string_encoded_len(&self.reason_id) as u32;
3077 }
3078 if !self.message.is_empty() {
3079 size
3080 += 1u32
3081 + ::buffa::types::string_encoded_len(&self.message) as u32;
3082 }
3083 size += self.__buffa_unknown_fields.encoded_len() as u32;
3084 size
3085 }
3086 #[allow(clippy::needless_borrow)]
3087 fn write_to(
3088 &self,
3089 _cache: &mut ::buffa::SizeCache,
3090 buf: &mut impl ::buffa::bytes::BufMut,
3091 ) {
3092 #[allow(unused_imports)]
3093 use ::buffa::Enumeration as _;
3094 {
3095 let val = self.code.to_i32();
3096 if val != 0 {
3097 ::buffa::types::put_int32_field(1u32, val, buf);
3098 }
3099 }
3100 if !self.reason_id.is_empty() {
3101 ::buffa::types::put_string_field(2u32, &self.reason_id, buf);
3102 }
3103 if !self.message.is_empty() {
3104 ::buffa::types::put_string_field(3u32, &self.message, buf);
3105 }
3106 self.__buffa_unknown_fields.write_to(buf);
3107 }
3108 }
3109 impl<'__a> ::serde::Serialize for ZipperReasonDetailsView<'__a> {
3121 fn serialize<__S: ::serde::Serializer>(
3122 &self,
3123 __s: __S,
3124 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3125 use ::serde::ser::SerializeMap as _;
3126 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3127 if !::buffa::json_helpers::skip_if::is_default_enum_value(&self.code) {
3128 __map.serialize_entry("code", &self.code)?;
3129 }
3130 if !::buffa::json_helpers::skip_if::is_empty_str(self.reason_id) {
3131 __map.serialize_entry("reasonId", self.reason_id)?;
3132 }
3133 if !::buffa::json_helpers::skip_if::is_empty_str(self.message) {
3134 __map.serialize_entry("message", self.message)?;
3135 }
3136 __map.end()
3137 }
3138 }
3139 impl<'a> ::buffa::MessageName for ZipperReasonDetailsView<'a> {
3140 const PACKAGE: &'static str = "chain.zipper.v1";
3141 const NAME: &'static str = "ZipperReasonDetails";
3142 const FULL_NAME: &'static str = "chain.zipper.v1.ZipperReasonDetails";
3143 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZipperReasonDetails";
3144 }
3145 ::buffa::impl_default_view_instance!(ZipperReasonDetailsView);
3146 ::buffa::impl_view_reborrow!(ZipperReasonDetailsView);
3147 #[derive(Clone, Debug)]
3153 pub struct ZipperReasonDetailsOwnedView(
3154 ::buffa::OwnedView<ZipperReasonDetailsView<'static>>,
3155 );
3156 impl ZipperReasonDetailsOwnedView {
3157 pub fn decode(
3167 bytes: ::buffa::bytes::Bytes,
3168 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3169 ::core::result::Result::Ok(
3170 ZipperReasonDetailsOwnedView(::buffa::OwnedView::decode(bytes)?),
3171 )
3172 }
3173 pub fn decode_with_options(
3181 bytes: ::buffa::bytes::Bytes,
3182 opts: &::buffa::DecodeOptions,
3183 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3184 ::core::result::Result::Ok(
3185 ZipperReasonDetailsOwnedView(
3186 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3187 ),
3188 )
3189 }
3190 pub fn from_owned(
3197 msg: &super::super::ZipperReasonDetails,
3198 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3199 ::core::result::Result::Ok(
3200 ZipperReasonDetailsOwnedView(::buffa::OwnedView::from_owned(msg)?),
3201 )
3202 }
3203 #[must_use]
3205 pub fn view(&self) -> &ZipperReasonDetailsView<'_> {
3206 self.0.reborrow()
3207 }
3208 pub fn to_owned_message(
3215 &self,
3216 ) -> ::core::result::Result<
3217 super::super::ZipperReasonDetails,
3218 ::buffa::DecodeError,
3219 > {
3220 self.0.to_owned_message()
3221 }
3222 #[must_use]
3224 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3225 self.0.bytes()
3226 }
3227 #[must_use]
3229 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3230 self.0.into_bytes()
3231 }
3232 #[must_use]
3236 pub fn code(&self) -> ::buffa::EnumValue<super::super::ZipperReasonCode> {
3237 self.0.reborrow().code
3238 }
3239 #[must_use]
3243 pub fn reason_id(&self) -> &'_ str {
3244 self.0.reborrow().reason_id
3245 }
3246 #[must_use]
3250 pub fn message(&self) -> &'_ str {
3251 self.0.reborrow().message
3252 }
3253 }
3254 impl ::core::convert::From<::buffa::OwnedView<ZipperReasonDetailsView<'static>>>
3255 for ZipperReasonDetailsOwnedView {
3256 fn from(
3257 inner: ::buffa::OwnedView<ZipperReasonDetailsView<'static>>,
3258 ) -> Self {
3259 ZipperReasonDetailsOwnedView(inner)
3260 }
3261 }
3262 impl ::core::convert::From<ZipperReasonDetailsOwnedView>
3263 for ::buffa::OwnedView<ZipperReasonDetailsView<'static>> {
3264 fn from(wrapper: ZipperReasonDetailsOwnedView) -> Self {
3265 wrapper.0
3266 }
3267 }
3268 impl ::core::convert::AsRef<::buffa::OwnedView<ZipperReasonDetailsView<'static>>>
3269 for ZipperReasonDetailsOwnedView {
3270 fn as_ref(&self) -> &::buffa::OwnedView<ZipperReasonDetailsView<'static>> {
3271 &self.0
3272 }
3273 }
3274 impl ::buffa::HasMessageView for super::super::ZipperReasonDetails {
3275 type View<'a> = ZipperReasonDetailsView<'a>;
3276 type ViewHandle = ZipperReasonDetailsOwnedView;
3277 }
3278 impl ::serde::Serialize for ZipperReasonDetailsOwnedView {
3279 fn serialize<__S: ::serde::Serializer>(
3280 &self,
3281 __s: __S,
3282 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3283 ::serde::Serialize::serialize(&self.0, __s)
3284 }
3285 }
3286 #[derive(Clone, Debug, Default)]
3288 pub struct ChainConfigView<'a> {
3289 pub chain_id: u32,
3293 pub code: &'a str,
3297 pub name: &'a str,
3301 pub native_chain_id: &'a str,
3307 pub native_currency_symbol: &'a str,
3311 pub explorer_url: &'a str,
3315 pub icon: &'a str,
3319 pub required_confirmations: u32,
3323 pub confirmation_time_seconds: u32,
3327 pub is_case_sensitive: bool,
3331 pub min_address_length: u32,
3335 pub max_address_length: u32,
3339 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3340 }
3341 impl<'a> ::buffa::MessageView<'a> for ChainConfigView<'a> {
3342 type Owned = super::super::ChainConfig;
3343 fn decode_view(
3344 buf: &'a [u8],
3345 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3346 let __limit = ::core::cell::Cell::new(
3347 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
3348 );
3349 <Self as ::buffa::MessageView>::decode_view_ctx(
3350 buf,
3351 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
3352 )
3353 }
3354 fn decode_view_with_ctx(
3355 buf: &'a [u8],
3356 ctx: ::buffa::DecodeContext<'_>,
3357 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3358 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
3359 }
3360 fn merge_view_field(
3361 &mut self,
3362 tag: ::buffa::encoding::Tag,
3363 cur: &'a [u8],
3364 before_tag: &'a [u8],
3365 ctx: ::buffa::DecodeContext<'_>,
3366 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
3367 let _ = ctx;
3368 #[allow(unused_variables)]
3369 let view = self;
3370 let mut cur = cur;
3371 match tag.field_number() {
3372 1u32 => {
3373 ::buffa::encoding::check_wire_type(
3374 tag,
3375 ::buffa::encoding::WireType::Varint,
3376 )?;
3377 view.chain_id = ::buffa::types::decode_uint32(&mut cur)?;
3378 }
3379 2u32 => {
3380 ::buffa::encoding::check_wire_type(
3381 tag,
3382 ::buffa::encoding::WireType::LengthDelimited,
3383 )?;
3384 view.code = ::buffa::types::borrow_str(&mut cur)?;
3385 }
3386 3u32 => {
3387 ::buffa::encoding::check_wire_type(
3388 tag,
3389 ::buffa::encoding::WireType::LengthDelimited,
3390 )?;
3391 view.name = ::buffa::types::borrow_str(&mut cur)?;
3392 }
3393 4u32 => {
3394 ::buffa::encoding::check_wire_type(
3395 tag,
3396 ::buffa::encoding::WireType::LengthDelimited,
3397 )?;
3398 view.native_chain_id = ::buffa::types::borrow_str(&mut cur)?;
3399 }
3400 5u32 => {
3401 ::buffa::encoding::check_wire_type(
3402 tag,
3403 ::buffa::encoding::WireType::LengthDelimited,
3404 )?;
3405 view.native_currency_symbol = ::buffa::types::borrow_str(
3406 &mut cur,
3407 )?;
3408 }
3409 6u32 => {
3410 ::buffa::encoding::check_wire_type(
3411 tag,
3412 ::buffa::encoding::WireType::LengthDelimited,
3413 )?;
3414 view.explorer_url = ::buffa::types::borrow_str(&mut cur)?;
3415 }
3416 7u32 => {
3417 ::buffa::encoding::check_wire_type(
3418 tag,
3419 ::buffa::encoding::WireType::LengthDelimited,
3420 )?;
3421 view.icon = ::buffa::types::borrow_str(&mut cur)?;
3422 }
3423 8u32 => {
3424 ::buffa::encoding::check_wire_type(
3425 tag,
3426 ::buffa::encoding::WireType::Varint,
3427 )?;
3428 view.required_confirmations = ::buffa::types::decode_uint32(
3429 &mut cur,
3430 )?;
3431 }
3432 9u32 => {
3433 ::buffa::encoding::check_wire_type(
3434 tag,
3435 ::buffa::encoding::WireType::Varint,
3436 )?;
3437 view.confirmation_time_seconds = ::buffa::types::decode_uint32(
3438 &mut cur,
3439 )?;
3440 }
3441 10u32 => {
3442 ::buffa::encoding::check_wire_type(
3443 tag,
3444 ::buffa::encoding::WireType::Varint,
3445 )?;
3446 view.is_case_sensitive = ::buffa::types::decode_bool(&mut cur)?;
3447 }
3448 11u32 => {
3449 ::buffa::encoding::check_wire_type(
3450 tag,
3451 ::buffa::encoding::WireType::Varint,
3452 )?;
3453 view.min_address_length = ::buffa::types::decode_uint32(
3454 &mut cur,
3455 )?;
3456 }
3457 12u32 => {
3458 ::buffa::encoding::check_wire_type(
3459 tag,
3460 ::buffa::encoding::WireType::Varint,
3461 )?;
3462 view.max_address_length = ::buffa::types::decode_uint32(
3463 &mut cur,
3464 )?;
3465 }
3466 _ => {
3467 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
3468 let span_len = before_tag.len() - cur.len();
3469 view.__buffa_unknown_fields
3470 .push_record(before_tag, span_len, ctx)?;
3471 }
3472 }
3473 ::core::result::Result::Ok(cur)
3474 }
3475 fn to_owned_message(
3476 &self,
3477 ) -> ::core::result::Result<
3478 super::super::ChainConfig,
3479 ::buffa::DecodeError,
3480 > {
3481 self.to_owned_from_source(None)
3482 }
3483 #[allow(clippy::useless_conversion, clippy::needless_update)]
3484 fn to_owned_from_source(
3485 &self,
3486 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3487 ) -> ::core::result::Result<
3488 super::super::ChainConfig,
3489 ::buffa::DecodeError,
3490 > {
3491 #[allow(unused_imports)]
3492 use ::buffa::alloc::string::ToString as _;
3493 let _ = __buffa_src;
3494 ::core::result::Result::Ok(super::super::ChainConfig {
3495 chain_id: self.chain_id,
3496 code: self.code.to_string(),
3497 name: self.name.to_string(),
3498 native_chain_id: self.native_chain_id.to_string(),
3499 native_currency_symbol: self.native_currency_symbol.to_string(),
3500 explorer_url: self.explorer_url.to_string(),
3501 icon: self.icon.to_string(),
3502 required_confirmations: self.required_confirmations,
3503 confirmation_time_seconds: self.confirmation_time_seconds,
3504 is_case_sensitive: self.is_case_sensitive,
3505 min_address_length: self.min_address_length,
3506 max_address_length: self.max_address_length,
3507 __buffa_unknown_fields: self
3508 .__buffa_unknown_fields
3509 .to_owned()?
3510 .into(),
3511 ..::core::default::Default::default()
3512 })
3513 }
3514 }
3515 impl<'a> ::buffa::ViewEncode<'a> for ChainConfigView<'a> {
3516 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3517 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3518 #[allow(unused_imports)]
3519 use ::buffa::Enumeration as _;
3520 let mut size = 0u32;
3521 if self.chain_id != 0u32 {
3522 size
3523 += 1u32
3524 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
3525 }
3526 if !self.code.is_empty() {
3527 size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
3528 }
3529 if !self.name.is_empty() {
3530 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
3531 }
3532 if !self.native_chain_id.is_empty() {
3533 size
3534 += 1u32
3535 + ::buffa::types::string_encoded_len(&self.native_chain_id)
3536 as u32;
3537 }
3538 if !self.native_currency_symbol.is_empty() {
3539 size
3540 += 1u32
3541 + ::buffa::types::string_encoded_len(
3542 &self.native_currency_symbol,
3543 ) as u32;
3544 }
3545 if !self.explorer_url.is_empty() {
3546 size
3547 += 1u32
3548 + ::buffa::types::string_encoded_len(&self.explorer_url)
3549 as u32;
3550 }
3551 if !self.icon.is_empty() {
3552 size += 1u32 + ::buffa::types::string_encoded_len(&self.icon) as u32;
3553 }
3554 if self.required_confirmations != 0u32 {
3555 size
3556 += 1u32
3557 + ::buffa::types::uint32_encoded_len(
3558 self.required_confirmations,
3559 ) as u32;
3560 }
3561 if self.confirmation_time_seconds != 0u32 {
3562 size
3563 += 1u32
3564 + ::buffa::types::uint32_encoded_len(
3565 self.confirmation_time_seconds,
3566 ) as u32;
3567 }
3568 if self.is_case_sensitive {
3569 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3570 }
3571 if self.min_address_length != 0u32 {
3572 size
3573 += 1u32
3574 + ::buffa::types::uint32_encoded_len(self.min_address_length)
3575 as u32;
3576 }
3577 if self.max_address_length != 0u32 {
3578 size
3579 += 1u32
3580 + ::buffa::types::uint32_encoded_len(self.max_address_length)
3581 as u32;
3582 }
3583 size += self.__buffa_unknown_fields.encoded_len() as u32;
3584 size
3585 }
3586 #[allow(clippy::needless_borrow)]
3587 fn write_to(
3588 &self,
3589 _cache: &mut ::buffa::SizeCache,
3590 buf: &mut impl ::buffa::bytes::BufMut,
3591 ) {
3592 #[allow(unused_imports)]
3593 use ::buffa::Enumeration as _;
3594 if self.chain_id != 0u32 {
3595 ::buffa::types::put_uint32_field(1u32, self.chain_id, buf);
3596 }
3597 if !self.code.is_empty() {
3598 ::buffa::types::put_string_field(2u32, &self.code, buf);
3599 }
3600 if !self.name.is_empty() {
3601 ::buffa::types::put_string_field(3u32, &self.name, buf);
3602 }
3603 if !self.native_chain_id.is_empty() {
3604 ::buffa::types::put_string_field(4u32, &self.native_chain_id, buf);
3605 }
3606 if !self.native_currency_symbol.is_empty() {
3607 ::buffa::types::put_string_field(
3608 5u32,
3609 &self.native_currency_symbol,
3610 buf,
3611 );
3612 }
3613 if !self.explorer_url.is_empty() {
3614 ::buffa::types::put_string_field(6u32, &self.explorer_url, buf);
3615 }
3616 if !self.icon.is_empty() {
3617 ::buffa::types::put_string_field(7u32, &self.icon, buf);
3618 }
3619 if self.required_confirmations != 0u32 {
3620 ::buffa::types::put_uint32_field(
3621 8u32,
3622 self.required_confirmations,
3623 buf,
3624 );
3625 }
3626 if self.confirmation_time_seconds != 0u32 {
3627 ::buffa::types::put_uint32_field(
3628 9u32,
3629 self.confirmation_time_seconds,
3630 buf,
3631 );
3632 }
3633 if self.is_case_sensitive {
3634 ::buffa::types::put_bool_field(10u32, self.is_case_sensitive, buf);
3635 }
3636 if self.min_address_length != 0u32 {
3637 ::buffa::types::put_uint32_field(
3638 11u32,
3639 self.min_address_length,
3640 buf,
3641 );
3642 }
3643 if self.max_address_length != 0u32 {
3644 ::buffa::types::put_uint32_field(
3645 12u32,
3646 self.max_address_length,
3647 buf,
3648 );
3649 }
3650 self.__buffa_unknown_fields.write_to(buf);
3651 }
3652 }
3653 impl<'__a> ::serde::Serialize for ChainConfigView<'__a> {
3665 fn serialize<__S: ::serde::Serializer>(
3666 &self,
3667 __s: __S,
3668 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3669 use ::serde::ser::SerializeMap as _;
3670 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3671 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.chain_id) {
3672 __map
3673 .serialize_entry(
3674 "chainId",
3675 &::buffa::json_helpers::ProtoJson(&self.chain_id),
3676 )?;
3677 }
3678 if !::buffa::json_helpers::skip_if::is_empty_str(self.code) {
3679 __map.serialize_entry("code", self.code)?;
3680 }
3681 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
3682 __map.serialize_entry("name", self.name)?;
3683 }
3684 if !::buffa::json_helpers::skip_if::is_empty_str(self.native_chain_id) {
3685 __map.serialize_entry("nativeChainId", self.native_chain_id)?;
3686 }
3687 if !::buffa::json_helpers::skip_if::is_empty_str(
3688 self.native_currency_symbol,
3689 ) {
3690 __map
3691 .serialize_entry(
3692 "nativeCurrencySymbol",
3693 self.native_currency_symbol,
3694 )?;
3695 }
3696 if !::buffa::json_helpers::skip_if::is_empty_str(self.explorer_url) {
3697 __map.serialize_entry("explorerUrl", self.explorer_url)?;
3698 }
3699 if !::buffa::json_helpers::skip_if::is_empty_str(self.icon) {
3700 __map.serialize_entry("icon", self.icon)?;
3701 }
3702 if !::buffa::json_helpers::skip_if::is_zero_u32(
3703 &self.required_confirmations,
3704 ) {
3705 __map
3706 .serialize_entry(
3707 "requiredConfirmations",
3708 &::buffa::json_helpers::ProtoJson(
3709 &self.required_confirmations,
3710 ),
3711 )?;
3712 }
3713 if !::buffa::json_helpers::skip_if::is_zero_u32(
3714 &self.confirmation_time_seconds,
3715 ) {
3716 __map
3717 .serialize_entry(
3718 "confirmationTimeSeconds",
3719 &::buffa::json_helpers::ProtoJson(
3720 &self.confirmation_time_seconds,
3721 ),
3722 )?;
3723 }
3724 if self.is_case_sensitive {
3725 __map.serialize_entry("isCaseSensitive", &self.is_case_sensitive)?;
3726 }
3727 if !::buffa::json_helpers::skip_if::is_zero_u32(
3728 &self.min_address_length,
3729 ) {
3730 __map
3731 .serialize_entry(
3732 "minAddressLength",
3733 &::buffa::json_helpers::ProtoJson(&self.min_address_length),
3734 )?;
3735 }
3736 if !::buffa::json_helpers::skip_if::is_zero_u32(
3737 &self.max_address_length,
3738 ) {
3739 __map
3740 .serialize_entry(
3741 "maxAddressLength",
3742 &::buffa::json_helpers::ProtoJson(&self.max_address_length),
3743 )?;
3744 }
3745 __map.end()
3746 }
3747 }
3748 impl<'a> ::buffa::MessageName for ChainConfigView<'a> {
3749 const PACKAGE: &'static str = "chain.zipper.v1";
3750 const NAME: &'static str = "ChainConfig";
3751 const FULL_NAME: &'static str = "chain.zipper.v1.ChainConfig";
3752 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainConfig";
3753 }
3754 ::buffa::impl_default_view_instance!(ChainConfigView);
3755 ::buffa::impl_view_reborrow!(ChainConfigView);
3756 #[derive(Clone, Debug)]
3762 pub struct ChainConfigOwnedView(::buffa::OwnedView<ChainConfigView<'static>>);
3763 impl ChainConfigOwnedView {
3764 pub fn decode(
3774 bytes: ::buffa::bytes::Bytes,
3775 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3776 ::core::result::Result::Ok(
3777 ChainConfigOwnedView(::buffa::OwnedView::decode(bytes)?),
3778 )
3779 }
3780 pub fn decode_with_options(
3788 bytes: ::buffa::bytes::Bytes,
3789 opts: &::buffa::DecodeOptions,
3790 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3791 ::core::result::Result::Ok(
3792 ChainConfigOwnedView(
3793 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3794 ),
3795 )
3796 }
3797 pub fn from_owned(
3804 msg: &super::super::ChainConfig,
3805 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3806 ::core::result::Result::Ok(
3807 ChainConfigOwnedView(::buffa::OwnedView::from_owned(msg)?),
3808 )
3809 }
3810 #[must_use]
3812 pub fn view(&self) -> &ChainConfigView<'_> {
3813 self.0.reborrow()
3814 }
3815 pub fn to_owned_message(
3822 &self,
3823 ) -> ::core::result::Result<
3824 super::super::ChainConfig,
3825 ::buffa::DecodeError,
3826 > {
3827 self.0.to_owned_message()
3828 }
3829 #[must_use]
3831 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3832 self.0.bytes()
3833 }
3834 #[must_use]
3836 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3837 self.0.into_bytes()
3838 }
3839 #[must_use]
3843 pub fn chain_id(&self) -> u32 {
3844 self.0.reborrow().chain_id
3845 }
3846 #[must_use]
3850 pub fn code(&self) -> &'_ str {
3851 self.0.reborrow().code
3852 }
3853 #[must_use]
3857 pub fn name(&self) -> &'_ str {
3858 self.0.reborrow().name
3859 }
3860 #[must_use]
3866 pub fn native_chain_id(&self) -> &'_ str {
3867 self.0.reborrow().native_chain_id
3868 }
3869 #[must_use]
3873 pub fn native_currency_symbol(&self) -> &'_ str {
3874 self.0.reborrow().native_currency_symbol
3875 }
3876 #[must_use]
3880 pub fn explorer_url(&self) -> &'_ str {
3881 self.0.reborrow().explorer_url
3882 }
3883 #[must_use]
3887 pub fn icon(&self) -> &'_ str {
3888 self.0.reborrow().icon
3889 }
3890 #[must_use]
3894 pub fn required_confirmations(&self) -> u32 {
3895 self.0.reborrow().required_confirmations
3896 }
3897 #[must_use]
3901 pub fn confirmation_time_seconds(&self) -> u32 {
3902 self.0.reborrow().confirmation_time_seconds
3903 }
3904 #[must_use]
3908 pub fn is_case_sensitive(&self) -> bool {
3909 self.0.reborrow().is_case_sensitive
3910 }
3911 #[must_use]
3915 pub fn min_address_length(&self) -> u32 {
3916 self.0.reborrow().min_address_length
3917 }
3918 #[must_use]
3922 pub fn max_address_length(&self) -> u32 {
3923 self.0.reborrow().max_address_length
3924 }
3925 }
3926 impl ::core::convert::From<::buffa::OwnedView<ChainConfigView<'static>>>
3927 for ChainConfigOwnedView {
3928 fn from(inner: ::buffa::OwnedView<ChainConfigView<'static>>) -> Self {
3929 ChainConfigOwnedView(inner)
3930 }
3931 }
3932 impl ::core::convert::From<ChainConfigOwnedView>
3933 for ::buffa::OwnedView<ChainConfigView<'static>> {
3934 fn from(wrapper: ChainConfigOwnedView) -> Self {
3935 wrapper.0
3936 }
3937 }
3938 impl ::core::convert::AsRef<::buffa::OwnedView<ChainConfigView<'static>>>
3939 for ChainConfigOwnedView {
3940 fn as_ref(&self) -> &::buffa::OwnedView<ChainConfigView<'static>> {
3941 &self.0
3942 }
3943 }
3944 impl ::buffa::HasMessageView for super::super::ChainConfig {
3945 type View<'a> = ChainConfigView<'a>;
3946 type ViewHandle = ChainConfigOwnedView;
3947 }
3948 impl ::serde::Serialize for ChainConfigOwnedView {
3949 fn serialize<__S: ::serde::Serializer>(
3950 &self,
3951 __s: __S,
3952 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3953 ::serde::Serialize::serialize(&self.0, __s)
3954 }
3955 }
3956 #[derive(Clone, Debug, Default)]
3959 pub struct AssetChainVariantView<'a> {
3960 pub zipped_asset_id: u32,
3964 pub chain_id: u32,
3968 pub is_native_asset: bool,
3972 pub network_fee: &'a str,
3977 pub ztoken_address: &'a str,
3981 pub source_address: &'a str,
3985 pub source_decimals: u32,
3989 pub ztoken_decimals: u32,
3993 pub deposit_min_amount: &'a str,
3997 pub withdraw_min_amount: &'a str,
4001 pub supply_q: u64,
4006 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4007 }
4008 impl<'a> ::buffa::MessageView<'a> for AssetChainVariantView<'a> {
4009 type Owned = super::super::AssetChainVariant;
4010 fn decode_view(
4011 buf: &'a [u8],
4012 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4013 let __limit = ::core::cell::Cell::new(
4014 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
4015 );
4016 <Self as ::buffa::MessageView>::decode_view_ctx(
4017 buf,
4018 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
4019 )
4020 }
4021 fn decode_view_with_ctx(
4022 buf: &'a [u8],
4023 ctx: ::buffa::DecodeContext<'_>,
4024 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4025 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
4026 }
4027 fn merge_view_field(
4028 &mut self,
4029 tag: ::buffa::encoding::Tag,
4030 cur: &'a [u8],
4031 before_tag: &'a [u8],
4032 ctx: ::buffa::DecodeContext<'_>,
4033 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
4034 let _ = ctx;
4035 #[allow(unused_variables)]
4036 let view = self;
4037 let mut cur = cur;
4038 match tag.field_number() {
4039 1u32 => {
4040 ::buffa::encoding::check_wire_type(
4041 tag,
4042 ::buffa::encoding::WireType::Varint,
4043 )?;
4044 view.zipped_asset_id = ::buffa::types::decode_uint32(&mut cur)?;
4045 }
4046 2u32 => {
4047 ::buffa::encoding::check_wire_type(
4048 tag,
4049 ::buffa::encoding::WireType::Varint,
4050 )?;
4051 view.chain_id = ::buffa::types::decode_uint32(&mut cur)?;
4052 }
4053 3u32 => {
4054 ::buffa::encoding::check_wire_type(
4055 tag,
4056 ::buffa::encoding::WireType::Varint,
4057 )?;
4058 view.is_native_asset = ::buffa::types::decode_bool(&mut cur)?;
4059 }
4060 4u32 => {
4061 ::buffa::encoding::check_wire_type(
4062 tag,
4063 ::buffa::encoding::WireType::LengthDelimited,
4064 )?;
4065 view.network_fee = ::buffa::types::borrow_str(&mut cur)?;
4066 }
4067 6u32 => {
4068 ::buffa::encoding::check_wire_type(
4069 tag,
4070 ::buffa::encoding::WireType::LengthDelimited,
4071 )?;
4072 view.ztoken_address = ::buffa::types::borrow_str(&mut cur)?;
4073 }
4074 7u32 => {
4075 ::buffa::encoding::check_wire_type(
4076 tag,
4077 ::buffa::encoding::WireType::LengthDelimited,
4078 )?;
4079 view.source_address = ::buffa::types::borrow_str(&mut cur)?;
4080 }
4081 8u32 => {
4082 ::buffa::encoding::check_wire_type(
4083 tag,
4084 ::buffa::encoding::WireType::Varint,
4085 )?;
4086 view.source_decimals = ::buffa::types::decode_uint32(&mut cur)?;
4087 }
4088 9u32 => {
4089 ::buffa::encoding::check_wire_type(
4090 tag,
4091 ::buffa::encoding::WireType::Varint,
4092 )?;
4093 view.ztoken_decimals = ::buffa::types::decode_uint32(&mut cur)?;
4094 }
4095 10u32 => {
4096 ::buffa::encoding::check_wire_type(
4097 tag,
4098 ::buffa::encoding::WireType::LengthDelimited,
4099 )?;
4100 view.deposit_min_amount = ::buffa::types::borrow_str(&mut cur)?;
4101 }
4102 11u32 => {
4103 ::buffa::encoding::check_wire_type(
4104 tag,
4105 ::buffa::encoding::WireType::LengthDelimited,
4106 )?;
4107 view.withdraw_min_amount = ::buffa::types::borrow_str(&mut cur)?;
4108 }
4109 12u32 => {
4110 ::buffa::encoding::check_wire_type(
4111 tag,
4112 ::buffa::encoding::WireType::Varint,
4113 )?;
4114 view.supply_q = ::buffa::types::decode_uint64(&mut cur)?;
4115 }
4116 _ => {
4117 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
4118 let span_len = before_tag.len() - cur.len();
4119 view.__buffa_unknown_fields
4120 .push_record(before_tag, span_len, ctx)?;
4121 }
4122 }
4123 ::core::result::Result::Ok(cur)
4124 }
4125 fn to_owned_message(
4126 &self,
4127 ) -> ::core::result::Result<
4128 super::super::AssetChainVariant,
4129 ::buffa::DecodeError,
4130 > {
4131 self.to_owned_from_source(None)
4132 }
4133 #[allow(clippy::useless_conversion, clippy::needless_update)]
4134 fn to_owned_from_source(
4135 &self,
4136 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4137 ) -> ::core::result::Result<
4138 super::super::AssetChainVariant,
4139 ::buffa::DecodeError,
4140 > {
4141 #[allow(unused_imports)]
4142 use ::buffa::alloc::string::ToString as _;
4143 let _ = __buffa_src;
4144 ::core::result::Result::Ok(super::super::AssetChainVariant {
4145 zipped_asset_id: self.zipped_asset_id,
4146 chain_id: self.chain_id,
4147 is_native_asset: self.is_native_asset,
4148 network_fee: self.network_fee.to_string(),
4149 ztoken_address: self.ztoken_address.to_string(),
4150 source_address: self.source_address.to_string(),
4151 source_decimals: self.source_decimals,
4152 ztoken_decimals: self.ztoken_decimals,
4153 deposit_min_amount: self.deposit_min_amount.to_string(),
4154 withdraw_min_amount: self.withdraw_min_amount.to_string(),
4155 supply_q: self.supply_q,
4156 __buffa_unknown_fields: self
4157 .__buffa_unknown_fields
4158 .to_owned()?
4159 .into(),
4160 ..::core::default::Default::default()
4161 })
4162 }
4163 }
4164 impl<'a> ::buffa::ViewEncode<'a> for AssetChainVariantView<'a> {
4165 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4166 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4167 #[allow(unused_imports)]
4168 use ::buffa::Enumeration as _;
4169 let mut size = 0u32;
4170 if self.zipped_asset_id != 0u32 {
4171 size
4172 += 1u32
4173 + ::buffa::types::uint32_encoded_len(self.zipped_asset_id)
4174 as u32;
4175 }
4176 if self.chain_id != 0u32 {
4177 size
4178 += 1u32
4179 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
4180 }
4181 if self.is_native_asset {
4182 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
4183 }
4184 if !self.network_fee.is_empty() {
4185 size
4186 += 1u32
4187 + ::buffa::types::string_encoded_len(&self.network_fee)
4188 as u32;
4189 }
4190 if !self.ztoken_address.is_empty() {
4191 size
4192 += 1u32
4193 + ::buffa::types::string_encoded_len(&self.ztoken_address)
4194 as u32;
4195 }
4196 if !self.source_address.is_empty() {
4197 size
4198 += 1u32
4199 + ::buffa::types::string_encoded_len(&self.source_address)
4200 as u32;
4201 }
4202 if self.source_decimals != 0u32 {
4203 size
4204 += 1u32
4205 + ::buffa::types::uint32_encoded_len(self.source_decimals)
4206 as u32;
4207 }
4208 if self.ztoken_decimals != 0u32 {
4209 size
4210 += 1u32
4211 + ::buffa::types::uint32_encoded_len(self.ztoken_decimals)
4212 as u32;
4213 }
4214 if !self.deposit_min_amount.is_empty() {
4215 size
4216 += 1u32
4217 + ::buffa::types::string_encoded_len(
4218 &self.deposit_min_amount,
4219 ) as u32;
4220 }
4221 if !self.withdraw_min_amount.is_empty() {
4222 size
4223 += 1u32
4224 + ::buffa::types::string_encoded_len(
4225 &self.withdraw_min_amount,
4226 ) as u32;
4227 }
4228 if self.supply_q != 0u64 {
4229 size
4230 += 1u32
4231 + ::buffa::types::uint64_encoded_len(self.supply_q) as u32;
4232 }
4233 size += self.__buffa_unknown_fields.encoded_len() as u32;
4234 size
4235 }
4236 #[allow(clippy::needless_borrow)]
4237 fn write_to(
4238 &self,
4239 _cache: &mut ::buffa::SizeCache,
4240 buf: &mut impl ::buffa::bytes::BufMut,
4241 ) {
4242 #[allow(unused_imports)]
4243 use ::buffa::Enumeration as _;
4244 if self.zipped_asset_id != 0u32 {
4245 ::buffa::types::put_uint32_field(1u32, self.zipped_asset_id, buf);
4246 }
4247 if self.chain_id != 0u32 {
4248 ::buffa::types::put_uint32_field(2u32, self.chain_id, buf);
4249 }
4250 if self.is_native_asset {
4251 ::buffa::types::put_bool_field(3u32, self.is_native_asset, buf);
4252 }
4253 if !self.network_fee.is_empty() {
4254 ::buffa::types::put_string_field(4u32, &self.network_fee, buf);
4255 }
4256 if !self.ztoken_address.is_empty() {
4257 ::buffa::types::put_string_field(6u32, &self.ztoken_address, buf);
4258 }
4259 if !self.source_address.is_empty() {
4260 ::buffa::types::put_string_field(7u32, &self.source_address, buf);
4261 }
4262 if self.source_decimals != 0u32 {
4263 ::buffa::types::put_uint32_field(8u32, self.source_decimals, buf);
4264 }
4265 if self.ztoken_decimals != 0u32 {
4266 ::buffa::types::put_uint32_field(9u32, self.ztoken_decimals, buf);
4267 }
4268 if !self.deposit_min_amount.is_empty() {
4269 ::buffa::types::put_string_field(
4270 10u32,
4271 &self.deposit_min_amount,
4272 buf,
4273 );
4274 }
4275 if !self.withdraw_min_amount.is_empty() {
4276 ::buffa::types::put_string_field(
4277 11u32,
4278 &self.withdraw_min_amount,
4279 buf,
4280 );
4281 }
4282 if self.supply_q != 0u64 {
4283 ::buffa::types::put_uint64_field(12u32, self.supply_q, buf);
4284 }
4285 self.__buffa_unknown_fields.write_to(buf);
4286 }
4287 }
4288 impl<'__a> ::serde::Serialize for AssetChainVariantView<'__a> {
4300 fn serialize<__S: ::serde::Serializer>(
4301 &self,
4302 __s: __S,
4303 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4304 use ::serde::ser::SerializeMap as _;
4305 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4306 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.zipped_asset_id) {
4307 __map
4308 .serialize_entry(
4309 "zippedAssetId",
4310 &::buffa::json_helpers::ProtoJson(&self.zipped_asset_id),
4311 )?;
4312 }
4313 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.chain_id) {
4314 __map
4315 .serialize_entry(
4316 "chainId",
4317 &::buffa::json_helpers::ProtoJson(&self.chain_id),
4318 )?;
4319 }
4320 if self.is_native_asset {
4321 __map.serialize_entry("isNativeAsset", &self.is_native_asset)?;
4322 }
4323 if !::buffa::json_helpers::skip_if::is_empty_str(self.network_fee) {
4324 __map.serialize_entry("networkFee", self.network_fee)?;
4325 }
4326 if !::buffa::json_helpers::skip_if::is_empty_str(self.ztoken_address) {
4327 __map.serialize_entry("ztokenAddress", self.ztoken_address)?;
4328 }
4329 if !::buffa::json_helpers::skip_if::is_empty_str(self.source_address) {
4330 __map.serialize_entry("sourceAddress", self.source_address)?;
4331 }
4332 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.source_decimals) {
4333 __map
4334 .serialize_entry(
4335 "sourceDecimals",
4336 &::buffa::json_helpers::ProtoJson(&self.source_decimals),
4337 )?;
4338 }
4339 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.ztoken_decimals) {
4340 __map
4341 .serialize_entry(
4342 "ztokenDecimals",
4343 &::buffa::json_helpers::ProtoJson(&self.ztoken_decimals),
4344 )?;
4345 }
4346 if !::buffa::json_helpers::skip_if::is_empty_str(
4347 self.deposit_min_amount,
4348 ) {
4349 __map.serialize_entry("depositMinAmount", self.deposit_min_amount)?;
4350 }
4351 if !::buffa::json_helpers::skip_if::is_empty_str(
4352 self.withdraw_min_amount,
4353 ) {
4354 __map
4355 .serialize_entry("withdrawMinAmount", self.withdraw_min_amount)?;
4356 }
4357 if !::buffa::json_helpers::skip_if::is_zero_u64(&self.supply_q) {
4358 __map
4359 .serialize_entry(
4360 "supplyQ",
4361 &::buffa::json_helpers::ProtoJson(&self.supply_q),
4362 )?;
4363 }
4364 __map.end()
4365 }
4366 }
4367 impl<'a> ::buffa::MessageName for AssetChainVariantView<'a> {
4368 const PACKAGE: &'static str = "chain.zipper.v1";
4369 const NAME: &'static str = "AssetChainVariant";
4370 const FULL_NAME: &'static str = "chain.zipper.v1.AssetChainVariant";
4371 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetChainVariant";
4372 }
4373 ::buffa::impl_default_view_instance!(AssetChainVariantView);
4374 ::buffa::impl_view_reborrow!(AssetChainVariantView);
4375 #[derive(Clone, Debug)]
4381 pub struct AssetChainVariantOwnedView(
4382 ::buffa::OwnedView<AssetChainVariantView<'static>>,
4383 );
4384 impl AssetChainVariantOwnedView {
4385 pub fn decode(
4395 bytes: ::buffa::bytes::Bytes,
4396 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4397 ::core::result::Result::Ok(
4398 AssetChainVariantOwnedView(::buffa::OwnedView::decode(bytes)?),
4399 )
4400 }
4401 pub fn decode_with_options(
4409 bytes: ::buffa::bytes::Bytes,
4410 opts: &::buffa::DecodeOptions,
4411 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4412 ::core::result::Result::Ok(
4413 AssetChainVariantOwnedView(
4414 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4415 ),
4416 )
4417 }
4418 pub fn from_owned(
4425 msg: &super::super::AssetChainVariant,
4426 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4427 ::core::result::Result::Ok(
4428 AssetChainVariantOwnedView(::buffa::OwnedView::from_owned(msg)?),
4429 )
4430 }
4431 #[must_use]
4433 pub fn view(&self) -> &AssetChainVariantView<'_> {
4434 self.0.reborrow()
4435 }
4436 pub fn to_owned_message(
4443 &self,
4444 ) -> ::core::result::Result<
4445 super::super::AssetChainVariant,
4446 ::buffa::DecodeError,
4447 > {
4448 self.0.to_owned_message()
4449 }
4450 #[must_use]
4452 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4453 self.0.bytes()
4454 }
4455 #[must_use]
4457 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4458 self.0.into_bytes()
4459 }
4460 #[must_use]
4464 pub fn zipped_asset_id(&self) -> u32 {
4465 self.0.reborrow().zipped_asset_id
4466 }
4467 #[must_use]
4471 pub fn chain_id(&self) -> u32 {
4472 self.0.reborrow().chain_id
4473 }
4474 #[must_use]
4478 pub fn is_native_asset(&self) -> bool {
4479 self.0.reborrow().is_native_asset
4480 }
4481 #[must_use]
4486 pub fn network_fee(&self) -> &'_ str {
4487 self.0.reborrow().network_fee
4488 }
4489 #[must_use]
4493 pub fn ztoken_address(&self) -> &'_ str {
4494 self.0.reborrow().ztoken_address
4495 }
4496 #[must_use]
4500 pub fn source_address(&self) -> &'_ str {
4501 self.0.reborrow().source_address
4502 }
4503 #[must_use]
4507 pub fn source_decimals(&self) -> u32 {
4508 self.0.reborrow().source_decimals
4509 }
4510 #[must_use]
4514 pub fn ztoken_decimals(&self) -> u32 {
4515 self.0.reborrow().ztoken_decimals
4516 }
4517 #[must_use]
4521 pub fn deposit_min_amount(&self) -> &'_ str {
4522 self.0.reborrow().deposit_min_amount
4523 }
4524 #[must_use]
4528 pub fn withdraw_min_amount(&self) -> &'_ str {
4529 self.0.reborrow().withdraw_min_amount
4530 }
4531 #[must_use]
4536 pub fn supply_q(&self) -> u64 {
4537 self.0.reborrow().supply_q
4538 }
4539 }
4540 impl ::core::convert::From<::buffa::OwnedView<AssetChainVariantView<'static>>>
4541 for AssetChainVariantOwnedView {
4542 fn from(inner: ::buffa::OwnedView<AssetChainVariantView<'static>>) -> Self {
4543 AssetChainVariantOwnedView(inner)
4544 }
4545 }
4546 impl ::core::convert::From<AssetChainVariantOwnedView>
4547 for ::buffa::OwnedView<AssetChainVariantView<'static>> {
4548 fn from(wrapper: AssetChainVariantOwnedView) -> Self {
4549 wrapper.0
4550 }
4551 }
4552 impl ::core::convert::AsRef<::buffa::OwnedView<AssetChainVariantView<'static>>>
4553 for AssetChainVariantOwnedView {
4554 fn as_ref(&self) -> &::buffa::OwnedView<AssetChainVariantView<'static>> {
4555 &self.0
4556 }
4557 }
4558 impl ::buffa::HasMessageView for super::super::AssetChainVariant {
4559 type View<'a> = AssetChainVariantView<'a>;
4560 type ViewHandle = AssetChainVariantOwnedView;
4561 }
4562 impl ::serde::Serialize for AssetChainVariantOwnedView {
4563 fn serialize<__S: ::serde::Serializer>(
4564 &self,
4565 __s: __S,
4566 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4567 ::serde::Serialize::serialize(&self.0, __s)
4568 }
4569 }
4570 #[derive(Clone, Debug, Default)]
4573 pub struct ZippedAssetSupplyUpdateView<'a> {
4574 pub zipped_asset_id: u32,
4578 pub supply_q: u64,
4583 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4584 }
4585 impl<'a> ::buffa::MessageView<'a> for ZippedAssetSupplyUpdateView<'a> {
4586 type Owned = super::super::ZippedAssetSupplyUpdate;
4587 fn decode_view(
4588 buf: &'a [u8],
4589 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4590 let __limit = ::core::cell::Cell::new(
4591 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
4592 );
4593 <Self as ::buffa::MessageView>::decode_view_ctx(
4594 buf,
4595 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
4596 )
4597 }
4598 fn decode_view_with_ctx(
4599 buf: &'a [u8],
4600 ctx: ::buffa::DecodeContext<'_>,
4601 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4602 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
4603 }
4604 fn merge_view_field(
4605 &mut self,
4606 tag: ::buffa::encoding::Tag,
4607 cur: &'a [u8],
4608 before_tag: &'a [u8],
4609 ctx: ::buffa::DecodeContext<'_>,
4610 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
4611 let _ = ctx;
4612 #[allow(unused_variables)]
4613 let view = self;
4614 let mut cur = cur;
4615 match tag.field_number() {
4616 1u32 => {
4617 ::buffa::encoding::check_wire_type(
4618 tag,
4619 ::buffa::encoding::WireType::Varint,
4620 )?;
4621 view.zipped_asset_id = ::buffa::types::decode_uint32(&mut cur)?;
4622 }
4623 2u32 => {
4624 ::buffa::encoding::check_wire_type(
4625 tag,
4626 ::buffa::encoding::WireType::Varint,
4627 )?;
4628 view.supply_q = ::buffa::types::decode_uint64(&mut cur)?;
4629 }
4630 _ => {
4631 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
4632 let span_len = before_tag.len() - cur.len();
4633 view.__buffa_unknown_fields
4634 .push_record(before_tag, span_len, ctx)?;
4635 }
4636 }
4637 ::core::result::Result::Ok(cur)
4638 }
4639 fn to_owned_message(
4640 &self,
4641 ) -> ::core::result::Result<
4642 super::super::ZippedAssetSupplyUpdate,
4643 ::buffa::DecodeError,
4644 > {
4645 self.to_owned_from_source(None)
4646 }
4647 #[allow(clippy::useless_conversion, clippy::needless_update)]
4648 fn to_owned_from_source(
4649 &self,
4650 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4651 ) -> ::core::result::Result<
4652 super::super::ZippedAssetSupplyUpdate,
4653 ::buffa::DecodeError,
4654 > {
4655 #[allow(unused_imports)]
4656 use ::buffa::alloc::string::ToString as _;
4657 let _ = __buffa_src;
4658 ::core::result::Result::Ok(super::super::ZippedAssetSupplyUpdate {
4659 zipped_asset_id: self.zipped_asset_id,
4660 supply_q: self.supply_q,
4661 __buffa_unknown_fields: self
4662 .__buffa_unknown_fields
4663 .to_owned()?
4664 .into(),
4665 ..::core::default::Default::default()
4666 })
4667 }
4668 }
4669 impl<'a> ::buffa::ViewEncode<'a> for ZippedAssetSupplyUpdateView<'a> {
4670 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4671 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4672 #[allow(unused_imports)]
4673 use ::buffa::Enumeration as _;
4674 let mut size = 0u32;
4675 if self.zipped_asset_id != 0u32 {
4676 size
4677 += 1u32
4678 + ::buffa::types::uint32_encoded_len(self.zipped_asset_id)
4679 as u32;
4680 }
4681 if self.supply_q != 0u64 {
4682 size
4683 += 1u32
4684 + ::buffa::types::uint64_encoded_len(self.supply_q) as u32;
4685 }
4686 size += self.__buffa_unknown_fields.encoded_len() as u32;
4687 size
4688 }
4689 #[allow(clippy::needless_borrow)]
4690 fn write_to(
4691 &self,
4692 _cache: &mut ::buffa::SizeCache,
4693 buf: &mut impl ::buffa::bytes::BufMut,
4694 ) {
4695 #[allow(unused_imports)]
4696 use ::buffa::Enumeration as _;
4697 if self.zipped_asset_id != 0u32 {
4698 ::buffa::types::put_uint32_field(1u32, self.zipped_asset_id, buf);
4699 }
4700 if self.supply_q != 0u64 {
4701 ::buffa::types::put_uint64_field(2u32, self.supply_q, buf);
4702 }
4703 self.__buffa_unknown_fields.write_to(buf);
4704 }
4705 }
4706 impl<'__a> ::serde::Serialize for ZippedAssetSupplyUpdateView<'__a> {
4718 fn serialize<__S: ::serde::Serializer>(
4719 &self,
4720 __s: __S,
4721 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4722 use ::serde::ser::SerializeMap as _;
4723 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4724 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.zipped_asset_id) {
4725 __map
4726 .serialize_entry(
4727 "zippedAssetId",
4728 &::buffa::json_helpers::ProtoJson(&self.zipped_asset_id),
4729 )?;
4730 }
4731 if !::buffa::json_helpers::skip_if::is_zero_u64(&self.supply_q) {
4732 __map
4733 .serialize_entry(
4734 "supplyQ",
4735 &::buffa::json_helpers::ProtoJson(&self.supply_q),
4736 )?;
4737 }
4738 __map.end()
4739 }
4740 }
4741 impl<'a> ::buffa::MessageName for ZippedAssetSupplyUpdateView<'a> {
4742 const PACKAGE: &'static str = "chain.zipper.v1";
4743 const NAME: &'static str = "ZippedAssetSupplyUpdate";
4744 const FULL_NAME: &'static str = "chain.zipper.v1.ZippedAssetSupplyUpdate";
4745 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyUpdate";
4746 }
4747 ::buffa::impl_default_view_instance!(ZippedAssetSupplyUpdateView);
4748 ::buffa::impl_view_reborrow!(ZippedAssetSupplyUpdateView);
4749 #[derive(Clone, Debug)]
4755 pub struct ZippedAssetSupplyUpdateOwnedView(
4756 ::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>>,
4757 );
4758 impl ZippedAssetSupplyUpdateOwnedView {
4759 pub fn decode(
4769 bytes: ::buffa::bytes::Bytes,
4770 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4771 ::core::result::Result::Ok(
4772 ZippedAssetSupplyUpdateOwnedView(::buffa::OwnedView::decode(bytes)?),
4773 )
4774 }
4775 pub fn decode_with_options(
4783 bytes: ::buffa::bytes::Bytes,
4784 opts: &::buffa::DecodeOptions,
4785 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4786 ::core::result::Result::Ok(
4787 ZippedAssetSupplyUpdateOwnedView(
4788 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4789 ),
4790 )
4791 }
4792 pub fn from_owned(
4799 msg: &super::super::ZippedAssetSupplyUpdate,
4800 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4801 ::core::result::Result::Ok(
4802 ZippedAssetSupplyUpdateOwnedView(
4803 ::buffa::OwnedView::from_owned(msg)?,
4804 ),
4805 )
4806 }
4807 #[must_use]
4809 pub fn view(&self) -> &ZippedAssetSupplyUpdateView<'_> {
4810 self.0.reborrow()
4811 }
4812 pub fn to_owned_message(
4819 &self,
4820 ) -> ::core::result::Result<
4821 super::super::ZippedAssetSupplyUpdate,
4822 ::buffa::DecodeError,
4823 > {
4824 self.0.to_owned_message()
4825 }
4826 #[must_use]
4828 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4829 self.0.bytes()
4830 }
4831 #[must_use]
4833 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4834 self.0.into_bytes()
4835 }
4836 #[must_use]
4840 pub fn zipped_asset_id(&self) -> u32 {
4841 self.0.reborrow().zipped_asset_id
4842 }
4843 #[must_use]
4848 pub fn supply_q(&self) -> u64 {
4849 self.0.reborrow().supply_q
4850 }
4851 }
4852 impl ::core::convert::From<
4853 ::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>>,
4854 > for ZippedAssetSupplyUpdateOwnedView {
4855 fn from(
4856 inner: ::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>>,
4857 ) -> Self {
4858 ZippedAssetSupplyUpdateOwnedView(inner)
4859 }
4860 }
4861 impl ::core::convert::From<ZippedAssetSupplyUpdateOwnedView>
4862 for ::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>> {
4863 fn from(wrapper: ZippedAssetSupplyUpdateOwnedView) -> Self {
4864 wrapper.0
4865 }
4866 }
4867 impl ::core::convert::AsRef<
4868 ::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>>,
4869 > for ZippedAssetSupplyUpdateOwnedView {
4870 fn as_ref(
4871 &self,
4872 ) -> &::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>> {
4873 &self.0
4874 }
4875 }
4876 impl ::buffa::HasMessageView for super::super::ZippedAssetSupplyUpdate {
4877 type View<'a> = ZippedAssetSupplyUpdateView<'a>;
4878 type ViewHandle = ZippedAssetSupplyUpdateOwnedView;
4879 }
4880 impl ::serde::Serialize for ZippedAssetSupplyUpdateOwnedView {
4881 fn serialize<__S: ::serde::Serializer>(
4882 &self,
4883 __s: __S,
4884 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4885 ::serde::Serialize::serialize(&self.0, __s)
4886 }
4887 }
4888 #[derive(Clone, Debug, Default)]
4890 pub struct ZippedAssetSupplyBatchView<'a> {
4891 pub updates: ::buffa::RepeatedView<
4895 'a,
4896 super::super::__buffa::view::ZippedAssetSupplyUpdateView<'a>,
4897 >,
4898 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4899 }
4900 impl<'a> ::buffa::MessageView<'a> for ZippedAssetSupplyBatchView<'a> {
4901 type Owned = super::super::ZippedAssetSupplyBatch;
4902 fn decode_view(
4903 buf: &'a [u8],
4904 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4905 let __limit = ::core::cell::Cell::new(
4906 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
4907 );
4908 <Self as ::buffa::MessageView>::decode_view_ctx(
4909 buf,
4910 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
4911 )
4912 }
4913 fn decode_view_with_ctx(
4914 buf: &'a [u8],
4915 ctx: ::buffa::DecodeContext<'_>,
4916 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4917 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
4918 }
4919 fn merge_view_field(
4920 &mut self,
4921 tag: ::buffa::encoding::Tag,
4922 cur: &'a [u8],
4923 before_tag: &'a [u8],
4924 ctx: ::buffa::DecodeContext<'_>,
4925 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
4926 let _ = ctx;
4927 #[allow(unused_variables)]
4928 let view = self;
4929 let mut cur = cur;
4930 match tag.field_number() {
4931 1u32 => {
4932 ::buffa::encoding::check_wire_type(
4933 tag,
4934 ::buffa::encoding::WireType::LengthDelimited,
4935 )?;
4936 let __sub_ctx = ctx.descend()?;
4937 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4938 view.updates
4939 .push(
4940 <super::super::__buffa::view::ZippedAssetSupplyUpdateView as ::buffa::MessageView>::decode_view_ctx(
4941 sub,
4942 __sub_ctx,
4943 )?,
4944 );
4945 }
4946 _ => {
4947 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
4948 let span_len = before_tag.len() - cur.len();
4949 view.__buffa_unknown_fields
4950 .push_record(before_tag, span_len, ctx)?;
4951 }
4952 }
4953 ::core::result::Result::Ok(cur)
4954 }
4955 fn to_owned_message(
4956 &self,
4957 ) -> ::core::result::Result<
4958 super::super::ZippedAssetSupplyBatch,
4959 ::buffa::DecodeError,
4960 > {
4961 self.to_owned_from_source(None)
4962 }
4963 #[allow(clippy::useless_conversion, clippy::needless_update)]
4964 fn to_owned_from_source(
4965 &self,
4966 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4967 ) -> ::core::result::Result<
4968 super::super::ZippedAssetSupplyBatch,
4969 ::buffa::DecodeError,
4970 > {
4971 #[allow(unused_imports)]
4972 use ::buffa::alloc::string::ToString as _;
4973 let _ = __buffa_src;
4974 ::core::result::Result::Ok(super::super::ZippedAssetSupplyBatch {
4975 updates: self
4976 .updates
4977 .iter()
4978 .map(|v| v.to_owned_from_source(__buffa_src))
4979 .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
4980 __buffa_unknown_fields: self
4981 .__buffa_unknown_fields
4982 .to_owned()?
4983 .into(),
4984 ..::core::default::Default::default()
4985 })
4986 }
4987 }
4988 impl<'a> ::buffa::ViewEncode<'a> for ZippedAssetSupplyBatchView<'a> {
4989 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4990 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4991 #[allow(unused_imports)]
4992 use ::buffa::Enumeration as _;
4993 let mut size = 0u32;
4994 for v in &self.updates {
4995 let __slot = __cache.reserve();
4996 let inner_size = v.compute_size(__cache);
4997 __cache.set(__slot, inner_size);
4998 size
4999 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5000 + inner_size;
5001 }
5002 size += self.__buffa_unknown_fields.encoded_len() as u32;
5003 size
5004 }
5005 #[allow(clippy::needless_borrow)]
5006 fn write_to(
5007 &self,
5008 __cache: &mut ::buffa::SizeCache,
5009 buf: &mut impl ::buffa::bytes::BufMut,
5010 ) {
5011 #[allow(unused_imports)]
5012 use ::buffa::Enumeration as _;
5013 for v in &self.updates {
5014 ::buffa::types::put_len_delimited_header(
5015 1u32,
5016 __cache.consume_next(),
5017 buf,
5018 );
5019 v.write_to(__cache, buf);
5020 }
5021 self.__buffa_unknown_fields.write_to(buf);
5022 }
5023 }
5024 impl<'__a> ::serde::Serialize for ZippedAssetSupplyBatchView<'__a> {
5036 fn serialize<__S: ::serde::Serializer>(
5037 &self,
5038 __s: __S,
5039 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5040 use ::serde::ser::SerializeMap as _;
5041 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5042 if !self.updates.is_empty() {
5043 __map.serialize_entry("updates", &*self.updates)?;
5044 }
5045 __map.end()
5046 }
5047 }
5048 impl<'a> ::buffa::MessageName for ZippedAssetSupplyBatchView<'a> {
5049 const PACKAGE: &'static str = "chain.zipper.v1";
5050 const NAME: &'static str = "ZippedAssetSupplyBatch";
5051 const FULL_NAME: &'static str = "chain.zipper.v1.ZippedAssetSupplyBatch";
5052 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyBatch";
5053 }
5054 ::buffa::impl_default_view_instance!(ZippedAssetSupplyBatchView);
5055 ::buffa::impl_view_reborrow!(ZippedAssetSupplyBatchView);
5056 #[derive(Clone, Debug)]
5062 pub struct ZippedAssetSupplyBatchOwnedView(
5063 ::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>>,
5064 );
5065 impl ZippedAssetSupplyBatchOwnedView {
5066 pub fn decode(
5076 bytes: ::buffa::bytes::Bytes,
5077 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5078 ::core::result::Result::Ok(
5079 ZippedAssetSupplyBatchOwnedView(::buffa::OwnedView::decode(bytes)?),
5080 )
5081 }
5082 pub fn decode_with_options(
5090 bytes: ::buffa::bytes::Bytes,
5091 opts: &::buffa::DecodeOptions,
5092 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5093 ::core::result::Result::Ok(
5094 ZippedAssetSupplyBatchOwnedView(
5095 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5096 ),
5097 )
5098 }
5099 pub fn from_owned(
5106 msg: &super::super::ZippedAssetSupplyBatch,
5107 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5108 ::core::result::Result::Ok(
5109 ZippedAssetSupplyBatchOwnedView(::buffa::OwnedView::from_owned(msg)?),
5110 )
5111 }
5112 #[must_use]
5114 pub fn view(&self) -> &ZippedAssetSupplyBatchView<'_> {
5115 self.0.reborrow()
5116 }
5117 pub fn to_owned_message(
5124 &self,
5125 ) -> ::core::result::Result<
5126 super::super::ZippedAssetSupplyBatch,
5127 ::buffa::DecodeError,
5128 > {
5129 self.0.to_owned_message()
5130 }
5131 #[must_use]
5133 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5134 self.0.bytes()
5135 }
5136 #[must_use]
5138 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5139 self.0.into_bytes()
5140 }
5141 #[must_use]
5145 pub fn updates(
5146 &self,
5147 ) -> &::buffa::RepeatedView<
5148 '_,
5149 super::super::__buffa::view::ZippedAssetSupplyUpdateView<'_>,
5150 > {
5151 &self.0.reborrow().updates
5152 }
5153 }
5154 impl ::core::convert::From<
5155 ::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>>,
5156 > for ZippedAssetSupplyBatchOwnedView {
5157 fn from(
5158 inner: ::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>>,
5159 ) -> Self {
5160 ZippedAssetSupplyBatchOwnedView(inner)
5161 }
5162 }
5163 impl ::core::convert::From<ZippedAssetSupplyBatchOwnedView>
5164 for ::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>> {
5165 fn from(wrapper: ZippedAssetSupplyBatchOwnedView) -> Self {
5166 wrapper.0
5167 }
5168 }
5169 impl ::core::convert::AsRef<
5170 ::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>>,
5171 > for ZippedAssetSupplyBatchOwnedView {
5172 fn as_ref(
5173 &self,
5174 ) -> &::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>> {
5175 &self.0
5176 }
5177 }
5178 impl ::buffa::HasMessageView for super::super::ZippedAssetSupplyBatch {
5179 type View<'a> = ZippedAssetSupplyBatchView<'a>;
5180 type ViewHandle = ZippedAssetSupplyBatchOwnedView;
5181 }
5182 impl ::serde::Serialize for ZippedAssetSupplyBatchOwnedView {
5183 fn serialize<__S: ::serde::Serializer>(
5184 &self,
5185 __s: __S,
5186 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5187 ::serde::Serialize::serialize(&self.0, __s)
5188 }
5189 }
5190 #[derive(Clone, Debug, Default)]
5193 pub struct AssetConfigView<'a> {
5194 pub asset: &'a str,
5198 pub ledger_id: u32,
5202 pub name: &'a str,
5206 pub icon: &'a str,
5210 pub quantity_scale: u32,
5216 pub quantity_display_decimals: u32,
5220 pub variants: ::buffa::RepeatedView<
5224 'a,
5225 super::super::__buffa::view::AssetChainVariantView<'a>,
5226 >,
5227 pub u_asset_id: &'a str,
5231 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5232 }
5233 impl<'a> ::buffa::MessageView<'a> for AssetConfigView<'a> {
5234 type Owned = super::super::AssetConfig;
5235 fn decode_view(
5236 buf: &'a [u8],
5237 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5238 let __limit = ::core::cell::Cell::new(
5239 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
5240 );
5241 <Self as ::buffa::MessageView>::decode_view_ctx(
5242 buf,
5243 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
5244 )
5245 }
5246 fn decode_view_with_ctx(
5247 buf: &'a [u8],
5248 ctx: ::buffa::DecodeContext<'_>,
5249 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5250 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
5251 }
5252 fn merge_view_field(
5253 &mut self,
5254 tag: ::buffa::encoding::Tag,
5255 cur: &'a [u8],
5256 before_tag: &'a [u8],
5257 ctx: ::buffa::DecodeContext<'_>,
5258 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
5259 let _ = ctx;
5260 #[allow(unused_variables)]
5261 let view = self;
5262 let mut cur = cur;
5263 match tag.field_number() {
5264 1u32 => {
5265 ::buffa::encoding::check_wire_type(
5266 tag,
5267 ::buffa::encoding::WireType::LengthDelimited,
5268 )?;
5269 view.asset = ::buffa::types::borrow_str(&mut cur)?;
5270 }
5271 2u32 => {
5272 ::buffa::encoding::check_wire_type(
5273 tag,
5274 ::buffa::encoding::WireType::Varint,
5275 )?;
5276 view.ledger_id = ::buffa::types::decode_uint32(&mut cur)?;
5277 }
5278 3u32 => {
5279 ::buffa::encoding::check_wire_type(
5280 tag,
5281 ::buffa::encoding::WireType::LengthDelimited,
5282 )?;
5283 view.name = ::buffa::types::borrow_str(&mut cur)?;
5284 }
5285 4u32 => {
5286 ::buffa::encoding::check_wire_type(
5287 tag,
5288 ::buffa::encoding::WireType::LengthDelimited,
5289 )?;
5290 view.icon = ::buffa::types::borrow_str(&mut cur)?;
5291 }
5292 5u32 => {
5293 ::buffa::encoding::check_wire_type(
5294 tag,
5295 ::buffa::encoding::WireType::Varint,
5296 )?;
5297 view.quantity_scale = ::buffa::types::decode_uint32(&mut cur)?;
5298 }
5299 6u32 => {
5300 ::buffa::encoding::check_wire_type(
5301 tag,
5302 ::buffa::encoding::WireType::Varint,
5303 )?;
5304 view.quantity_display_decimals = ::buffa::types::decode_uint32(
5305 &mut cur,
5306 )?;
5307 }
5308 8u32 => {
5309 ::buffa::encoding::check_wire_type(
5310 tag,
5311 ::buffa::encoding::WireType::LengthDelimited,
5312 )?;
5313 view.u_asset_id = ::buffa::types::borrow_str(&mut cur)?;
5314 }
5315 7u32 => {
5316 ::buffa::encoding::check_wire_type(
5317 tag,
5318 ::buffa::encoding::WireType::LengthDelimited,
5319 )?;
5320 let __sub_ctx = ctx.descend()?;
5321 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
5322 view.variants
5323 .push(
5324 <super::super::__buffa::view::AssetChainVariantView as ::buffa::MessageView>::decode_view_ctx(
5325 sub,
5326 __sub_ctx,
5327 )?,
5328 );
5329 }
5330 _ => {
5331 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
5332 let span_len = before_tag.len() - cur.len();
5333 view.__buffa_unknown_fields
5334 .push_record(before_tag, span_len, ctx)?;
5335 }
5336 }
5337 ::core::result::Result::Ok(cur)
5338 }
5339 fn to_owned_message(
5340 &self,
5341 ) -> ::core::result::Result<
5342 super::super::AssetConfig,
5343 ::buffa::DecodeError,
5344 > {
5345 self.to_owned_from_source(None)
5346 }
5347 #[allow(clippy::useless_conversion, clippy::needless_update)]
5348 fn to_owned_from_source(
5349 &self,
5350 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5351 ) -> ::core::result::Result<
5352 super::super::AssetConfig,
5353 ::buffa::DecodeError,
5354 > {
5355 #[allow(unused_imports)]
5356 use ::buffa::alloc::string::ToString as _;
5357 let _ = __buffa_src;
5358 ::core::result::Result::Ok(super::super::AssetConfig {
5359 asset: self.asset.to_string(),
5360 ledger_id: self.ledger_id,
5361 name: self.name.to_string(),
5362 icon: self.icon.to_string(),
5363 quantity_scale: self.quantity_scale,
5364 quantity_display_decimals: self.quantity_display_decimals,
5365 variants: self
5366 .variants
5367 .iter()
5368 .map(|v| v.to_owned_from_source(__buffa_src))
5369 .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
5370 u_asset_id: self.u_asset_id.to_string(),
5371 __buffa_unknown_fields: self
5372 .__buffa_unknown_fields
5373 .to_owned()?
5374 .into(),
5375 ..::core::default::Default::default()
5376 })
5377 }
5378 }
5379 impl<'a> ::buffa::ViewEncode<'a> for AssetConfigView<'a> {
5380 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5381 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
5382 #[allow(unused_imports)]
5383 use ::buffa::Enumeration as _;
5384 let mut size = 0u32;
5385 if !self.asset.is_empty() {
5386 size
5387 += 1u32 + ::buffa::types::string_encoded_len(&self.asset) as u32;
5388 }
5389 if self.ledger_id != 0u32 {
5390 size
5391 += 1u32
5392 + ::buffa::types::uint32_encoded_len(self.ledger_id) as u32;
5393 }
5394 if !self.name.is_empty() {
5395 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5396 }
5397 if !self.icon.is_empty() {
5398 size += 1u32 + ::buffa::types::string_encoded_len(&self.icon) as u32;
5399 }
5400 if self.quantity_scale != 0u32 {
5401 size
5402 += 1u32
5403 + ::buffa::types::uint32_encoded_len(self.quantity_scale)
5404 as u32;
5405 }
5406 if self.quantity_display_decimals != 0u32 {
5407 size
5408 += 1u32
5409 + ::buffa::types::uint32_encoded_len(
5410 self.quantity_display_decimals,
5411 ) as u32;
5412 }
5413 for v in &self.variants {
5414 let __slot = __cache.reserve();
5415 let inner_size = v.compute_size(__cache);
5416 __cache.set(__slot, inner_size);
5417 size
5418 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
5419 + inner_size;
5420 }
5421 if !self.u_asset_id.is_empty() {
5422 size
5423 += 1u32
5424 + ::buffa::types::string_encoded_len(&self.u_asset_id)
5425 as u32;
5426 }
5427 size += self.__buffa_unknown_fields.encoded_len() as u32;
5428 size
5429 }
5430 #[allow(clippy::needless_borrow)]
5431 fn write_to(
5432 &self,
5433 __cache: &mut ::buffa::SizeCache,
5434 buf: &mut impl ::buffa::bytes::BufMut,
5435 ) {
5436 #[allow(unused_imports)]
5437 use ::buffa::Enumeration as _;
5438 if !self.asset.is_empty() {
5439 ::buffa::types::put_string_field(1u32, &self.asset, buf);
5440 }
5441 if self.ledger_id != 0u32 {
5442 ::buffa::types::put_uint32_field(2u32, self.ledger_id, buf);
5443 }
5444 if !self.name.is_empty() {
5445 ::buffa::types::put_string_field(3u32, &self.name, buf);
5446 }
5447 if !self.icon.is_empty() {
5448 ::buffa::types::put_string_field(4u32, &self.icon, buf);
5449 }
5450 if self.quantity_scale != 0u32 {
5451 ::buffa::types::put_uint32_field(5u32, self.quantity_scale, buf);
5452 }
5453 if self.quantity_display_decimals != 0u32 {
5454 ::buffa::types::put_uint32_field(
5455 6u32,
5456 self.quantity_display_decimals,
5457 buf,
5458 );
5459 }
5460 for v in &self.variants {
5461 ::buffa::types::put_len_delimited_header(
5462 7u32,
5463 __cache.consume_next(),
5464 buf,
5465 );
5466 v.write_to(__cache, buf);
5467 }
5468 if !self.u_asset_id.is_empty() {
5469 ::buffa::types::put_string_field(8u32, &self.u_asset_id, buf);
5470 }
5471 self.__buffa_unknown_fields.write_to(buf);
5472 }
5473 }
5474 impl<'__a> ::serde::Serialize for AssetConfigView<'__a> {
5486 fn serialize<__S: ::serde::Serializer>(
5487 &self,
5488 __s: __S,
5489 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5490 use ::serde::ser::SerializeMap as _;
5491 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5492 if !::buffa::json_helpers::skip_if::is_empty_str(self.asset) {
5493 __map.serialize_entry("asset", self.asset)?;
5494 }
5495 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.ledger_id) {
5496 __map
5497 .serialize_entry(
5498 "ledgerId",
5499 &::buffa::json_helpers::ProtoJson(&self.ledger_id),
5500 )?;
5501 }
5502 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5503 __map.serialize_entry("name", self.name)?;
5504 }
5505 if !::buffa::json_helpers::skip_if::is_empty_str(self.icon) {
5506 __map.serialize_entry("icon", self.icon)?;
5507 }
5508 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.quantity_scale) {
5509 __map
5510 .serialize_entry(
5511 "quantityScale",
5512 &::buffa::json_helpers::ProtoJson(&self.quantity_scale),
5513 )?;
5514 }
5515 if !::buffa::json_helpers::skip_if::is_zero_u32(
5516 &self.quantity_display_decimals,
5517 ) {
5518 __map
5519 .serialize_entry(
5520 "quantityDisplayDecimals",
5521 &::buffa::json_helpers::ProtoJson(
5522 &self.quantity_display_decimals,
5523 ),
5524 )?;
5525 }
5526 if !self.variants.is_empty() {
5527 __map.serialize_entry("variants", &*self.variants)?;
5528 }
5529 if !::buffa::json_helpers::skip_if::is_empty_str(self.u_asset_id) {
5530 __map.serialize_entry("uAssetId", self.u_asset_id)?;
5531 }
5532 __map.end()
5533 }
5534 }
5535 impl<'a> ::buffa::MessageName for AssetConfigView<'a> {
5536 const PACKAGE: &'static str = "chain.zipper.v1";
5537 const NAME: &'static str = "AssetConfig";
5538 const FULL_NAME: &'static str = "chain.zipper.v1.AssetConfig";
5539 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetConfig";
5540 }
5541 ::buffa::impl_default_view_instance!(AssetConfigView);
5542 ::buffa::impl_view_reborrow!(AssetConfigView);
5543 #[derive(Clone, Debug)]
5549 pub struct AssetConfigOwnedView(::buffa::OwnedView<AssetConfigView<'static>>);
5550 impl AssetConfigOwnedView {
5551 pub fn decode(
5561 bytes: ::buffa::bytes::Bytes,
5562 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5563 ::core::result::Result::Ok(
5564 AssetConfigOwnedView(::buffa::OwnedView::decode(bytes)?),
5565 )
5566 }
5567 pub fn decode_with_options(
5575 bytes: ::buffa::bytes::Bytes,
5576 opts: &::buffa::DecodeOptions,
5577 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5578 ::core::result::Result::Ok(
5579 AssetConfigOwnedView(
5580 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5581 ),
5582 )
5583 }
5584 pub fn from_owned(
5591 msg: &super::super::AssetConfig,
5592 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5593 ::core::result::Result::Ok(
5594 AssetConfigOwnedView(::buffa::OwnedView::from_owned(msg)?),
5595 )
5596 }
5597 #[must_use]
5599 pub fn view(&self) -> &AssetConfigView<'_> {
5600 self.0.reborrow()
5601 }
5602 pub fn to_owned_message(
5609 &self,
5610 ) -> ::core::result::Result<
5611 super::super::AssetConfig,
5612 ::buffa::DecodeError,
5613 > {
5614 self.0.to_owned_message()
5615 }
5616 #[must_use]
5618 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5619 self.0.bytes()
5620 }
5621 #[must_use]
5623 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5624 self.0.into_bytes()
5625 }
5626 #[must_use]
5630 pub fn asset(&self) -> &'_ str {
5631 self.0.reborrow().asset
5632 }
5633 #[must_use]
5637 pub fn ledger_id(&self) -> u32 {
5638 self.0.reborrow().ledger_id
5639 }
5640 #[must_use]
5644 pub fn name(&self) -> &'_ str {
5645 self.0.reborrow().name
5646 }
5647 #[must_use]
5651 pub fn icon(&self) -> &'_ str {
5652 self.0.reborrow().icon
5653 }
5654 #[must_use]
5660 pub fn quantity_scale(&self) -> u32 {
5661 self.0.reborrow().quantity_scale
5662 }
5663 #[must_use]
5667 pub fn quantity_display_decimals(&self) -> u32 {
5668 self.0.reborrow().quantity_display_decimals
5669 }
5670 #[must_use]
5674 pub fn variants(
5675 &self,
5676 ) -> &::buffa::RepeatedView<
5677 '_,
5678 super::super::__buffa::view::AssetChainVariantView<'_>,
5679 > {
5680 &self.0.reborrow().variants
5681 }
5682 #[must_use]
5686 pub fn u_asset_id(&self) -> &'_ str {
5687 self.0.reborrow().u_asset_id
5688 }
5689 }
5690 impl ::core::convert::From<::buffa::OwnedView<AssetConfigView<'static>>>
5691 for AssetConfigOwnedView {
5692 fn from(inner: ::buffa::OwnedView<AssetConfigView<'static>>) -> Self {
5693 AssetConfigOwnedView(inner)
5694 }
5695 }
5696 impl ::core::convert::From<AssetConfigOwnedView>
5697 for ::buffa::OwnedView<AssetConfigView<'static>> {
5698 fn from(wrapper: AssetConfigOwnedView) -> Self {
5699 wrapper.0
5700 }
5701 }
5702 impl ::core::convert::AsRef<::buffa::OwnedView<AssetConfigView<'static>>>
5703 for AssetConfigOwnedView {
5704 fn as_ref(&self) -> &::buffa::OwnedView<AssetConfigView<'static>> {
5705 &self.0
5706 }
5707 }
5708 impl ::buffa::HasMessageView for super::super::AssetConfig {
5709 type View<'a> = AssetConfigView<'a>;
5710 type ViewHandle = AssetConfigOwnedView;
5711 }
5712 impl ::serde::Serialize for AssetConfigOwnedView {
5713 fn serialize<__S: ::serde::Serializer>(
5714 &self,
5715 __s: __S,
5716 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5717 ::serde::Serialize::serialize(&self.0, __s)
5718 }
5719 }
5720 #[derive(Clone, Debug, Default)]
5723 pub struct ChainContractConfigView<'a> {
5724 pub name: &'a str,
5728 pub address: &'a str,
5732 pub r#type: &'a str,
5736 pub description: &'a str,
5740 pub version: u32,
5745 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5746 }
5747 impl<'a> ::buffa::MessageView<'a> for ChainContractConfigView<'a> {
5748 type Owned = super::super::ChainContractConfig;
5749 fn decode_view(
5750 buf: &'a [u8],
5751 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5752 let __limit = ::core::cell::Cell::new(
5753 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
5754 );
5755 <Self as ::buffa::MessageView>::decode_view_ctx(
5756 buf,
5757 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
5758 )
5759 }
5760 fn decode_view_with_ctx(
5761 buf: &'a [u8],
5762 ctx: ::buffa::DecodeContext<'_>,
5763 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5764 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
5765 }
5766 fn merge_view_field(
5767 &mut self,
5768 tag: ::buffa::encoding::Tag,
5769 cur: &'a [u8],
5770 before_tag: &'a [u8],
5771 ctx: ::buffa::DecodeContext<'_>,
5772 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
5773 let _ = ctx;
5774 #[allow(unused_variables)]
5775 let view = self;
5776 let mut cur = cur;
5777 match tag.field_number() {
5778 1u32 => {
5779 ::buffa::encoding::check_wire_type(
5780 tag,
5781 ::buffa::encoding::WireType::LengthDelimited,
5782 )?;
5783 view.name = ::buffa::types::borrow_str(&mut cur)?;
5784 }
5785 2u32 => {
5786 ::buffa::encoding::check_wire_type(
5787 tag,
5788 ::buffa::encoding::WireType::LengthDelimited,
5789 )?;
5790 view.address = ::buffa::types::borrow_str(&mut cur)?;
5791 }
5792 3u32 => {
5793 ::buffa::encoding::check_wire_type(
5794 tag,
5795 ::buffa::encoding::WireType::LengthDelimited,
5796 )?;
5797 view.r#type = ::buffa::types::borrow_str(&mut cur)?;
5798 }
5799 4u32 => {
5800 ::buffa::encoding::check_wire_type(
5801 tag,
5802 ::buffa::encoding::WireType::LengthDelimited,
5803 )?;
5804 view.description = ::buffa::types::borrow_str(&mut cur)?;
5805 }
5806 5u32 => {
5807 ::buffa::encoding::check_wire_type(
5808 tag,
5809 ::buffa::encoding::WireType::Varint,
5810 )?;
5811 view.version = ::buffa::types::decode_uint32(&mut cur)?;
5812 }
5813 _ => {
5814 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
5815 let span_len = before_tag.len() - cur.len();
5816 view.__buffa_unknown_fields
5817 .push_record(before_tag, span_len, ctx)?;
5818 }
5819 }
5820 ::core::result::Result::Ok(cur)
5821 }
5822 fn to_owned_message(
5823 &self,
5824 ) -> ::core::result::Result<
5825 super::super::ChainContractConfig,
5826 ::buffa::DecodeError,
5827 > {
5828 self.to_owned_from_source(None)
5829 }
5830 #[allow(clippy::useless_conversion, clippy::needless_update)]
5831 fn to_owned_from_source(
5832 &self,
5833 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5834 ) -> ::core::result::Result<
5835 super::super::ChainContractConfig,
5836 ::buffa::DecodeError,
5837 > {
5838 #[allow(unused_imports)]
5839 use ::buffa::alloc::string::ToString as _;
5840 let _ = __buffa_src;
5841 ::core::result::Result::Ok(super::super::ChainContractConfig {
5842 name: self.name.to_string(),
5843 address: self.address.to_string(),
5844 r#type: self.r#type.to_string(),
5845 description: self.description.to_string(),
5846 version: self.version,
5847 __buffa_unknown_fields: self
5848 .__buffa_unknown_fields
5849 .to_owned()?
5850 .into(),
5851 ..::core::default::Default::default()
5852 })
5853 }
5854 }
5855 impl<'a> ::buffa::ViewEncode<'a> for ChainContractConfigView<'a> {
5856 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5857 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5858 #[allow(unused_imports)]
5859 use ::buffa::Enumeration as _;
5860 let mut size = 0u32;
5861 if !self.name.is_empty() {
5862 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5863 }
5864 if !self.address.is_empty() {
5865 size
5866 += 1u32
5867 + ::buffa::types::string_encoded_len(&self.address) as u32;
5868 }
5869 if !self.r#type.is_empty() {
5870 size
5871 += 1u32
5872 + ::buffa::types::string_encoded_len(&self.r#type) as u32;
5873 }
5874 if !self.description.is_empty() {
5875 size
5876 += 1u32
5877 + ::buffa::types::string_encoded_len(&self.description)
5878 as u32;
5879 }
5880 if self.version != 0u32 {
5881 size
5882 += 1u32
5883 + ::buffa::types::uint32_encoded_len(self.version) as u32;
5884 }
5885 size += self.__buffa_unknown_fields.encoded_len() as u32;
5886 size
5887 }
5888 #[allow(clippy::needless_borrow)]
5889 fn write_to(
5890 &self,
5891 _cache: &mut ::buffa::SizeCache,
5892 buf: &mut impl ::buffa::bytes::BufMut,
5893 ) {
5894 #[allow(unused_imports)]
5895 use ::buffa::Enumeration as _;
5896 if !self.name.is_empty() {
5897 ::buffa::types::put_string_field(1u32, &self.name, buf);
5898 }
5899 if !self.address.is_empty() {
5900 ::buffa::types::put_string_field(2u32, &self.address, buf);
5901 }
5902 if !self.r#type.is_empty() {
5903 ::buffa::types::put_string_field(3u32, &self.r#type, buf);
5904 }
5905 if !self.description.is_empty() {
5906 ::buffa::types::put_string_field(4u32, &self.description, buf);
5907 }
5908 if self.version != 0u32 {
5909 ::buffa::types::put_uint32_field(5u32, self.version, buf);
5910 }
5911 self.__buffa_unknown_fields.write_to(buf);
5912 }
5913 }
5914 impl<'__a> ::serde::Serialize for ChainContractConfigView<'__a> {
5926 fn serialize<__S: ::serde::Serializer>(
5927 &self,
5928 __s: __S,
5929 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5930 use ::serde::ser::SerializeMap as _;
5931 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5932 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5933 __map.serialize_entry("name", self.name)?;
5934 }
5935 if !::buffa::json_helpers::skip_if::is_empty_str(self.address) {
5936 __map.serialize_entry("address", self.address)?;
5937 }
5938 if !::buffa::json_helpers::skip_if::is_empty_str(self.r#type) {
5939 __map.serialize_entry("type", self.r#type)?;
5940 }
5941 if !::buffa::json_helpers::skip_if::is_empty_str(self.description) {
5942 __map.serialize_entry("description", self.description)?;
5943 }
5944 if !::buffa::json_helpers::skip_if::is_zero_u32(&self.version) {
5945 __map
5946 .serialize_entry(
5947 "version",
5948 &::buffa::json_helpers::ProtoJson(&self.version),
5949 )?;
5950 }
5951 __map.end()
5952 }
5953 }
5954 impl<'a> ::buffa::MessageName for ChainContractConfigView<'a> {
5955 const PACKAGE: &'static str = "chain.zipper.v1";
5956 const NAME: &'static str = "ChainContractConfig";
5957 const FULL_NAME: &'static str = "chain.zipper.v1.ChainContractConfig";
5958 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainContractConfig";
5959 }
5960 ::buffa::impl_default_view_instance!(ChainContractConfigView);
5961 ::buffa::impl_view_reborrow!(ChainContractConfigView);
5962 #[derive(Clone, Debug)]
5968 pub struct ChainContractConfigOwnedView(
5969 ::buffa::OwnedView<ChainContractConfigView<'static>>,
5970 );
5971 impl ChainContractConfigOwnedView {
5972 pub fn decode(
5982 bytes: ::buffa::bytes::Bytes,
5983 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5984 ::core::result::Result::Ok(
5985 ChainContractConfigOwnedView(::buffa::OwnedView::decode(bytes)?),
5986 )
5987 }
5988 pub fn decode_with_options(
5996 bytes: ::buffa::bytes::Bytes,
5997 opts: &::buffa::DecodeOptions,
5998 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5999 ::core::result::Result::Ok(
6000 ChainContractConfigOwnedView(
6001 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
6002 ),
6003 )
6004 }
6005 pub fn from_owned(
6012 msg: &super::super::ChainContractConfig,
6013 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6014 ::core::result::Result::Ok(
6015 ChainContractConfigOwnedView(::buffa::OwnedView::from_owned(msg)?),
6016 )
6017 }
6018 #[must_use]
6020 pub fn view(&self) -> &ChainContractConfigView<'_> {
6021 self.0.reborrow()
6022 }
6023 pub fn to_owned_message(
6030 &self,
6031 ) -> ::core::result::Result<
6032 super::super::ChainContractConfig,
6033 ::buffa::DecodeError,
6034 > {
6035 self.0.to_owned_message()
6036 }
6037 #[must_use]
6039 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6040 self.0.bytes()
6041 }
6042 #[must_use]
6044 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6045 self.0.into_bytes()
6046 }
6047 #[must_use]
6051 pub fn name(&self) -> &'_ str {
6052 self.0.reborrow().name
6053 }
6054 #[must_use]
6058 pub fn address(&self) -> &'_ str {
6059 self.0.reborrow().address
6060 }
6061 #[must_use]
6065 pub fn r#type(&self) -> &'_ str {
6066 self.0.reborrow().r#type
6067 }
6068 #[must_use]
6072 pub fn description(&self) -> &'_ str {
6073 self.0.reborrow().description
6074 }
6075 #[must_use]
6080 pub fn version(&self) -> u32 {
6081 self.0.reborrow().version
6082 }
6083 }
6084 impl ::core::convert::From<::buffa::OwnedView<ChainContractConfigView<'static>>>
6085 for ChainContractConfigOwnedView {
6086 fn from(
6087 inner: ::buffa::OwnedView<ChainContractConfigView<'static>>,
6088 ) -> Self {
6089 ChainContractConfigOwnedView(inner)
6090 }
6091 }
6092 impl ::core::convert::From<ChainContractConfigOwnedView>
6093 for ::buffa::OwnedView<ChainContractConfigView<'static>> {
6094 fn from(wrapper: ChainContractConfigOwnedView) -> Self {
6095 wrapper.0
6096 }
6097 }
6098 impl ::core::convert::AsRef<::buffa::OwnedView<ChainContractConfigView<'static>>>
6099 for ChainContractConfigOwnedView {
6100 fn as_ref(&self) -> &::buffa::OwnedView<ChainContractConfigView<'static>> {
6101 &self.0
6102 }
6103 }
6104 impl ::buffa::HasMessageView for super::super::ChainContractConfig {
6105 type View<'a> = ChainContractConfigView<'a>;
6106 type ViewHandle = ChainContractConfigOwnedView;
6107 }
6108 impl ::serde::Serialize for ChainContractConfigOwnedView {
6109 fn serialize<__S: ::serde::Serializer>(
6110 &self,
6111 __s: __S,
6112 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6113 ::serde::Serialize::serialize(&self.0, __s)
6114 }
6115 }
6116 #[derive(Clone, Debug, Default)]
6117 pub struct GetDepositWithdrawConfigRequestView<'a> {
6118 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
6119 }
6120 impl<'a> ::buffa::MessageView<'a> for GetDepositWithdrawConfigRequestView<'a> {
6121 type Owned = super::super::GetDepositWithdrawConfigRequest;
6122 fn decode_view(
6123 buf: &'a [u8],
6124 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6125 let __limit = ::core::cell::Cell::new(
6126 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
6127 );
6128 <Self as ::buffa::MessageView>::decode_view_ctx(
6129 buf,
6130 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
6131 )
6132 }
6133 fn decode_view_with_ctx(
6134 buf: &'a [u8],
6135 ctx: ::buffa::DecodeContext<'_>,
6136 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6137 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
6138 }
6139 fn merge_view_field(
6140 &mut self,
6141 tag: ::buffa::encoding::Tag,
6142 cur: &'a [u8],
6143 before_tag: &'a [u8],
6144 ctx: ::buffa::DecodeContext<'_>,
6145 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
6146 let _ = ctx;
6147 #[allow(unused_variables)]
6148 let view = self;
6149 let mut cur = cur;
6150 match tag.field_number() {
6151 _ => {
6152 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
6153 let span_len = before_tag.len() - cur.len();
6154 view.__buffa_unknown_fields
6155 .push_record(before_tag, span_len, ctx)?;
6156 }
6157 }
6158 ::core::result::Result::Ok(cur)
6159 }
6160 fn to_owned_message(
6161 &self,
6162 ) -> ::core::result::Result<
6163 super::super::GetDepositWithdrawConfigRequest,
6164 ::buffa::DecodeError,
6165 > {
6166 self.to_owned_from_source(None)
6167 }
6168 #[allow(clippy::useless_conversion, clippy::needless_update)]
6169 fn to_owned_from_source(
6170 &self,
6171 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
6172 ) -> ::core::result::Result<
6173 super::super::GetDepositWithdrawConfigRequest,
6174 ::buffa::DecodeError,
6175 > {
6176 #[allow(unused_imports)]
6177 use ::buffa::alloc::string::ToString as _;
6178 let _ = __buffa_src;
6179 ::core::result::Result::Ok(super::super::GetDepositWithdrawConfigRequest {
6180 __buffa_unknown_fields: self
6181 .__buffa_unknown_fields
6182 .to_owned()?
6183 .into(),
6184 ..::core::default::Default::default()
6185 })
6186 }
6187 }
6188 impl<'a> ::buffa::ViewEncode<'a> for GetDepositWithdrawConfigRequestView<'a> {
6189 #[allow(clippy::needless_borrow, clippy::let_and_return)]
6190 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6191 #[allow(unused_imports)]
6192 use ::buffa::Enumeration as _;
6193 let mut size = 0u32;
6194 size += self.__buffa_unknown_fields.encoded_len() as u32;
6195 size
6196 }
6197 #[allow(clippy::needless_borrow)]
6198 fn write_to(
6199 &self,
6200 _cache: &mut ::buffa::SizeCache,
6201 buf: &mut impl ::buffa::bytes::BufMut,
6202 ) {
6203 #[allow(unused_imports)]
6204 use ::buffa::Enumeration as _;
6205 self.__buffa_unknown_fields.write_to(buf);
6206 }
6207 }
6208 impl<'__a> ::serde::Serialize for GetDepositWithdrawConfigRequestView<'__a> {
6220 fn serialize<__S: ::serde::Serializer>(
6221 &self,
6222 __s: __S,
6223 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6224 use ::serde::ser::SerializeMap as _;
6225 let mut __map = __s.serialize_map(::core::option::Option::None)?;
6226 __map.end()
6227 }
6228 }
6229 impl<'a> ::buffa::MessageName for GetDepositWithdrawConfigRequestView<'a> {
6230 const PACKAGE: &'static str = "chain.zipper.v1";
6231 const NAME: &'static str = "GetDepositWithdrawConfigRequest";
6232 const FULL_NAME: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigRequest";
6233 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigRequest";
6234 }
6235 ::buffa::impl_default_view_instance!(GetDepositWithdrawConfigRequestView);
6236 ::buffa::impl_view_reborrow!(GetDepositWithdrawConfigRequestView);
6237 #[derive(Clone, Debug)]
6243 pub struct GetDepositWithdrawConfigRequestOwnedView(
6244 ::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>>,
6245 );
6246 impl GetDepositWithdrawConfigRequestOwnedView {
6247 pub fn decode(
6257 bytes: ::buffa::bytes::Bytes,
6258 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6259 ::core::result::Result::Ok(
6260 GetDepositWithdrawConfigRequestOwnedView(
6261 ::buffa::OwnedView::decode(bytes)?,
6262 ),
6263 )
6264 }
6265 pub fn decode_with_options(
6273 bytes: ::buffa::bytes::Bytes,
6274 opts: &::buffa::DecodeOptions,
6275 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6276 ::core::result::Result::Ok(
6277 GetDepositWithdrawConfigRequestOwnedView(
6278 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
6279 ),
6280 )
6281 }
6282 pub fn from_owned(
6289 msg: &super::super::GetDepositWithdrawConfigRequest,
6290 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6291 ::core::result::Result::Ok(
6292 GetDepositWithdrawConfigRequestOwnedView(
6293 ::buffa::OwnedView::from_owned(msg)?,
6294 ),
6295 )
6296 }
6297 #[must_use]
6299 pub fn view(&self) -> &GetDepositWithdrawConfigRequestView<'_> {
6300 self.0.reborrow()
6301 }
6302 pub fn to_owned_message(
6309 &self,
6310 ) -> ::core::result::Result<
6311 super::super::GetDepositWithdrawConfigRequest,
6312 ::buffa::DecodeError,
6313 > {
6314 self.0.to_owned_message()
6315 }
6316 #[must_use]
6318 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6319 self.0.bytes()
6320 }
6321 #[must_use]
6323 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6324 self.0.into_bytes()
6325 }
6326 }
6327 impl ::core::convert::From<
6328 ::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>>,
6329 > for GetDepositWithdrawConfigRequestOwnedView {
6330 fn from(
6331 inner: ::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>>,
6332 ) -> Self {
6333 GetDepositWithdrawConfigRequestOwnedView(inner)
6334 }
6335 }
6336 impl ::core::convert::From<GetDepositWithdrawConfigRequestOwnedView>
6337 for ::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>> {
6338 fn from(wrapper: GetDepositWithdrawConfigRequestOwnedView) -> Self {
6339 wrapper.0
6340 }
6341 }
6342 impl ::core::convert::AsRef<
6343 ::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>>,
6344 > for GetDepositWithdrawConfigRequestOwnedView {
6345 fn as_ref(
6346 &self,
6347 ) -> &::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>> {
6348 &self.0
6349 }
6350 }
6351 impl ::buffa::HasMessageView for super::super::GetDepositWithdrawConfigRequest {
6352 type View<'a> = GetDepositWithdrawConfigRequestView<'a>;
6353 type ViewHandle = GetDepositWithdrawConfigRequestOwnedView;
6354 }
6355 impl ::serde::Serialize for GetDepositWithdrawConfigRequestOwnedView {
6356 fn serialize<__S: ::serde::Serializer>(
6357 &self,
6358 __s: __S,
6359 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6360 ::serde::Serialize::serialize(&self.0, __s)
6361 }
6362 }
6363 #[derive(Clone, Debug, Default)]
6364 pub struct GetDepositWithdrawConfigResponseView<'a> {
6365 pub chains: ::buffa::RepeatedView<
6369 'a,
6370 super::super::__buffa::view::ChainConfigView<'a>,
6371 >,
6372 pub assets: ::buffa::RepeatedView<
6376 'a,
6377 super::super::__buffa::view::AssetConfigView<'a>,
6378 >,
6379 pub ts_sec: u64,
6383 pub polyester_chain_id: u32,
6387 pub contracts: ::buffa::RepeatedView<
6391 'a,
6392 super::super::__buffa::view::ChainContractConfigView<'a>,
6393 >,
6394 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
6395 }
6396 impl<'a> ::buffa::MessageView<'a> for GetDepositWithdrawConfigResponseView<'a> {
6397 type Owned = super::super::GetDepositWithdrawConfigResponse;
6398 fn decode_view(
6399 buf: &'a [u8],
6400 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6401 let __limit = ::core::cell::Cell::new(
6402 ::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
6403 );
6404 <Self as ::buffa::MessageView>::decode_view_ctx(
6405 buf,
6406 ::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
6407 )
6408 }
6409 fn decode_view_with_ctx(
6410 buf: &'a [u8],
6411 ctx: ::buffa::DecodeContext<'_>,
6412 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6413 <Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
6414 }
6415 fn merge_view_field(
6416 &mut self,
6417 tag: ::buffa::encoding::Tag,
6418 cur: &'a [u8],
6419 before_tag: &'a [u8],
6420 ctx: ::buffa::DecodeContext<'_>,
6421 ) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
6422 let _ = ctx;
6423 #[allow(unused_variables)]
6424 let view = self;
6425 let mut cur = cur;
6426 match tag.field_number() {
6427 3u32 => {
6428 ::buffa::encoding::check_wire_type(
6429 tag,
6430 ::buffa::encoding::WireType::Varint,
6431 )?;
6432 view.ts_sec = ::buffa::types::decode_uint64(&mut cur)?;
6433 }
6434 4u32 => {
6435 ::buffa::encoding::check_wire_type(
6436 tag,
6437 ::buffa::encoding::WireType::Varint,
6438 )?;
6439 view.polyester_chain_id = ::buffa::types::decode_uint32(
6440 &mut cur,
6441 )?;
6442 }
6443 1u32 => {
6444 ::buffa::encoding::check_wire_type(
6445 tag,
6446 ::buffa::encoding::WireType::LengthDelimited,
6447 )?;
6448 let __sub_ctx = ctx.descend()?;
6449 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6450 view.chains
6451 .push(
6452 <super::super::__buffa::view::ChainConfigView as ::buffa::MessageView>::decode_view_ctx(
6453 sub,
6454 __sub_ctx,
6455 )?,
6456 );
6457 }
6458 2u32 => {
6459 ::buffa::encoding::check_wire_type(
6460 tag,
6461 ::buffa::encoding::WireType::LengthDelimited,
6462 )?;
6463 let __sub_ctx = ctx.descend()?;
6464 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6465 view.assets
6466 .push(
6467 <super::super::__buffa::view::AssetConfigView as ::buffa::MessageView>::decode_view_ctx(
6468 sub,
6469 __sub_ctx,
6470 )?,
6471 );
6472 }
6473 5u32 => {
6474 ::buffa::encoding::check_wire_type(
6475 tag,
6476 ::buffa::encoding::WireType::LengthDelimited,
6477 )?;
6478 let __sub_ctx = ctx.descend()?;
6479 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
6480 view.contracts
6481 .push(
6482 <super::super::__buffa::view::ChainContractConfigView as ::buffa::MessageView>::decode_view_ctx(
6483 sub,
6484 __sub_ctx,
6485 )?,
6486 );
6487 }
6488 _ => {
6489 ::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
6490 let span_len = before_tag.len() - cur.len();
6491 view.__buffa_unknown_fields
6492 .push_record(before_tag, span_len, ctx)?;
6493 }
6494 }
6495 ::core::result::Result::Ok(cur)
6496 }
6497 fn to_owned_message(
6498 &self,
6499 ) -> ::core::result::Result<
6500 super::super::GetDepositWithdrawConfigResponse,
6501 ::buffa::DecodeError,
6502 > {
6503 self.to_owned_from_source(None)
6504 }
6505 #[allow(clippy::useless_conversion, clippy::needless_update)]
6506 fn to_owned_from_source(
6507 &self,
6508 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
6509 ) -> ::core::result::Result<
6510 super::super::GetDepositWithdrawConfigResponse,
6511 ::buffa::DecodeError,
6512 > {
6513 #[allow(unused_imports)]
6514 use ::buffa::alloc::string::ToString as _;
6515 let _ = __buffa_src;
6516 ::core::result::Result::Ok(super::super::GetDepositWithdrawConfigResponse {
6517 chains: self
6518 .chains
6519 .iter()
6520 .map(|v| v.to_owned_from_source(__buffa_src))
6521 .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
6522 assets: self
6523 .assets
6524 .iter()
6525 .map(|v| v.to_owned_from_source(__buffa_src))
6526 .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
6527 ts_sec: self.ts_sec,
6528 polyester_chain_id: self.polyester_chain_id,
6529 contracts: self
6530 .contracts
6531 .iter()
6532 .map(|v| v.to_owned_from_source(__buffa_src))
6533 .collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
6534 __buffa_unknown_fields: self
6535 .__buffa_unknown_fields
6536 .to_owned()?
6537 .into(),
6538 ..::core::default::Default::default()
6539 })
6540 }
6541 }
6542 impl<'a> ::buffa::ViewEncode<'a> for GetDepositWithdrawConfigResponseView<'a> {
6543 #[allow(clippy::needless_borrow, clippy::let_and_return)]
6544 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
6545 #[allow(unused_imports)]
6546 use ::buffa::Enumeration as _;
6547 let mut size = 0u32;
6548 for v in &self.chains {
6549 let __slot = __cache.reserve();
6550 let inner_size = v.compute_size(__cache);
6551 __cache.set(__slot, inner_size);
6552 size
6553 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6554 + inner_size;
6555 }
6556 for v in &self.assets {
6557 let __slot = __cache.reserve();
6558 let inner_size = v.compute_size(__cache);
6559 __cache.set(__slot, inner_size);
6560 size
6561 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6562 + inner_size;
6563 }
6564 if self.ts_sec != 0u64 {
6565 size
6566 += 1u32 + ::buffa::types::uint64_encoded_len(self.ts_sec) as u32;
6567 }
6568 if self.polyester_chain_id != 0u32 {
6569 size
6570 += 1u32
6571 + ::buffa::types::uint32_encoded_len(self.polyester_chain_id)
6572 as u32;
6573 }
6574 for v in &self.contracts {
6575 let __slot = __cache.reserve();
6576 let inner_size = v.compute_size(__cache);
6577 __cache.set(__slot, inner_size);
6578 size
6579 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
6580 + inner_size;
6581 }
6582 size += self.__buffa_unknown_fields.encoded_len() as u32;
6583 size
6584 }
6585 #[allow(clippy::needless_borrow)]
6586 fn write_to(
6587 &self,
6588 __cache: &mut ::buffa::SizeCache,
6589 buf: &mut impl ::buffa::bytes::BufMut,
6590 ) {
6591 #[allow(unused_imports)]
6592 use ::buffa::Enumeration as _;
6593 for v in &self.chains {
6594 ::buffa::types::put_len_delimited_header(
6595 1u32,
6596 __cache.consume_next(),
6597 buf,
6598 );
6599 v.write_to(__cache, buf);
6600 }
6601 for v in &self.assets {
6602 ::buffa::types::put_len_delimited_header(
6603 2u32,
6604 __cache.consume_next(),
6605 buf,
6606 );
6607 v.write_to(__cache, buf);
6608 }
6609 if self.ts_sec != 0u64 {
6610 ::buffa::types::put_uint64_field(3u32, self.ts_sec, buf);
6611 }
6612 if self.polyester_chain_id != 0u32 {
6613 ::buffa::types::put_uint32_field(4u32, self.polyester_chain_id, buf);
6614 }
6615 for v in &self.contracts {
6616 ::buffa::types::put_len_delimited_header(
6617 5u32,
6618 __cache.consume_next(),
6619 buf,
6620 );
6621 v.write_to(__cache, buf);
6622 }
6623 self.__buffa_unknown_fields.write_to(buf);
6624 }
6625 }
6626 impl<'__a> ::serde::Serialize for GetDepositWithdrawConfigResponseView<'__a> {
6638 fn serialize<__S: ::serde::Serializer>(
6639 &self,
6640 __s: __S,
6641 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6642 use ::serde::ser::SerializeMap as _;
6643 let mut __map = __s.serialize_map(::core::option::Option::None)?;
6644 if !self.chains.is_empty() {
6645 __map.serialize_entry("chains", &*self.chains)?;
6646 }
6647 if !self.assets.is_empty() {
6648 __map.serialize_entry("assets", &*self.assets)?;
6649 }
6650 if !::buffa::json_helpers::skip_if::is_zero_u64(&self.ts_sec) {
6651 __map
6652 .serialize_entry(
6653 "tsSec",
6654 &::buffa::json_helpers::ProtoJson(&self.ts_sec),
6655 )?;
6656 }
6657 if !::buffa::json_helpers::skip_if::is_zero_u32(
6658 &self.polyester_chain_id,
6659 ) {
6660 __map
6661 .serialize_entry(
6662 "polyesterChainId",
6663 &::buffa::json_helpers::ProtoJson(&self.polyester_chain_id),
6664 )?;
6665 }
6666 if !self.contracts.is_empty() {
6667 __map.serialize_entry("contracts", &*self.contracts)?;
6668 }
6669 __map.end()
6670 }
6671 }
6672 impl<'a> ::buffa::MessageName for GetDepositWithdrawConfigResponseView<'a> {
6673 const PACKAGE: &'static str = "chain.zipper.v1";
6674 const NAME: &'static str = "GetDepositWithdrawConfigResponse";
6675 const FULL_NAME: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigResponse";
6676 const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigResponse";
6677 }
6678 ::buffa::impl_default_view_instance!(GetDepositWithdrawConfigResponseView);
6679 ::buffa::impl_view_reborrow!(GetDepositWithdrawConfigResponseView);
6680 #[derive(Clone, Debug)]
6686 pub struct GetDepositWithdrawConfigResponseOwnedView(
6687 ::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>>,
6688 );
6689 impl GetDepositWithdrawConfigResponseOwnedView {
6690 pub fn decode(
6700 bytes: ::buffa::bytes::Bytes,
6701 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6702 ::core::result::Result::Ok(
6703 GetDepositWithdrawConfigResponseOwnedView(
6704 ::buffa::OwnedView::decode(bytes)?,
6705 ),
6706 )
6707 }
6708 pub fn decode_with_options(
6716 bytes: ::buffa::bytes::Bytes,
6717 opts: &::buffa::DecodeOptions,
6718 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6719 ::core::result::Result::Ok(
6720 GetDepositWithdrawConfigResponseOwnedView(
6721 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
6722 ),
6723 )
6724 }
6725 pub fn from_owned(
6732 msg: &super::super::GetDepositWithdrawConfigResponse,
6733 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6734 ::core::result::Result::Ok(
6735 GetDepositWithdrawConfigResponseOwnedView(
6736 ::buffa::OwnedView::from_owned(msg)?,
6737 ),
6738 )
6739 }
6740 #[must_use]
6742 pub fn view(&self) -> &GetDepositWithdrawConfigResponseView<'_> {
6743 self.0.reborrow()
6744 }
6745 pub fn to_owned_message(
6752 &self,
6753 ) -> ::core::result::Result<
6754 super::super::GetDepositWithdrawConfigResponse,
6755 ::buffa::DecodeError,
6756 > {
6757 self.0.to_owned_message()
6758 }
6759 #[must_use]
6761 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6762 self.0.bytes()
6763 }
6764 #[must_use]
6766 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6767 self.0.into_bytes()
6768 }
6769 #[must_use]
6773 pub fn chains(
6774 &self,
6775 ) -> &::buffa::RepeatedView<
6776 '_,
6777 super::super::__buffa::view::ChainConfigView<'_>,
6778 > {
6779 &self.0.reborrow().chains
6780 }
6781 #[must_use]
6785 pub fn assets(
6786 &self,
6787 ) -> &::buffa::RepeatedView<
6788 '_,
6789 super::super::__buffa::view::AssetConfigView<'_>,
6790 > {
6791 &self.0.reborrow().assets
6792 }
6793 #[must_use]
6797 pub fn ts_sec(&self) -> u64 {
6798 self.0.reborrow().ts_sec
6799 }
6800 #[must_use]
6804 pub fn polyester_chain_id(&self) -> u32 {
6805 self.0.reborrow().polyester_chain_id
6806 }
6807 #[must_use]
6811 pub fn contracts(
6812 &self,
6813 ) -> &::buffa::RepeatedView<
6814 '_,
6815 super::super::__buffa::view::ChainContractConfigView<'_>,
6816 > {
6817 &self.0.reborrow().contracts
6818 }
6819 }
6820 impl ::core::convert::From<
6821 ::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>>,
6822 > for GetDepositWithdrawConfigResponseOwnedView {
6823 fn from(
6824 inner: ::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>>,
6825 ) -> Self {
6826 GetDepositWithdrawConfigResponseOwnedView(inner)
6827 }
6828 }
6829 impl ::core::convert::From<GetDepositWithdrawConfigResponseOwnedView>
6830 for ::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>> {
6831 fn from(wrapper: GetDepositWithdrawConfigResponseOwnedView) -> Self {
6832 wrapper.0
6833 }
6834 }
6835 impl ::core::convert::AsRef<
6836 ::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>>,
6837 > for GetDepositWithdrawConfigResponseOwnedView {
6838 fn as_ref(
6839 &self,
6840 ) -> &::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>> {
6841 &self.0
6842 }
6843 }
6844 impl ::buffa::HasMessageView for super::super::GetDepositWithdrawConfigResponse {
6845 type View<'a> = GetDepositWithdrawConfigResponseView<'a>;
6846 type ViewHandle = GetDepositWithdrawConfigResponseOwnedView;
6847 }
6848 impl ::serde::Serialize for GetDepositWithdrawConfigResponseOwnedView {
6849 fn serialize<__S: ::serde::Serializer>(
6850 &self,
6851 __s: __S,
6852 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6853 ::serde::Serialize::serialize(&self.0, __s)
6854 }
6855 }
6856 }
6857 pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
6859 reg.register_json_any(super::__ZIPPER_REASON_DETAILS_JSON_ANY);
6860 reg.register_json_any(super::__CHAIN_CONFIG_JSON_ANY);
6861 reg.register_json_any(super::__ASSET_CHAIN_VARIANT_JSON_ANY);
6862 reg.register_json_any(super::__ZIPPED_ASSET_SUPPLY_UPDATE_JSON_ANY);
6863 reg.register_json_any(super::__ZIPPED_ASSET_SUPPLY_BATCH_JSON_ANY);
6864 reg.register_json_any(super::__ASSET_CONFIG_JSON_ANY);
6865 reg.register_json_any(super::__CHAIN_CONTRACT_CONFIG_JSON_ANY);
6866 reg.register_json_any(super::__GET_DEPOSIT_WITHDRAW_CONFIG_REQUEST_JSON_ANY);
6867 reg.register_json_any(super::__GET_DEPOSIT_WITHDRAW_CONFIG_RESPONSE_JSON_ANY);
6868 }
6869}
6870#[doc(inline)]
6871pub use self::__buffa::view::ZipperReasonDetailsView;
6872#[doc(inline)]
6873pub use self::__buffa::view::ZipperReasonDetailsOwnedView;
6874#[doc(inline)]
6875pub use self::__buffa::view::ChainConfigView;
6876#[doc(inline)]
6877pub use self::__buffa::view::ChainConfigOwnedView;
6878#[doc(inline)]
6879pub use self::__buffa::view::AssetChainVariantView;
6880#[doc(inline)]
6881pub use self::__buffa::view::AssetChainVariantOwnedView;
6882#[doc(inline)]
6883pub use self::__buffa::view::ZippedAssetSupplyUpdateView;
6884#[doc(inline)]
6885pub use self::__buffa::view::ZippedAssetSupplyUpdateOwnedView;
6886#[doc(inline)]
6887pub use self::__buffa::view::ZippedAssetSupplyBatchView;
6888#[doc(inline)]
6889pub use self::__buffa::view::ZippedAssetSupplyBatchOwnedView;
6890#[doc(inline)]
6891pub use self::__buffa::view::AssetConfigView;
6892#[doc(inline)]
6893pub use self::__buffa::view::AssetConfigOwnedView;
6894#[doc(inline)]
6895pub use self::__buffa::view::ChainContractConfigView;
6896#[doc(inline)]
6897pub use self::__buffa::view::ChainContractConfigOwnedView;
6898#[doc(inline)]
6899pub use self::__buffa::view::GetDepositWithdrawConfigRequestView;
6900#[doc(inline)]
6901pub use self::__buffa::view::GetDepositWithdrawConfigRequestOwnedView;
6902#[doc(inline)]
6903pub use self::__buffa::view::GetDepositWithdrawConfigResponseView;
6904#[doc(inline)]
6905pub use self::__buffa::view::GetDepositWithdrawConfigResponseOwnedView;
6906#[doc(inline)]
6907pub use self::__buffa::register_types;