#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum ZipperReasonCode {
REASON_UNSPECIFIED = 0i32,
DEPOSIT_WAIT_EXPIRED = 1001i32,
DEPOSIT_AMOUNT_INVALID = 1002i32,
DEPOSIT_AMOUNT_BELOW_MINIMUM = 1003i32,
DEPOSIT_AMOUNT_NOT_ABOVE_FEE = 1004i32,
DEPOSIT_NET_AMOUNT_BELOW_MINIMUM = 1005i32,
EVM_DEPOSIT_SOURCE_TX_INVALID = 1101i32,
EVM_DEPOSIT_SOURCE_TX_ZERO = 1102i32,
EVM_DEPOSIT_SOURCE_TX_NOT_FOUND = 1103i32,
EVM_DEPOSIT_SOURCE_TX_REVERTED = 1104i32,
EVM_DEPOSIT_TRANSFER_MISMATCH = 1105i32,
UTXO_DEPOSIT_TRANSACTION_MISMATCH = 1201i32,
BTC_DEPOSIT_TRANSACTION_MISMATCH = 1202i32,
BCH_DEPOSIT_TRANSACTION_MISMATCH = 1203i32,
DOGE_DEPOSIT_TRANSACTION_MISMATCH = 1204i32,
LTC_DEPOSIT_TRANSACTION_MISMATCH = 1205i32,
UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS = 1206i32,
SOLANA_DEPOSIT_SIGNATURE_INVALID = 1301i32,
SOLANA_DEPOSIT_TRANSACTION_FAILED = 1302i32,
SOLANA_DEPOSIT_TRANSFER_MISMATCH = 1303i32,
XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID = 1401i32,
XRP_DEPOSIT_SOURCE_ADDRESS_INVALID = 1402i32,
XRP_DEPOSIT_ADDRESS_INVALID = 1403i32,
XRP_DEPOSIT_PAYMENT_MISMATCH = 1404i32,
REJECTION_UNMAPPED = 1999i32,
WITHDRAWAL_AMOUNT_INVALID = 2001i32,
WITHDRAWAL_AMOUNT_BELOW_MINIMUM = 2002i32,
WITHDRAWAL_ASSET_INVALID = 2003i32,
WITHDRAWAL_SENDER_INVALID = 2004i32,
WITHDRAWAL_DESTINATION_INVALID = 2005i32,
WITHDRAWAL_ASSET_UNAVAILABLE = 2006i32,
EVM_WITHDRAWAL_DESTINATION_INVALID = 2101i32,
BTC_WITHDRAWAL_DESTINATION_INVALID = 2201i32,
BCH_WITHDRAWAL_DESTINATION_INVALID = 2202i32,
DOGE_WITHDRAWAL_DESTINATION_INVALID = 2203i32,
LTC_WITHDRAWAL_DESTINATION_INVALID = 2204i32,
SOLANA_WITHDRAWAL_DESTINATION_INVALID = 2301i32,
XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID = 2401i32,
XRP_WITHDRAWAL_DESTINATION_TAG_INVALID = 2402i32,
WITHDRAWAL_LIQUIDITY_INSUFFICIENT = 3001i32,
COMPLIANCE_HIGH_RISK_ADDRESS = 3002i32,
REQUEST_VERIFICATION_REJECTED = 3901i32,
REJECTED = 3902i32,
ERROR_UNMAPPED = 9000i32,
ERROR_NETWORK_UNSUPPORTED = 9001i32,
ERROR_REQUEST_PROCESSING_FAILED = 9002i32,
ERROR_REQUEST_VERIFICATION_FAILED = 9003i32,
ERROR_RESULT_SUBMISSION_FAILED = 9004i32,
ERROR_STATUS_UNKNOWN = 9005i32,
}
impl ZipperReasonCode {
#[allow(non_upper_case_globals)]
pub const ReasonUnspecified: Self = Self::REASON_UNSPECIFIED;
#[allow(non_upper_case_globals)]
pub const DepositWaitExpired: Self = Self::DEPOSIT_WAIT_EXPIRED;
#[allow(non_upper_case_globals)]
pub const DepositAmountInvalid: Self = Self::DEPOSIT_AMOUNT_INVALID;
#[allow(non_upper_case_globals)]
pub const DepositAmountBelowMinimum: Self = Self::DEPOSIT_AMOUNT_BELOW_MINIMUM;
#[allow(non_upper_case_globals)]
pub const DepositAmountNotAboveFee: Self = Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE;
#[allow(non_upper_case_globals)]
pub const DepositNetAmountBelowMinimum: Self = Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM;
#[allow(non_upper_case_globals)]
pub const EvmDepositSourceTxInvalid: Self = Self::EVM_DEPOSIT_SOURCE_TX_INVALID;
#[allow(non_upper_case_globals)]
pub const EvmDepositSourceTxZero: Self = Self::EVM_DEPOSIT_SOURCE_TX_ZERO;
#[allow(non_upper_case_globals)]
pub const EvmDepositSourceTxNotFound: Self = Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND;
#[allow(non_upper_case_globals)]
pub const EvmDepositSourceTxReverted: Self = Self::EVM_DEPOSIT_SOURCE_TX_REVERTED;
#[allow(non_upper_case_globals)]
pub const EvmDepositTransferMismatch: Self = Self::EVM_DEPOSIT_TRANSFER_MISMATCH;
#[allow(non_upper_case_globals)]
pub const UtxoDepositTransactionMismatch: Self = Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH;
#[allow(non_upper_case_globals)]
pub const BtcDepositTransactionMismatch: Self = Self::BTC_DEPOSIT_TRANSACTION_MISMATCH;
#[allow(non_upper_case_globals)]
pub const BchDepositTransactionMismatch: Self = Self::BCH_DEPOSIT_TRANSACTION_MISMATCH;
#[allow(non_upper_case_globals)]
pub const DogeDepositTransactionMismatch: Self = Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH;
#[allow(non_upper_case_globals)]
pub const LtcDepositTransactionMismatch: Self = Self::LTC_DEPOSIT_TRANSACTION_MISMATCH;
#[allow(non_upper_case_globals)]
pub const UtxoDepositSourceIsDepositAddress: Self = Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS;
#[allow(non_upper_case_globals)]
pub const SolanaDepositSignatureInvalid: Self = Self::SOLANA_DEPOSIT_SIGNATURE_INVALID;
#[allow(non_upper_case_globals)]
pub const SolanaDepositTransactionFailed: Self = Self::SOLANA_DEPOSIT_TRANSACTION_FAILED;
#[allow(non_upper_case_globals)]
pub const SolanaDepositTransferMismatch: Self = Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH;
#[allow(non_upper_case_globals)]
pub const XrpDepositSourceHashIndexInvalid: Self = Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID;
#[allow(non_upper_case_globals)]
pub const XrpDepositSourceAddressInvalid: Self = Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID;
#[allow(non_upper_case_globals)]
pub const XrpDepositAddressInvalid: Self = Self::XRP_DEPOSIT_ADDRESS_INVALID;
#[allow(non_upper_case_globals)]
pub const XrpDepositPaymentMismatch: Self = Self::XRP_DEPOSIT_PAYMENT_MISMATCH;
#[allow(non_upper_case_globals)]
pub const RejectionUnmapped: Self = Self::REJECTION_UNMAPPED;
#[allow(non_upper_case_globals)]
pub const WithdrawalAmountInvalid: Self = Self::WITHDRAWAL_AMOUNT_INVALID;
#[allow(non_upper_case_globals)]
pub const WithdrawalAmountBelowMinimum: Self = Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM;
#[allow(non_upper_case_globals)]
pub const WithdrawalAssetInvalid: Self = Self::WITHDRAWAL_ASSET_INVALID;
#[allow(non_upper_case_globals)]
pub const WithdrawalSenderInvalid: Self = Self::WITHDRAWAL_SENDER_INVALID;
#[allow(non_upper_case_globals)]
pub const WithdrawalDestinationInvalid: Self = Self::WITHDRAWAL_DESTINATION_INVALID;
#[allow(non_upper_case_globals)]
pub const WithdrawalAssetUnavailable: Self = Self::WITHDRAWAL_ASSET_UNAVAILABLE;
#[allow(non_upper_case_globals)]
pub const EvmWithdrawalDestinationInvalid: Self = Self::EVM_WITHDRAWAL_DESTINATION_INVALID;
#[allow(non_upper_case_globals)]
pub const BtcWithdrawalDestinationInvalid: Self = Self::BTC_WITHDRAWAL_DESTINATION_INVALID;
#[allow(non_upper_case_globals)]
pub const BchWithdrawalDestinationInvalid: Self = Self::BCH_WITHDRAWAL_DESTINATION_INVALID;
#[allow(non_upper_case_globals)]
pub const DogeWithdrawalDestinationInvalid: Self = Self::DOGE_WITHDRAWAL_DESTINATION_INVALID;
#[allow(non_upper_case_globals)]
pub const LtcWithdrawalDestinationInvalid: Self = Self::LTC_WITHDRAWAL_DESTINATION_INVALID;
#[allow(non_upper_case_globals)]
pub const SolanaWithdrawalDestinationInvalid: Self = Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID;
#[allow(non_upper_case_globals)]
pub const XrpWithdrawalClassicAddressInvalid: Self = Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID;
#[allow(non_upper_case_globals)]
pub const XrpWithdrawalDestinationTagInvalid: Self = Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID;
#[allow(non_upper_case_globals)]
pub const WithdrawalLiquidityInsufficient: Self = Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT;
#[allow(non_upper_case_globals)]
pub const ComplianceHighRiskAddress: Self = Self::COMPLIANCE_HIGH_RISK_ADDRESS;
#[allow(non_upper_case_globals)]
pub const RequestVerificationRejected: Self = Self::REQUEST_VERIFICATION_REJECTED;
#[allow(non_upper_case_globals)]
pub const Rejected: Self = Self::REJECTED;
#[allow(non_upper_case_globals)]
pub const ErrorUnmapped: Self = Self::ERROR_UNMAPPED;
#[allow(non_upper_case_globals)]
pub const ErrorNetworkUnsupported: Self = Self::ERROR_NETWORK_UNSUPPORTED;
#[allow(non_upper_case_globals)]
pub const ErrorRequestProcessingFailed: Self = Self::ERROR_REQUEST_PROCESSING_FAILED;
#[allow(non_upper_case_globals)]
pub const ErrorRequestVerificationFailed: Self = Self::ERROR_REQUEST_VERIFICATION_FAILED;
#[allow(non_upper_case_globals)]
pub const ErrorResultSubmissionFailed: Self = Self::ERROR_RESULT_SUBMISSION_FAILED;
#[allow(non_upper_case_globals)]
pub const ErrorStatusUnknown: Self = Self::ERROR_STATUS_UNKNOWN;
}
impl ::core::default::Default for ZipperReasonCode {
fn default() -> Self {
Self::REASON_UNSPECIFIED
}
}
impl ::serde::Serialize for ZipperReasonCode {
fn serialize<S: ::serde::Serializer>(
&self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
s.serialize_str(::buffa::Enumeration::proto_name(self))
}
}
impl<'de> ::serde::Deserialize<'de> for ZipperReasonCode {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = ZipperReasonCode;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(ZipperReasonCode)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<ZipperReasonCode, E> {
<ZipperReasonCode as ::buffa::Enumeration>::from_proto_name(v)
.ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
}
fn visit_i64<E: ::serde::de::Error>(
self,
v: i64,
) -> ::core::result::Result<ZipperReasonCode, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<ZipperReasonCode as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_u64<E: ::serde::de::Error>(
self,
v: u64,
) -> ::core::result::Result<ZipperReasonCode, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<ZipperReasonCode as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_unit<E: ::serde::de::Error>(
self,
) -> ::core::result::Result<ZipperReasonCode, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for ZipperReasonCode {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
impl ::buffa::Enumeration for ZipperReasonCode {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::REASON_UNSPECIFIED),
1001i32 => ::core::option::Option::Some(Self::DEPOSIT_WAIT_EXPIRED),
1002i32 => ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_INVALID),
1003i32 => ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_BELOW_MINIMUM),
1004i32 => ::core::option::Option::Some(Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE),
1005i32 => {
::core::option::Option::Some(Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM)
}
1101i32 => ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_INVALID),
1102i32 => ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_ZERO),
1103i32 => {
::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND)
}
1104i32 => ::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_REVERTED),
1105i32 => ::core::option::Option::Some(Self::EVM_DEPOSIT_TRANSFER_MISMATCH),
1201i32 => {
::core::option::Option::Some(Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH)
}
1202i32 => {
::core::option::Option::Some(Self::BTC_DEPOSIT_TRANSACTION_MISMATCH)
}
1203i32 => {
::core::option::Option::Some(Self::BCH_DEPOSIT_TRANSACTION_MISMATCH)
}
1204i32 => {
::core::option::Option::Some(Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH)
}
1205i32 => {
::core::option::Option::Some(Self::LTC_DEPOSIT_TRANSACTION_MISMATCH)
}
1206i32 => {
::core::option::Option::Some(
Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS,
)
}
1301i32 => {
::core::option::Option::Some(Self::SOLANA_DEPOSIT_SIGNATURE_INVALID)
}
1302i32 => {
::core::option::Option::Some(Self::SOLANA_DEPOSIT_TRANSACTION_FAILED)
}
1303i32 => {
::core::option::Option::Some(Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH)
}
1401i32 => {
::core::option::Option::Some(Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID)
}
1402i32 => {
::core::option::Option::Some(Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID)
}
1403i32 => ::core::option::Option::Some(Self::XRP_DEPOSIT_ADDRESS_INVALID),
1404i32 => ::core::option::Option::Some(Self::XRP_DEPOSIT_PAYMENT_MISMATCH),
1999i32 => ::core::option::Option::Some(Self::REJECTION_UNMAPPED),
2001i32 => ::core::option::Option::Some(Self::WITHDRAWAL_AMOUNT_INVALID),
2002i32 => {
::core::option::Option::Some(Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM)
}
2003i32 => ::core::option::Option::Some(Self::WITHDRAWAL_ASSET_INVALID),
2004i32 => ::core::option::Option::Some(Self::WITHDRAWAL_SENDER_INVALID),
2005i32 => ::core::option::Option::Some(Self::WITHDRAWAL_DESTINATION_INVALID),
2006i32 => ::core::option::Option::Some(Self::WITHDRAWAL_ASSET_UNAVAILABLE),
2101i32 => {
::core::option::Option::Some(Self::EVM_WITHDRAWAL_DESTINATION_INVALID)
}
2201i32 => {
::core::option::Option::Some(Self::BTC_WITHDRAWAL_DESTINATION_INVALID)
}
2202i32 => {
::core::option::Option::Some(Self::BCH_WITHDRAWAL_DESTINATION_INVALID)
}
2203i32 => {
::core::option::Option::Some(Self::DOGE_WITHDRAWAL_DESTINATION_INVALID)
}
2204i32 => {
::core::option::Option::Some(Self::LTC_WITHDRAWAL_DESTINATION_INVALID)
}
2301i32 => {
::core::option::Option::Some(Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID)
}
2401i32 => {
::core::option::Option::Some(
Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID,
)
}
2402i32 => {
::core::option::Option::Some(
Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID,
)
}
3001i32 => {
::core::option::Option::Some(Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT)
}
3002i32 => ::core::option::Option::Some(Self::COMPLIANCE_HIGH_RISK_ADDRESS),
3901i32 => ::core::option::Option::Some(Self::REQUEST_VERIFICATION_REJECTED),
3902i32 => ::core::option::Option::Some(Self::REJECTED),
9000i32 => ::core::option::Option::Some(Self::ERROR_UNMAPPED),
9001i32 => ::core::option::Option::Some(Self::ERROR_NETWORK_UNSUPPORTED),
9002i32 => {
::core::option::Option::Some(Self::ERROR_REQUEST_PROCESSING_FAILED)
}
9003i32 => {
::core::option::Option::Some(Self::ERROR_REQUEST_VERIFICATION_FAILED)
}
9004i32 => ::core::option::Option::Some(Self::ERROR_RESULT_SUBMISSION_FAILED),
9005i32 => ::core::option::Option::Some(Self::ERROR_STATUS_UNKNOWN),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::REASON_UNSPECIFIED => "REASON_UNSPECIFIED",
Self::DEPOSIT_WAIT_EXPIRED => "DEPOSIT_WAIT_EXPIRED",
Self::DEPOSIT_AMOUNT_INVALID => "DEPOSIT_AMOUNT_INVALID",
Self::DEPOSIT_AMOUNT_BELOW_MINIMUM => "DEPOSIT_AMOUNT_BELOW_MINIMUM",
Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE => "DEPOSIT_AMOUNT_NOT_ABOVE_FEE",
Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM => "DEPOSIT_NET_AMOUNT_BELOW_MINIMUM",
Self::EVM_DEPOSIT_SOURCE_TX_INVALID => "EVM_DEPOSIT_SOURCE_TX_INVALID",
Self::EVM_DEPOSIT_SOURCE_TX_ZERO => "EVM_DEPOSIT_SOURCE_TX_ZERO",
Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND => "EVM_DEPOSIT_SOURCE_TX_NOT_FOUND",
Self::EVM_DEPOSIT_SOURCE_TX_REVERTED => "EVM_DEPOSIT_SOURCE_TX_REVERTED",
Self::EVM_DEPOSIT_TRANSFER_MISMATCH => "EVM_DEPOSIT_TRANSFER_MISMATCH",
Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH => {
"UTXO_DEPOSIT_TRANSACTION_MISMATCH"
}
Self::BTC_DEPOSIT_TRANSACTION_MISMATCH => "BTC_DEPOSIT_TRANSACTION_MISMATCH",
Self::BCH_DEPOSIT_TRANSACTION_MISMATCH => "BCH_DEPOSIT_TRANSACTION_MISMATCH",
Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH => {
"DOGE_DEPOSIT_TRANSACTION_MISMATCH"
}
Self::LTC_DEPOSIT_TRANSACTION_MISMATCH => "LTC_DEPOSIT_TRANSACTION_MISMATCH",
Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS => {
"UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS"
}
Self::SOLANA_DEPOSIT_SIGNATURE_INVALID => "SOLANA_DEPOSIT_SIGNATURE_INVALID",
Self::SOLANA_DEPOSIT_TRANSACTION_FAILED => {
"SOLANA_DEPOSIT_TRANSACTION_FAILED"
}
Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH => "SOLANA_DEPOSIT_TRANSFER_MISMATCH",
Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID => {
"XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID"
}
Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID => {
"XRP_DEPOSIT_SOURCE_ADDRESS_INVALID"
}
Self::XRP_DEPOSIT_ADDRESS_INVALID => "XRP_DEPOSIT_ADDRESS_INVALID",
Self::XRP_DEPOSIT_PAYMENT_MISMATCH => "XRP_DEPOSIT_PAYMENT_MISMATCH",
Self::REJECTION_UNMAPPED => "REJECTION_UNMAPPED",
Self::WITHDRAWAL_AMOUNT_INVALID => "WITHDRAWAL_AMOUNT_INVALID",
Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM => "WITHDRAWAL_AMOUNT_BELOW_MINIMUM",
Self::WITHDRAWAL_ASSET_INVALID => "WITHDRAWAL_ASSET_INVALID",
Self::WITHDRAWAL_SENDER_INVALID => "WITHDRAWAL_SENDER_INVALID",
Self::WITHDRAWAL_DESTINATION_INVALID => "WITHDRAWAL_DESTINATION_INVALID",
Self::WITHDRAWAL_ASSET_UNAVAILABLE => "WITHDRAWAL_ASSET_UNAVAILABLE",
Self::EVM_WITHDRAWAL_DESTINATION_INVALID => {
"EVM_WITHDRAWAL_DESTINATION_INVALID"
}
Self::BTC_WITHDRAWAL_DESTINATION_INVALID => {
"BTC_WITHDRAWAL_DESTINATION_INVALID"
}
Self::BCH_WITHDRAWAL_DESTINATION_INVALID => {
"BCH_WITHDRAWAL_DESTINATION_INVALID"
}
Self::DOGE_WITHDRAWAL_DESTINATION_INVALID => {
"DOGE_WITHDRAWAL_DESTINATION_INVALID"
}
Self::LTC_WITHDRAWAL_DESTINATION_INVALID => {
"LTC_WITHDRAWAL_DESTINATION_INVALID"
}
Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID => {
"SOLANA_WITHDRAWAL_DESTINATION_INVALID"
}
Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID => {
"XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID"
}
Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID => {
"XRP_WITHDRAWAL_DESTINATION_TAG_INVALID"
}
Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT => {
"WITHDRAWAL_LIQUIDITY_INSUFFICIENT"
}
Self::COMPLIANCE_HIGH_RISK_ADDRESS => "COMPLIANCE_HIGH_RISK_ADDRESS",
Self::REQUEST_VERIFICATION_REJECTED => "REQUEST_VERIFICATION_REJECTED",
Self::REJECTED => "REJECTED",
Self::ERROR_UNMAPPED => "ERROR_UNMAPPED",
Self::ERROR_NETWORK_UNSUPPORTED => "ERROR_NETWORK_UNSUPPORTED",
Self::ERROR_REQUEST_PROCESSING_FAILED => "ERROR_REQUEST_PROCESSING_FAILED",
Self::ERROR_REQUEST_VERIFICATION_FAILED => {
"ERROR_REQUEST_VERIFICATION_FAILED"
}
Self::ERROR_RESULT_SUBMISSION_FAILED => "ERROR_RESULT_SUBMISSION_FAILED",
Self::ERROR_STATUS_UNKNOWN => "ERROR_STATUS_UNKNOWN",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"REASON_UNSPECIFIED" => {
::core::option::Option::Some(Self::REASON_UNSPECIFIED)
}
"DEPOSIT_WAIT_EXPIRED" => {
::core::option::Option::Some(Self::DEPOSIT_WAIT_EXPIRED)
}
"DEPOSIT_AMOUNT_INVALID" => {
::core::option::Option::Some(Self::DEPOSIT_AMOUNT_INVALID)
}
"DEPOSIT_AMOUNT_BELOW_MINIMUM" => {
::core::option::Option::Some(Self::DEPOSIT_AMOUNT_BELOW_MINIMUM)
}
"DEPOSIT_AMOUNT_NOT_ABOVE_FEE" => {
::core::option::Option::Some(Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE)
}
"DEPOSIT_NET_AMOUNT_BELOW_MINIMUM" => {
::core::option::Option::Some(Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM)
}
"EVM_DEPOSIT_SOURCE_TX_INVALID" => {
::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_INVALID)
}
"EVM_DEPOSIT_SOURCE_TX_ZERO" => {
::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_ZERO)
}
"EVM_DEPOSIT_SOURCE_TX_NOT_FOUND" => {
::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND)
}
"EVM_DEPOSIT_SOURCE_TX_REVERTED" => {
::core::option::Option::Some(Self::EVM_DEPOSIT_SOURCE_TX_REVERTED)
}
"EVM_DEPOSIT_TRANSFER_MISMATCH" => {
::core::option::Option::Some(Self::EVM_DEPOSIT_TRANSFER_MISMATCH)
}
"UTXO_DEPOSIT_TRANSACTION_MISMATCH" => {
::core::option::Option::Some(Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH)
}
"BTC_DEPOSIT_TRANSACTION_MISMATCH" => {
::core::option::Option::Some(Self::BTC_DEPOSIT_TRANSACTION_MISMATCH)
}
"BCH_DEPOSIT_TRANSACTION_MISMATCH" => {
::core::option::Option::Some(Self::BCH_DEPOSIT_TRANSACTION_MISMATCH)
}
"DOGE_DEPOSIT_TRANSACTION_MISMATCH" => {
::core::option::Option::Some(Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH)
}
"LTC_DEPOSIT_TRANSACTION_MISMATCH" => {
::core::option::Option::Some(Self::LTC_DEPOSIT_TRANSACTION_MISMATCH)
}
"UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS" => {
::core::option::Option::Some(
Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS,
)
}
"SOLANA_DEPOSIT_SIGNATURE_INVALID" => {
::core::option::Option::Some(Self::SOLANA_DEPOSIT_SIGNATURE_INVALID)
}
"SOLANA_DEPOSIT_TRANSACTION_FAILED" => {
::core::option::Option::Some(Self::SOLANA_DEPOSIT_TRANSACTION_FAILED)
}
"SOLANA_DEPOSIT_TRANSFER_MISMATCH" => {
::core::option::Option::Some(Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH)
}
"XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID" => {
::core::option::Option::Some(Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID)
}
"XRP_DEPOSIT_SOURCE_ADDRESS_INVALID" => {
::core::option::Option::Some(Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID)
}
"XRP_DEPOSIT_ADDRESS_INVALID" => {
::core::option::Option::Some(Self::XRP_DEPOSIT_ADDRESS_INVALID)
}
"XRP_DEPOSIT_PAYMENT_MISMATCH" => {
::core::option::Option::Some(Self::XRP_DEPOSIT_PAYMENT_MISMATCH)
}
"REJECTION_UNMAPPED" => {
::core::option::Option::Some(Self::REJECTION_UNMAPPED)
}
"WITHDRAWAL_AMOUNT_INVALID" => {
::core::option::Option::Some(Self::WITHDRAWAL_AMOUNT_INVALID)
}
"WITHDRAWAL_AMOUNT_BELOW_MINIMUM" => {
::core::option::Option::Some(Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM)
}
"WITHDRAWAL_ASSET_INVALID" => {
::core::option::Option::Some(Self::WITHDRAWAL_ASSET_INVALID)
}
"WITHDRAWAL_SENDER_INVALID" => {
::core::option::Option::Some(Self::WITHDRAWAL_SENDER_INVALID)
}
"WITHDRAWAL_DESTINATION_INVALID" => {
::core::option::Option::Some(Self::WITHDRAWAL_DESTINATION_INVALID)
}
"WITHDRAWAL_ASSET_UNAVAILABLE" => {
::core::option::Option::Some(Self::WITHDRAWAL_ASSET_UNAVAILABLE)
}
"EVM_WITHDRAWAL_DESTINATION_INVALID" => {
::core::option::Option::Some(Self::EVM_WITHDRAWAL_DESTINATION_INVALID)
}
"BTC_WITHDRAWAL_DESTINATION_INVALID" => {
::core::option::Option::Some(Self::BTC_WITHDRAWAL_DESTINATION_INVALID)
}
"BCH_WITHDRAWAL_DESTINATION_INVALID" => {
::core::option::Option::Some(Self::BCH_WITHDRAWAL_DESTINATION_INVALID)
}
"DOGE_WITHDRAWAL_DESTINATION_INVALID" => {
::core::option::Option::Some(Self::DOGE_WITHDRAWAL_DESTINATION_INVALID)
}
"LTC_WITHDRAWAL_DESTINATION_INVALID" => {
::core::option::Option::Some(Self::LTC_WITHDRAWAL_DESTINATION_INVALID)
}
"SOLANA_WITHDRAWAL_DESTINATION_INVALID" => {
::core::option::Option::Some(Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID)
}
"XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID" => {
::core::option::Option::Some(
Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID,
)
}
"XRP_WITHDRAWAL_DESTINATION_TAG_INVALID" => {
::core::option::Option::Some(
Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID,
)
}
"WITHDRAWAL_LIQUIDITY_INSUFFICIENT" => {
::core::option::Option::Some(Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT)
}
"COMPLIANCE_HIGH_RISK_ADDRESS" => {
::core::option::Option::Some(Self::COMPLIANCE_HIGH_RISK_ADDRESS)
}
"REQUEST_VERIFICATION_REJECTED" => {
::core::option::Option::Some(Self::REQUEST_VERIFICATION_REJECTED)
}
"REJECTED" => ::core::option::Option::Some(Self::REJECTED),
"ERROR_UNMAPPED" => ::core::option::Option::Some(Self::ERROR_UNMAPPED),
"ERROR_NETWORK_UNSUPPORTED" => {
::core::option::Option::Some(Self::ERROR_NETWORK_UNSUPPORTED)
}
"ERROR_REQUEST_PROCESSING_FAILED" => {
::core::option::Option::Some(Self::ERROR_REQUEST_PROCESSING_FAILED)
}
"ERROR_REQUEST_VERIFICATION_FAILED" => {
::core::option::Option::Some(Self::ERROR_REQUEST_VERIFICATION_FAILED)
}
"ERROR_RESULT_SUBMISSION_FAILED" => {
::core::option::Option::Some(Self::ERROR_RESULT_SUBMISSION_FAILED)
}
"ERROR_STATUS_UNKNOWN" => {
::core::option::Option::Some(Self::ERROR_STATUS_UNKNOWN)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::REASON_UNSPECIFIED,
Self::DEPOSIT_WAIT_EXPIRED,
Self::DEPOSIT_AMOUNT_INVALID,
Self::DEPOSIT_AMOUNT_BELOW_MINIMUM,
Self::DEPOSIT_AMOUNT_NOT_ABOVE_FEE,
Self::DEPOSIT_NET_AMOUNT_BELOW_MINIMUM,
Self::EVM_DEPOSIT_SOURCE_TX_INVALID,
Self::EVM_DEPOSIT_SOURCE_TX_ZERO,
Self::EVM_DEPOSIT_SOURCE_TX_NOT_FOUND,
Self::EVM_DEPOSIT_SOURCE_TX_REVERTED,
Self::EVM_DEPOSIT_TRANSFER_MISMATCH,
Self::UTXO_DEPOSIT_TRANSACTION_MISMATCH,
Self::BTC_DEPOSIT_TRANSACTION_MISMATCH,
Self::BCH_DEPOSIT_TRANSACTION_MISMATCH,
Self::DOGE_DEPOSIT_TRANSACTION_MISMATCH,
Self::LTC_DEPOSIT_TRANSACTION_MISMATCH,
Self::UTXO_DEPOSIT_SOURCE_IS_DEPOSIT_ADDRESS,
Self::SOLANA_DEPOSIT_SIGNATURE_INVALID,
Self::SOLANA_DEPOSIT_TRANSACTION_FAILED,
Self::SOLANA_DEPOSIT_TRANSFER_MISMATCH,
Self::XRP_DEPOSIT_SOURCE_HASH_INDEX_INVALID,
Self::XRP_DEPOSIT_SOURCE_ADDRESS_INVALID,
Self::XRP_DEPOSIT_ADDRESS_INVALID,
Self::XRP_DEPOSIT_PAYMENT_MISMATCH,
Self::REJECTION_UNMAPPED,
Self::WITHDRAWAL_AMOUNT_INVALID,
Self::WITHDRAWAL_AMOUNT_BELOW_MINIMUM,
Self::WITHDRAWAL_ASSET_INVALID,
Self::WITHDRAWAL_SENDER_INVALID,
Self::WITHDRAWAL_DESTINATION_INVALID,
Self::WITHDRAWAL_ASSET_UNAVAILABLE,
Self::EVM_WITHDRAWAL_DESTINATION_INVALID,
Self::BTC_WITHDRAWAL_DESTINATION_INVALID,
Self::BCH_WITHDRAWAL_DESTINATION_INVALID,
Self::DOGE_WITHDRAWAL_DESTINATION_INVALID,
Self::LTC_WITHDRAWAL_DESTINATION_INVALID,
Self::SOLANA_WITHDRAWAL_DESTINATION_INVALID,
Self::XRP_WITHDRAWAL_CLASSIC_ADDRESS_INVALID,
Self::XRP_WITHDRAWAL_DESTINATION_TAG_INVALID,
Self::WITHDRAWAL_LIQUIDITY_INSUFFICIENT,
Self::COMPLIANCE_HIGH_RISK_ADDRESS,
Self::REQUEST_VERIFICATION_REJECTED,
Self::REJECTED,
Self::ERROR_UNMAPPED,
Self::ERROR_NETWORK_UNSUPPORTED,
Self::ERROR_REQUEST_PROCESSING_FAILED,
Self::ERROR_REQUEST_VERIFICATION_FAILED,
Self::ERROR_RESULT_SUBMISSION_FAILED,
Self::ERROR_STATUS_UNKNOWN,
]
}
}
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ZipperReasonDetails {
#[serde(
rename = "code",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub code: ::buffa::EnumValue<ZipperReasonCode>,
#[serde(
rename = "reasonId",
alias = "reason_id",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub reason_id: ::buffa::alloc::string::String,
#[serde(
rename = "message",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub message: ::buffa::alloc::string::String,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ZipperReasonDetails {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ZipperReasonDetails")
.field("code", &self.code)
.field("reason_id", &self.reason_id)
.field("message", &self.message)
.finish()
}
}
impl ZipperReasonDetails {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZipperReasonDetails";
}
::buffa::impl_default_instance!(ZipperReasonDetails);
impl ::buffa::MessageName for ZipperReasonDetails {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ZipperReasonDetails";
const FULL_NAME: &'static str = "chain.zipper.v1.ZipperReasonDetails";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZipperReasonDetails";
}
impl ::buffa::Message for ZipperReasonDetails {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
{
let val = self.code.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if !self.reason_id.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.reason_id) as u32;
}
if !self.message.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.message) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
{
let val = self.code.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
if !self.reason_id.is_empty() {
::buffa::types::put_string_field(2u32, &self.reason_id, buf);
}
if !self.message.is_empty() {
::buffa::types::put_string_field(3u32, &self.message, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.code = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.reason_id, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.message, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.code = ::buffa::EnumValue::from(0);
self.reason_id.clear();
self.message.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ZipperReasonDetails {
const PROTO_FQN: &'static str = "chain.zipper.v1.ZipperReasonDetails";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ZipperReasonDetails {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __ZIPPER_REASON_DETAILS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.ZipperReasonDetails",
to_json: ::buffa::type_registry::any_to_json::<ZipperReasonDetails>,
from_json: ::buffa::type_registry::any_from_json::<ZipperReasonDetails>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ChainConfig {
#[serde(
rename = "chainId",
alias = "chain_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub chain_id: u32,
#[serde(
rename = "code",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub code: ::buffa::alloc::string::String,
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(
rename = "nativeChainId",
alias = "native_chain_id",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub native_chain_id: ::buffa::alloc::string::String,
#[serde(
rename = "nativeCurrencySymbol",
alias = "native_currency_symbol",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub native_currency_symbol: ::buffa::alloc::string::String,
#[serde(
rename = "explorerUrl",
alias = "explorer_url",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub explorer_url: ::buffa::alloc::string::String,
#[serde(
rename = "icon",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub icon: ::buffa::alloc::string::String,
#[serde(
rename = "requiredConfirmations",
alias = "required_confirmations",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub required_confirmations: u32,
#[serde(
rename = "confirmationTimeSeconds",
alias = "confirmation_time_seconds",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub confirmation_time_seconds: u32,
#[serde(
rename = "isCaseSensitive",
alias = "is_case_sensitive",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)]
pub is_case_sensitive: bool,
#[serde(
rename = "minAddressLength",
alias = "min_address_length",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub min_address_length: u32,
#[serde(
rename = "maxAddressLength",
alias = "max_address_length",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub max_address_length: u32,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ChainConfig {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ChainConfig")
.field("chain_id", &self.chain_id)
.field("code", &self.code)
.field("name", &self.name)
.field("native_chain_id", &self.native_chain_id)
.field("native_currency_symbol", &self.native_currency_symbol)
.field("explorer_url", &self.explorer_url)
.field("icon", &self.icon)
.field("required_confirmations", &self.required_confirmations)
.field("confirmation_time_seconds", &self.confirmation_time_seconds)
.field("is_case_sensitive", &self.is_case_sensitive)
.field("min_address_length", &self.min_address_length)
.field("max_address_length", &self.max_address_length)
.finish()
}
}
impl ChainConfig {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainConfig";
}
::buffa::impl_default_instance!(ChainConfig);
impl ::buffa::MessageName for ChainConfig {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ChainConfig";
const FULL_NAME: &'static str = "chain.zipper.v1.ChainConfig";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainConfig";
}
impl ::buffa::Message for ChainConfig {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.chain_id != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
}
if !self.code.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.native_chain_id.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.native_chain_id) as u32;
}
if !self.native_currency_symbol.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.native_currency_symbol)
as u32;
}
if !self.explorer_url.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.explorer_url) as u32;
}
if !self.icon.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.icon) as u32;
}
if self.required_confirmations != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.required_confirmations)
as u32;
}
if self.confirmation_time_seconds != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.confirmation_time_seconds)
as u32;
}
if self.is_case_sensitive {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.min_address_length != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.min_address_length) as u32;
}
if self.max_address_length != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.max_address_length) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.chain_id != 0u32 {
::buffa::types::put_uint32_field(1u32, self.chain_id, buf);
}
if !self.code.is_empty() {
::buffa::types::put_string_field(2u32, &self.code, buf);
}
if !self.name.is_empty() {
::buffa::types::put_string_field(3u32, &self.name, buf);
}
if !self.native_chain_id.is_empty() {
::buffa::types::put_string_field(4u32, &self.native_chain_id, buf);
}
if !self.native_currency_symbol.is_empty() {
::buffa::types::put_string_field(5u32, &self.native_currency_symbol, buf);
}
if !self.explorer_url.is_empty() {
::buffa::types::put_string_field(6u32, &self.explorer_url, buf);
}
if !self.icon.is_empty() {
::buffa::types::put_string_field(7u32, &self.icon, buf);
}
if self.required_confirmations != 0u32 {
::buffa::types::put_uint32_field(8u32, self.required_confirmations, buf);
}
if self.confirmation_time_seconds != 0u32 {
::buffa::types::put_uint32_field(9u32, self.confirmation_time_seconds, buf);
}
if self.is_case_sensitive {
::buffa::types::put_bool_field(10u32, self.is_case_sensitive, buf);
}
if self.min_address_length != 0u32 {
::buffa::types::put_uint32_field(11u32, self.min_address_length, buf);
}
if self.max_address_length != 0u32 {
::buffa::types::put_uint32_field(12u32, self.max_address_length, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.chain_id = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.code, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.name, buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.native_chain_id, buf)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.native_currency_symbol, buf)?;
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.explorer_url, buf)?;
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.icon, buf)?;
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.required_confirmations = ::buffa::types::decode_uint32(buf)?;
}
9u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.confirmation_time_seconds = ::buffa::types::decode_uint32(buf)?;
}
10u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.is_case_sensitive = ::buffa::types::decode_bool(buf)?;
}
11u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.min_address_length = ::buffa::types::decode_uint32(buf)?;
}
12u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.max_address_length = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.chain_id = 0u32;
self.code.clear();
self.name.clear();
self.native_chain_id.clear();
self.native_currency_symbol.clear();
self.explorer_url.clear();
self.icon.clear();
self.required_confirmations = 0u32;
self.confirmation_time_seconds = 0u32;
self.is_case_sensitive = false;
self.min_address_length = 0u32;
self.max_address_length = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ChainConfig {
const PROTO_FQN: &'static str = "chain.zipper.v1.ChainConfig";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ChainConfig {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CHAIN_CONFIG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.ChainConfig",
to_json: ::buffa::type_registry::any_to_json::<ChainConfig>,
from_json: ::buffa::type_registry::any_from_json::<ChainConfig>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct AssetChainVariant {
#[serde(
rename = "zippedAssetId",
alias = "zipped_asset_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub zipped_asset_id: u32,
#[serde(
rename = "chainId",
alias = "chain_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub chain_id: u32,
#[serde(
rename = "isNativeAsset",
alias = "is_native_asset",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)]
pub is_native_asset: bool,
#[serde(
rename = "networkFee",
alias = "network_fee",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub network_fee: ::buffa::alloc::string::String,
#[serde(
rename = "ztokenAddress",
alias = "ztoken_address",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub ztoken_address: ::buffa::alloc::string::String,
#[serde(
rename = "sourceAddress",
alias = "source_address",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub source_address: ::buffa::alloc::string::String,
#[serde(
rename = "sourceDecimals",
alias = "source_decimals",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub source_decimals: u32,
#[serde(
rename = "ztokenDecimals",
alias = "ztoken_decimals",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub ztoken_decimals: u32,
#[serde(
rename = "depositMinAmount",
alias = "deposit_min_amount",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub deposit_min_amount: ::buffa::alloc::string::String,
#[serde(
rename = "withdrawMinAmount",
alias = "withdraw_min_amount",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub withdraw_min_amount: ::buffa::alloc::string::String,
#[serde(
rename = "supplyQ",
alias = "supply_q",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub supply_q: u64,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AssetChainVariant {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AssetChainVariant")
.field("zipped_asset_id", &self.zipped_asset_id)
.field("chain_id", &self.chain_id)
.field("is_native_asset", &self.is_native_asset)
.field("network_fee", &self.network_fee)
.field("ztoken_address", &self.ztoken_address)
.field("source_address", &self.source_address)
.field("source_decimals", &self.source_decimals)
.field("ztoken_decimals", &self.ztoken_decimals)
.field("deposit_min_amount", &self.deposit_min_amount)
.field("withdraw_min_amount", &self.withdraw_min_amount)
.field("supply_q", &self.supply_q)
.finish()
}
}
impl AssetChainVariant {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetChainVariant";
}
::buffa::impl_default_instance!(AssetChainVariant);
impl ::buffa::MessageName for AssetChainVariant {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "AssetChainVariant";
const FULL_NAME: &'static str = "chain.zipper.v1.AssetChainVariant";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetChainVariant";
}
impl ::buffa::Message for AssetChainVariant {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.zipped_asset_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.zipped_asset_id) as u32;
}
if self.chain_id != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
}
if self.is_native_asset {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.network_fee.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.network_fee) as u32;
}
if !self.ztoken_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.ztoken_address) as u32;
}
if !self.source_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.source_address) as u32;
}
if self.source_decimals != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.source_decimals) as u32;
}
if self.ztoken_decimals != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.ztoken_decimals) as u32;
}
if !self.deposit_min_amount.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.deposit_min_amount)
as u32;
}
if !self.withdraw_min_amount.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.withdraw_min_amount)
as u32;
}
if self.supply_q != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.supply_q) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.zipped_asset_id != 0u32 {
::buffa::types::put_uint32_field(1u32, self.zipped_asset_id, buf);
}
if self.chain_id != 0u32 {
::buffa::types::put_uint32_field(2u32, self.chain_id, buf);
}
if self.is_native_asset {
::buffa::types::put_bool_field(3u32, self.is_native_asset, buf);
}
if !self.network_fee.is_empty() {
::buffa::types::put_string_field(4u32, &self.network_fee, buf);
}
if !self.ztoken_address.is_empty() {
::buffa::types::put_string_field(6u32, &self.ztoken_address, buf);
}
if !self.source_address.is_empty() {
::buffa::types::put_string_field(7u32, &self.source_address, buf);
}
if self.source_decimals != 0u32 {
::buffa::types::put_uint32_field(8u32, self.source_decimals, buf);
}
if self.ztoken_decimals != 0u32 {
::buffa::types::put_uint32_field(9u32, self.ztoken_decimals, buf);
}
if !self.deposit_min_amount.is_empty() {
::buffa::types::put_string_field(10u32, &self.deposit_min_amount, buf);
}
if !self.withdraw_min_amount.is_empty() {
::buffa::types::put_string_field(11u32, &self.withdraw_min_amount, buf);
}
if self.supply_q != 0u64 {
::buffa::types::put_uint64_field(12u32, self.supply_q, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.zipped_asset_id = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.chain_id = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.is_native_asset = ::buffa::types::decode_bool(buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.network_fee, buf)?;
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.ztoken_address, buf)?;
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.source_address, buf)?;
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.source_decimals = ::buffa::types::decode_uint32(buf)?;
}
9u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.ztoken_decimals = ::buffa::types::decode_uint32(buf)?;
}
10u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.deposit_min_amount, buf)?;
}
11u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.withdraw_min_amount, buf)?;
}
12u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.supply_q = ::buffa::types::decode_uint64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.zipped_asset_id = 0u32;
self.chain_id = 0u32;
self.is_native_asset = false;
self.network_fee.clear();
self.ztoken_address.clear();
self.source_address.clear();
self.source_decimals = 0u32;
self.ztoken_decimals = 0u32;
self.deposit_min_amount.clear();
self.withdraw_min_amount.clear();
self.supply_q = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AssetChainVariant {
const PROTO_FQN: &'static str = "chain.zipper.v1.AssetChainVariant";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for AssetChainVariant {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __ASSET_CHAIN_VARIANT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.AssetChainVariant",
to_json: ::buffa::type_registry::any_to_json::<AssetChainVariant>,
from_json: ::buffa::type_registry::any_from_json::<AssetChainVariant>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ZippedAssetSupplyUpdate {
#[serde(
rename = "zippedAssetId",
alias = "zipped_asset_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub zipped_asset_id: u32,
#[serde(
rename = "supplyQ",
alias = "supply_q",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub supply_q: u64,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ZippedAssetSupplyUpdate {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ZippedAssetSupplyUpdate")
.field("zipped_asset_id", &self.zipped_asset_id)
.field("supply_q", &self.supply_q)
.finish()
}
}
impl ZippedAssetSupplyUpdate {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyUpdate";
}
::buffa::impl_default_instance!(ZippedAssetSupplyUpdate);
impl ::buffa::MessageName for ZippedAssetSupplyUpdate {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ZippedAssetSupplyUpdate";
const FULL_NAME: &'static str = "chain.zipper.v1.ZippedAssetSupplyUpdate";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyUpdate";
}
impl ::buffa::Message for ZippedAssetSupplyUpdate {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.zipped_asset_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.zipped_asset_id) as u32;
}
if self.supply_q != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.supply_q) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.zipped_asset_id != 0u32 {
::buffa::types::put_uint32_field(1u32, self.zipped_asset_id, buf);
}
if self.supply_q != 0u64 {
::buffa::types::put_uint64_field(2u32, self.supply_q, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.zipped_asset_id = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.supply_q = ::buffa::types::decode_uint64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.zipped_asset_id = 0u32;
self.supply_q = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ZippedAssetSupplyUpdate {
const PROTO_FQN: &'static str = "chain.zipper.v1.ZippedAssetSupplyUpdate";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ZippedAssetSupplyUpdate {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __ZIPPED_ASSET_SUPPLY_UPDATE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyUpdate",
to_json: ::buffa::type_registry::any_to_json::<ZippedAssetSupplyUpdate>,
from_json: ::buffa::type_registry::any_from_json::<ZippedAssetSupplyUpdate>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ZippedAssetSupplyBatch {
#[serde(
rename = "updates",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub updates: ::buffa::alloc::vec::Vec<ZippedAssetSupplyUpdate>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ZippedAssetSupplyBatch {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ZippedAssetSupplyBatch").field("updates", &self.updates).finish()
}
}
impl ZippedAssetSupplyBatch {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyBatch";
}
::buffa::impl_default_instance!(ZippedAssetSupplyBatch);
impl ::buffa::MessageName for ZippedAssetSupplyBatch {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ZippedAssetSupplyBatch";
const FULL_NAME: &'static str = "chain.zipper.v1.ZippedAssetSupplyBatch";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyBatch";
}
impl ::buffa::Message for ZippedAssetSupplyBatch {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.updates {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.updates {
::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.updates.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.updates.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ZippedAssetSupplyBatch {
const PROTO_FQN: &'static str = "chain.zipper.v1.ZippedAssetSupplyBatch";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ZippedAssetSupplyBatch {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __ZIPPED_ASSET_SUPPLY_BATCH_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyBatch",
to_json: ::buffa::type_registry::any_to_json::<ZippedAssetSupplyBatch>,
from_json: ::buffa::type_registry::any_from_json::<ZippedAssetSupplyBatch>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct AssetConfig {
#[serde(
rename = "asset",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub asset: ::buffa::alloc::string::String,
#[serde(
rename = "ledgerId",
alias = "ledger_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub ledger_id: u32,
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(
rename = "icon",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub icon: ::buffa::alloc::string::String,
#[serde(
rename = "quantityScale",
alias = "quantity_scale",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub quantity_scale: u32,
#[serde(
rename = "quantityDisplayDecimals",
alias = "quantity_display_decimals",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub quantity_display_decimals: u32,
#[serde(
rename = "variants",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub variants: ::buffa::alloc::vec::Vec<AssetChainVariant>,
#[serde(
rename = "uAssetId",
alias = "u_asset_id",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub u_asset_id: ::buffa::alloc::string::String,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AssetConfig {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AssetConfig")
.field("asset", &self.asset)
.field("ledger_id", &self.ledger_id)
.field("name", &self.name)
.field("icon", &self.icon)
.field("quantity_scale", &self.quantity_scale)
.field("quantity_display_decimals", &self.quantity_display_decimals)
.field("variants", &self.variants)
.field("u_asset_id", &self.u_asset_id)
.finish()
}
}
impl AssetConfig {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetConfig";
}
::buffa::impl_default_instance!(AssetConfig);
impl ::buffa::MessageName for AssetConfig {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "AssetConfig";
const FULL_NAME: &'static str = "chain.zipper.v1.AssetConfig";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetConfig";
}
impl ::buffa::Message for AssetConfig {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.asset.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.asset) as u32;
}
if self.ledger_id != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.ledger_id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.icon.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.icon) as u32;
}
if self.quantity_scale != 0u32 {
size
+= 1u32 + ::buffa::types::uint32_encoded_len(self.quantity_scale) as u32;
}
if self.quantity_display_decimals != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.quantity_display_decimals)
as u32;
}
for v in &self.variants {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.u_asset_id.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.u_asset_id) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.asset.is_empty() {
::buffa::types::put_string_field(1u32, &self.asset, buf);
}
if self.ledger_id != 0u32 {
::buffa::types::put_uint32_field(2u32, self.ledger_id, buf);
}
if !self.name.is_empty() {
::buffa::types::put_string_field(3u32, &self.name, buf);
}
if !self.icon.is_empty() {
::buffa::types::put_string_field(4u32, &self.icon, buf);
}
if self.quantity_scale != 0u32 {
::buffa::types::put_uint32_field(5u32, self.quantity_scale, buf);
}
if self.quantity_display_decimals != 0u32 {
::buffa::types::put_uint32_field(6u32, self.quantity_display_decimals, buf);
}
for v in &self.variants {
::buffa::types::put_len_delimited_header(7u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
if !self.u_asset_id.is_empty() {
::buffa::types::put_string_field(8u32, &self.u_asset_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.asset, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.ledger_id = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.name, buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.icon, buf)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.quantity_scale = ::buffa::types::decode_uint32(buf)?;
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.quantity_display_decimals = ::buffa::types::decode_uint32(buf)?;
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.variants.push(elem);
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.u_asset_id, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.asset.clear();
self.ledger_id = 0u32;
self.name.clear();
self.icon.clear();
self.quantity_scale = 0u32;
self.quantity_display_decimals = 0u32;
self.variants.clear();
self.u_asset_id.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AssetConfig {
const PROTO_FQN: &'static str = "chain.zipper.v1.AssetConfig";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for AssetConfig {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __ASSET_CONFIG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.AssetConfig",
to_json: ::buffa::type_registry::any_to_json::<AssetConfig>,
from_json: ::buffa::type_registry::any_from_json::<AssetConfig>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ChainContractConfig {
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(
rename = "address",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub address: ::buffa::alloc::string::String,
#[serde(
rename = "type",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub r#type: ::buffa::alloc::string::String,
#[serde(
rename = "description",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub description: ::buffa::alloc::string::String,
#[serde(
rename = "version",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub version: u32,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ChainContractConfig {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ChainContractConfig")
.field("name", &self.name)
.field("address", &self.address)
.field("type", &self.r#type)
.field("description", &self.description)
.field("version", &self.version)
.finish()
}
}
impl ChainContractConfig {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainContractConfig";
}
::buffa::impl_default_instance!(ChainContractConfig);
impl ::buffa::MessageName for ChainContractConfig {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ChainContractConfig";
const FULL_NAME: &'static str = "chain.zipper.v1.ChainContractConfig";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainContractConfig";
}
impl ::buffa::Message for ChainContractConfig {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.address.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.address) as u32;
}
if !self.r#type.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.r#type) as u32;
}
if !self.description.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.description) as u32;
}
if self.version != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.version) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::types::put_string_field(1u32, &self.name, buf);
}
if !self.address.is_empty() {
::buffa::types::put_string_field(2u32, &self.address, buf);
}
if !self.r#type.is_empty() {
::buffa::types::put_string_field(3u32, &self.r#type, buf);
}
if !self.description.is_empty() {
::buffa::types::put_string_field(4u32, &self.description, buf);
}
if self.version != 0u32 {
::buffa::types::put_uint32_field(5u32, self.version, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.name, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.address, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.r#type, buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.description, buf)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.version = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.address.clear();
self.r#type.clear();
self.description.clear();
self.version = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ChainContractConfig {
const PROTO_FQN: &'static str = "chain.zipper.v1.ChainContractConfig";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ChainContractConfig {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CHAIN_CONTRACT_CONFIG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.ChainContractConfig",
to_json: ::buffa::type_registry::any_to_json::<ChainContractConfig>,
from_json: ::buffa::type_registry::any_from_json::<ChainContractConfig>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GetDepositWithdrawConfigRequest {
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetDepositWithdrawConfigRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetDepositWithdrawConfigRequest").finish()
}
}
impl GetDepositWithdrawConfigRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigRequest";
}
::buffa::impl_default_instance!(GetDepositWithdrawConfigRequest);
impl ::buffa::MessageName for GetDepositWithdrawConfigRequest {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "GetDepositWithdrawConfigRequest";
const FULL_NAME: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigRequest";
}
impl ::buffa::Message for GetDepositWithdrawConfigRequest {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetDepositWithdrawConfigRequest {
const PROTO_FQN: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for GetDepositWithdrawConfigRequest {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __GET_DEPOSIT_WITHDRAW_CONFIG_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigRequest",
to_json: ::buffa::type_registry::any_to_json::<GetDepositWithdrawConfigRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetDepositWithdrawConfigRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GetDepositWithdrawConfigResponse {
#[serde(
rename = "chains",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub chains: ::buffa::alloc::vec::Vec<ChainConfig>,
#[serde(
rename = "assets",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub assets: ::buffa::alloc::vec::Vec<AssetConfig>,
#[serde(
rename = "tsSec",
alias = "ts_sec",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub ts_sec: u64,
#[serde(
rename = "polyesterChainId",
alias = "polyester_chain_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub polyester_chain_id: u32,
#[serde(
rename = "contracts",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub contracts: ::buffa::alloc::vec::Vec<ChainContractConfig>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetDepositWithdrawConfigResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetDepositWithdrawConfigResponse")
.field("chains", &self.chains)
.field("assets", &self.assets)
.field("ts_sec", &self.ts_sec)
.field("polyester_chain_id", &self.polyester_chain_id)
.field("contracts", &self.contracts)
.finish()
}
}
impl GetDepositWithdrawConfigResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigResponse";
}
::buffa::impl_default_instance!(GetDepositWithdrawConfigResponse);
impl ::buffa::MessageName for GetDepositWithdrawConfigResponse {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "GetDepositWithdrawConfigResponse";
const FULL_NAME: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigResponse";
}
impl ::buffa::Message for GetDepositWithdrawConfigResponse {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.chains {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.assets {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.ts_sec != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.ts_sec) as u32;
}
if self.polyester_chain_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.polyester_chain_id) as u32;
}
for v in &self.contracts {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.chains {
::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
for v in &self.assets {
::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
if self.ts_sec != 0u64 {
::buffa::types::put_uint64_field(3u32, self.ts_sec, buf);
}
if self.polyester_chain_id != 0u32 {
::buffa::types::put_uint32_field(4u32, self.polyester_chain_id, buf);
}
for v in &self.contracts {
::buffa::types::put_len_delimited_header(5u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.chains.push(elem);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.assets.push(elem);
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.ts_sec = ::buffa::types::decode_uint64(buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.polyester_chain_id = ::buffa::types::decode_uint32(buf)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.contracts.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.chains.clear();
self.assets.clear();
self.ts_sec = 0u64;
self.polyester_chain_id = 0u32;
self.contracts.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetDepositWithdrawConfigResponse {
const PROTO_FQN: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for GetDepositWithdrawConfigResponse {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __GET_DEPOSIT_WITHDRAW_CONFIG_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigResponse",
to_json: ::buffa::type_registry::any_to_json::<GetDepositWithdrawConfigResponse>,
from_json: ::buffa::type_registry::any_from_json::<GetDepositWithdrawConfigResponse>,
is_wkt: false,
};
#[allow(
non_camel_case_types,
dead_code,
unused_imports,
unused_qualifications,
clippy::derivable_impls,
clippy::match_single_binding,
clippy::uninlined_format_args,
clippy::doc_lazy_continuation,
clippy::module_inception
)]
pub mod __buffa {
#[allow(unused_imports)]
use super::*;
pub mod view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, Default)]
pub struct ZipperReasonDetailsView<'a> {
pub code: ::buffa::EnumValue<super::super::ZipperReasonCode>,
pub reason_id: &'a str,
pub message: &'a str,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ZipperReasonDetailsView<'a> {
type Owned = super::super::ZipperReasonDetails;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.code = ::buffa::EnumValue::from(
::buffa::types::decode_int32(&mut cur)?,
);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.reason_id = ::buffa::types::borrow_str(&mut cur)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.message = ::buffa::types::borrow_str(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ZipperReasonDetails,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ZipperReasonDetails,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ZipperReasonDetails {
code: self.code,
reason_id: self.reason_id.to_string(),
message: self.message.to_string(),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ZipperReasonDetailsView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
{
let val = self.code.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if !self.reason_id.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.reason_id) as u32;
}
if !self.message.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.message) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
{
let val = self.code.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
if !self.reason_id.is_empty() {
::buffa::types::put_string_field(2u32, &self.reason_id, buf);
}
if !self.message.is_empty() {
::buffa::types::put_string_field(3u32, &self.message, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ZipperReasonDetailsView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_default_enum_value(&self.code) {
__map.serialize_entry("code", &self.code)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.reason_id) {
__map.serialize_entry("reasonId", self.reason_id)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.message) {
__map.serialize_entry("message", self.message)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ZipperReasonDetailsView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ZipperReasonDetails";
const FULL_NAME: &'static str = "chain.zipper.v1.ZipperReasonDetails";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZipperReasonDetails";
}
::buffa::impl_default_view_instance!(ZipperReasonDetailsView);
::buffa::impl_view_reborrow!(ZipperReasonDetailsView);
#[derive(Clone, Debug)]
pub struct ZipperReasonDetailsOwnedView(
::buffa::OwnedView<ZipperReasonDetailsView<'static>>,
);
impl ZipperReasonDetailsOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZipperReasonDetailsOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZipperReasonDetailsOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ZipperReasonDetails,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZipperReasonDetailsOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &ZipperReasonDetailsView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ZipperReasonDetails,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn code(&self) -> ::buffa::EnumValue<super::super::ZipperReasonCode> {
self.0.reborrow().code
}
#[must_use]
pub fn reason_id(&self) -> &'_ str {
self.0.reborrow().reason_id
}
#[must_use]
pub fn message(&self) -> &'_ str {
self.0.reborrow().message
}
}
impl ::core::convert::From<::buffa::OwnedView<ZipperReasonDetailsView<'static>>>
for ZipperReasonDetailsOwnedView {
fn from(
inner: ::buffa::OwnedView<ZipperReasonDetailsView<'static>>,
) -> Self {
ZipperReasonDetailsOwnedView(inner)
}
}
impl ::core::convert::From<ZipperReasonDetailsOwnedView>
for ::buffa::OwnedView<ZipperReasonDetailsView<'static>> {
fn from(wrapper: ZipperReasonDetailsOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<ZipperReasonDetailsView<'static>>>
for ZipperReasonDetailsOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<ZipperReasonDetailsView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ZipperReasonDetails {
type View<'a> = ZipperReasonDetailsView<'a>;
type ViewHandle = ZipperReasonDetailsOwnedView;
}
impl ::serde::Serialize for ZipperReasonDetailsOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ChainConfigView<'a> {
pub chain_id: u32,
pub code: &'a str,
pub name: &'a str,
pub native_chain_id: &'a str,
pub native_currency_symbol: &'a str,
pub explorer_url: &'a str,
pub icon: &'a str,
pub required_confirmations: u32,
pub confirmation_time_seconds: u32,
pub is_case_sensitive: bool,
pub min_address_length: u32,
pub max_address_length: u32,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ChainConfigView<'a> {
type Owned = super::super::ChainConfig;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.chain_id = ::buffa::types::decode_uint32(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.code = ::buffa::types::borrow_str(&mut cur)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.name = ::buffa::types::borrow_str(&mut cur)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.native_chain_id = ::buffa::types::borrow_str(&mut cur)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.native_currency_symbol = ::buffa::types::borrow_str(
&mut cur,
)?;
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.explorer_url = ::buffa::types::borrow_str(&mut cur)?;
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.icon = ::buffa::types::borrow_str(&mut cur)?;
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.required_confirmations = ::buffa::types::decode_uint32(
&mut cur,
)?;
}
9u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.confirmation_time_seconds = ::buffa::types::decode_uint32(
&mut cur,
)?;
}
10u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.is_case_sensitive = ::buffa::types::decode_bool(&mut cur)?;
}
11u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.min_address_length = ::buffa::types::decode_uint32(
&mut cur,
)?;
}
12u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.max_address_length = ::buffa::types::decode_uint32(
&mut cur,
)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ChainConfig,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ChainConfig,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ChainConfig {
chain_id: self.chain_id,
code: self.code.to_string(),
name: self.name.to_string(),
native_chain_id: self.native_chain_id.to_string(),
native_currency_symbol: self.native_currency_symbol.to_string(),
explorer_url: self.explorer_url.to_string(),
icon: self.icon.to_string(),
required_confirmations: self.required_confirmations,
confirmation_time_seconds: self.confirmation_time_seconds,
is_case_sensitive: self.is_case_sensitive,
min_address_length: self.min_address_length,
max_address_length: self.max_address_length,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ChainConfigView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.chain_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
}
if !self.code.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.code) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.native_chain_id.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.native_chain_id)
as u32;
}
if !self.native_currency_symbol.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(
&self.native_currency_symbol,
) as u32;
}
if !self.explorer_url.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.explorer_url)
as u32;
}
if !self.icon.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.icon) as u32;
}
if self.required_confirmations != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(
self.required_confirmations,
) as u32;
}
if self.confirmation_time_seconds != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(
self.confirmation_time_seconds,
) as u32;
}
if self.is_case_sensitive {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.min_address_length != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.min_address_length)
as u32;
}
if self.max_address_length != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.max_address_length)
as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.chain_id != 0u32 {
::buffa::types::put_uint32_field(1u32, self.chain_id, buf);
}
if !self.code.is_empty() {
::buffa::types::put_string_field(2u32, &self.code, buf);
}
if !self.name.is_empty() {
::buffa::types::put_string_field(3u32, &self.name, buf);
}
if !self.native_chain_id.is_empty() {
::buffa::types::put_string_field(4u32, &self.native_chain_id, buf);
}
if !self.native_currency_symbol.is_empty() {
::buffa::types::put_string_field(
5u32,
&self.native_currency_symbol,
buf,
);
}
if !self.explorer_url.is_empty() {
::buffa::types::put_string_field(6u32, &self.explorer_url, buf);
}
if !self.icon.is_empty() {
::buffa::types::put_string_field(7u32, &self.icon, buf);
}
if self.required_confirmations != 0u32 {
::buffa::types::put_uint32_field(
8u32,
self.required_confirmations,
buf,
);
}
if self.confirmation_time_seconds != 0u32 {
::buffa::types::put_uint32_field(
9u32,
self.confirmation_time_seconds,
buf,
);
}
if self.is_case_sensitive {
::buffa::types::put_bool_field(10u32, self.is_case_sensitive, buf);
}
if self.min_address_length != 0u32 {
::buffa::types::put_uint32_field(
11u32,
self.min_address_length,
buf,
);
}
if self.max_address_length != 0u32 {
::buffa::types::put_uint32_field(
12u32,
self.max_address_length,
buf,
);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ChainConfigView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.chain_id) {
__map
.serialize_entry(
"chainId",
&::buffa::json_helpers::ProtoJson(&self.chain_id),
)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.code) {
__map.serialize_entry("code", self.code)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
__map.serialize_entry("name", self.name)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.native_chain_id) {
__map.serialize_entry("nativeChainId", self.native_chain_id)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(
self.native_currency_symbol,
) {
__map
.serialize_entry(
"nativeCurrencySymbol",
self.native_currency_symbol,
)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.explorer_url) {
__map.serialize_entry("explorerUrl", self.explorer_url)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.icon) {
__map.serialize_entry("icon", self.icon)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(
&self.required_confirmations,
) {
__map
.serialize_entry(
"requiredConfirmations",
&::buffa::json_helpers::ProtoJson(
&self.required_confirmations,
),
)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(
&self.confirmation_time_seconds,
) {
__map
.serialize_entry(
"confirmationTimeSeconds",
&::buffa::json_helpers::ProtoJson(
&self.confirmation_time_seconds,
),
)?;
}
if self.is_case_sensitive {
__map.serialize_entry("isCaseSensitive", &self.is_case_sensitive)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(
&self.min_address_length,
) {
__map
.serialize_entry(
"minAddressLength",
&::buffa::json_helpers::ProtoJson(&self.min_address_length),
)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(
&self.max_address_length,
) {
__map
.serialize_entry(
"maxAddressLength",
&::buffa::json_helpers::ProtoJson(&self.max_address_length),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ChainConfigView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ChainConfig";
const FULL_NAME: &'static str = "chain.zipper.v1.ChainConfig";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainConfig";
}
::buffa::impl_default_view_instance!(ChainConfigView);
::buffa::impl_view_reborrow!(ChainConfigView);
#[derive(Clone, Debug)]
pub struct ChainConfigOwnedView(::buffa::OwnedView<ChainConfigView<'static>>);
impl ChainConfigOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ChainConfigOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ChainConfigOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ChainConfig,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ChainConfigOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &ChainConfigView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ChainConfig,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn chain_id(&self) -> u32 {
self.0.reborrow().chain_id
}
#[must_use]
pub fn code(&self) -> &'_ str {
self.0.reborrow().code
}
#[must_use]
pub fn name(&self) -> &'_ str {
self.0.reborrow().name
}
#[must_use]
pub fn native_chain_id(&self) -> &'_ str {
self.0.reborrow().native_chain_id
}
#[must_use]
pub fn native_currency_symbol(&self) -> &'_ str {
self.0.reborrow().native_currency_symbol
}
#[must_use]
pub fn explorer_url(&self) -> &'_ str {
self.0.reborrow().explorer_url
}
#[must_use]
pub fn icon(&self) -> &'_ str {
self.0.reborrow().icon
}
#[must_use]
pub fn required_confirmations(&self) -> u32 {
self.0.reborrow().required_confirmations
}
#[must_use]
pub fn confirmation_time_seconds(&self) -> u32 {
self.0.reborrow().confirmation_time_seconds
}
#[must_use]
pub fn is_case_sensitive(&self) -> bool {
self.0.reborrow().is_case_sensitive
}
#[must_use]
pub fn min_address_length(&self) -> u32 {
self.0.reborrow().min_address_length
}
#[must_use]
pub fn max_address_length(&self) -> u32 {
self.0.reborrow().max_address_length
}
}
impl ::core::convert::From<::buffa::OwnedView<ChainConfigView<'static>>>
for ChainConfigOwnedView {
fn from(inner: ::buffa::OwnedView<ChainConfigView<'static>>) -> Self {
ChainConfigOwnedView(inner)
}
}
impl ::core::convert::From<ChainConfigOwnedView>
for ::buffa::OwnedView<ChainConfigView<'static>> {
fn from(wrapper: ChainConfigOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<ChainConfigView<'static>>>
for ChainConfigOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<ChainConfigView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ChainConfig {
type View<'a> = ChainConfigView<'a>;
type ViewHandle = ChainConfigOwnedView;
}
impl ::serde::Serialize for ChainConfigOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct AssetChainVariantView<'a> {
pub zipped_asset_id: u32,
pub chain_id: u32,
pub is_native_asset: bool,
pub network_fee: &'a str,
pub ztoken_address: &'a str,
pub source_address: &'a str,
pub source_decimals: u32,
pub ztoken_decimals: u32,
pub deposit_min_amount: &'a str,
pub withdraw_min_amount: &'a str,
pub supply_q: u64,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for AssetChainVariantView<'a> {
type Owned = super::super::AssetChainVariant;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.zipped_asset_id = ::buffa::types::decode_uint32(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.chain_id = ::buffa::types::decode_uint32(&mut cur)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.is_native_asset = ::buffa::types::decode_bool(&mut cur)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.network_fee = ::buffa::types::borrow_str(&mut cur)?;
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.ztoken_address = ::buffa::types::borrow_str(&mut cur)?;
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.source_address = ::buffa::types::borrow_str(&mut cur)?;
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.source_decimals = ::buffa::types::decode_uint32(&mut cur)?;
}
9u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.ztoken_decimals = ::buffa::types::decode_uint32(&mut cur)?;
}
10u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.deposit_min_amount = ::buffa::types::borrow_str(&mut cur)?;
}
11u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.withdraw_min_amount = ::buffa::types::borrow_str(&mut cur)?;
}
12u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.supply_q = ::buffa::types::decode_uint64(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::AssetChainVariant,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::AssetChainVariant,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::AssetChainVariant {
zipped_asset_id: self.zipped_asset_id,
chain_id: self.chain_id,
is_native_asset: self.is_native_asset,
network_fee: self.network_fee.to_string(),
ztoken_address: self.ztoken_address.to_string(),
source_address: self.source_address.to_string(),
source_decimals: self.source_decimals,
ztoken_decimals: self.ztoken_decimals,
deposit_min_amount: self.deposit_min_amount.to_string(),
withdraw_min_amount: self.withdraw_min_amount.to_string(),
supply_q: self.supply_q,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for AssetChainVariantView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.zipped_asset_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.zipped_asset_id)
as u32;
}
if self.chain_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.chain_id) as u32;
}
if self.is_native_asset {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.network_fee.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.network_fee)
as u32;
}
if !self.ztoken_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.ztoken_address)
as u32;
}
if !self.source_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.source_address)
as u32;
}
if self.source_decimals != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.source_decimals)
as u32;
}
if self.ztoken_decimals != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.ztoken_decimals)
as u32;
}
if !self.deposit_min_amount.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(
&self.deposit_min_amount,
) as u32;
}
if !self.withdraw_min_amount.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(
&self.withdraw_min_amount,
) as u32;
}
if self.supply_q != 0u64 {
size
+= 1u32
+ ::buffa::types::uint64_encoded_len(self.supply_q) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.zipped_asset_id != 0u32 {
::buffa::types::put_uint32_field(1u32, self.zipped_asset_id, buf);
}
if self.chain_id != 0u32 {
::buffa::types::put_uint32_field(2u32, self.chain_id, buf);
}
if self.is_native_asset {
::buffa::types::put_bool_field(3u32, self.is_native_asset, buf);
}
if !self.network_fee.is_empty() {
::buffa::types::put_string_field(4u32, &self.network_fee, buf);
}
if !self.ztoken_address.is_empty() {
::buffa::types::put_string_field(6u32, &self.ztoken_address, buf);
}
if !self.source_address.is_empty() {
::buffa::types::put_string_field(7u32, &self.source_address, buf);
}
if self.source_decimals != 0u32 {
::buffa::types::put_uint32_field(8u32, self.source_decimals, buf);
}
if self.ztoken_decimals != 0u32 {
::buffa::types::put_uint32_field(9u32, self.ztoken_decimals, buf);
}
if !self.deposit_min_amount.is_empty() {
::buffa::types::put_string_field(
10u32,
&self.deposit_min_amount,
buf,
);
}
if !self.withdraw_min_amount.is_empty() {
::buffa::types::put_string_field(
11u32,
&self.withdraw_min_amount,
buf,
);
}
if self.supply_q != 0u64 {
::buffa::types::put_uint64_field(12u32, self.supply_q, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for AssetChainVariantView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.zipped_asset_id) {
__map
.serialize_entry(
"zippedAssetId",
&::buffa::json_helpers::ProtoJson(&self.zipped_asset_id),
)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.chain_id) {
__map
.serialize_entry(
"chainId",
&::buffa::json_helpers::ProtoJson(&self.chain_id),
)?;
}
if self.is_native_asset {
__map.serialize_entry("isNativeAsset", &self.is_native_asset)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.network_fee) {
__map.serialize_entry("networkFee", self.network_fee)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.ztoken_address) {
__map.serialize_entry("ztokenAddress", self.ztoken_address)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.source_address) {
__map.serialize_entry("sourceAddress", self.source_address)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.source_decimals) {
__map
.serialize_entry(
"sourceDecimals",
&::buffa::json_helpers::ProtoJson(&self.source_decimals),
)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.ztoken_decimals) {
__map
.serialize_entry(
"ztokenDecimals",
&::buffa::json_helpers::ProtoJson(&self.ztoken_decimals),
)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(
self.deposit_min_amount,
) {
__map.serialize_entry("depositMinAmount", self.deposit_min_amount)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(
self.withdraw_min_amount,
) {
__map
.serialize_entry("withdrawMinAmount", self.withdraw_min_amount)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.supply_q) {
__map
.serialize_entry(
"supplyQ",
&::buffa::json_helpers::ProtoJson(&self.supply_q),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for AssetChainVariantView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "AssetChainVariant";
const FULL_NAME: &'static str = "chain.zipper.v1.AssetChainVariant";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetChainVariant";
}
::buffa::impl_default_view_instance!(AssetChainVariantView);
::buffa::impl_view_reborrow!(AssetChainVariantView);
#[derive(Clone, Debug)]
pub struct AssetChainVariantOwnedView(
::buffa::OwnedView<AssetChainVariantView<'static>>,
);
impl AssetChainVariantOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
AssetChainVariantOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
AssetChainVariantOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::AssetChainVariant,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
AssetChainVariantOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &AssetChainVariantView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::AssetChainVariant,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn zipped_asset_id(&self) -> u32 {
self.0.reborrow().zipped_asset_id
}
#[must_use]
pub fn chain_id(&self) -> u32 {
self.0.reborrow().chain_id
}
#[must_use]
pub fn is_native_asset(&self) -> bool {
self.0.reborrow().is_native_asset
}
#[must_use]
pub fn network_fee(&self) -> &'_ str {
self.0.reborrow().network_fee
}
#[must_use]
pub fn ztoken_address(&self) -> &'_ str {
self.0.reborrow().ztoken_address
}
#[must_use]
pub fn source_address(&self) -> &'_ str {
self.0.reborrow().source_address
}
#[must_use]
pub fn source_decimals(&self) -> u32 {
self.0.reborrow().source_decimals
}
#[must_use]
pub fn ztoken_decimals(&self) -> u32 {
self.0.reborrow().ztoken_decimals
}
#[must_use]
pub fn deposit_min_amount(&self) -> &'_ str {
self.0.reborrow().deposit_min_amount
}
#[must_use]
pub fn withdraw_min_amount(&self) -> &'_ str {
self.0.reborrow().withdraw_min_amount
}
#[must_use]
pub fn supply_q(&self) -> u64 {
self.0.reborrow().supply_q
}
}
impl ::core::convert::From<::buffa::OwnedView<AssetChainVariantView<'static>>>
for AssetChainVariantOwnedView {
fn from(inner: ::buffa::OwnedView<AssetChainVariantView<'static>>) -> Self {
AssetChainVariantOwnedView(inner)
}
}
impl ::core::convert::From<AssetChainVariantOwnedView>
for ::buffa::OwnedView<AssetChainVariantView<'static>> {
fn from(wrapper: AssetChainVariantOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<AssetChainVariantView<'static>>>
for AssetChainVariantOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<AssetChainVariantView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::AssetChainVariant {
type View<'a> = AssetChainVariantView<'a>;
type ViewHandle = AssetChainVariantOwnedView;
}
impl ::serde::Serialize for AssetChainVariantOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ZippedAssetSupplyUpdateView<'a> {
pub zipped_asset_id: u32,
pub supply_q: u64,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ZippedAssetSupplyUpdateView<'a> {
type Owned = super::super::ZippedAssetSupplyUpdate;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.zipped_asset_id = ::buffa::types::decode_uint32(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.supply_q = ::buffa::types::decode_uint64(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ZippedAssetSupplyUpdate,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ZippedAssetSupplyUpdate,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ZippedAssetSupplyUpdate {
zipped_asset_id: self.zipped_asset_id,
supply_q: self.supply_q,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ZippedAssetSupplyUpdateView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.zipped_asset_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.zipped_asset_id)
as u32;
}
if self.supply_q != 0u64 {
size
+= 1u32
+ ::buffa::types::uint64_encoded_len(self.supply_q) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.zipped_asset_id != 0u32 {
::buffa::types::put_uint32_field(1u32, self.zipped_asset_id, buf);
}
if self.supply_q != 0u64 {
::buffa::types::put_uint64_field(2u32, self.supply_q, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ZippedAssetSupplyUpdateView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.zipped_asset_id) {
__map
.serialize_entry(
"zippedAssetId",
&::buffa::json_helpers::ProtoJson(&self.zipped_asset_id),
)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.supply_q) {
__map
.serialize_entry(
"supplyQ",
&::buffa::json_helpers::ProtoJson(&self.supply_q),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ZippedAssetSupplyUpdateView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ZippedAssetSupplyUpdate";
const FULL_NAME: &'static str = "chain.zipper.v1.ZippedAssetSupplyUpdate";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyUpdate";
}
::buffa::impl_default_view_instance!(ZippedAssetSupplyUpdateView);
::buffa::impl_view_reborrow!(ZippedAssetSupplyUpdateView);
#[derive(Clone, Debug)]
pub struct ZippedAssetSupplyUpdateOwnedView(
::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>>,
);
impl ZippedAssetSupplyUpdateOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZippedAssetSupplyUpdateOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZippedAssetSupplyUpdateOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ZippedAssetSupplyUpdate,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZippedAssetSupplyUpdateOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &ZippedAssetSupplyUpdateView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ZippedAssetSupplyUpdate,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn zipped_asset_id(&self) -> u32 {
self.0.reborrow().zipped_asset_id
}
#[must_use]
pub fn supply_q(&self) -> u64 {
self.0.reborrow().supply_q
}
}
impl ::core::convert::From<
::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>>,
> for ZippedAssetSupplyUpdateOwnedView {
fn from(
inner: ::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>>,
) -> Self {
ZippedAssetSupplyUpdateOwnedView(inner)
}
}
impl ::core::convert::From<ZippedAssetSupplyUpdateOwnedView>
for ::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>> {
fn from(wrapper: ZippedAssetSupplyUpdateOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>>,
> for ZippedAssetSupplyUpdateOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<ZippedAssetSupplyUpdateView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ZippedAssetSupplyUpdate {
type View<'a> = ZippedAssetSupplyUpdateView<'a>;
type ViewHandle = ZippedAssetSupplyUpdateOwnedView;
}
impl ::serde::Serialize for ZippedAssetSupplyUpdateOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ZippedAssetSupplyBatchView<'a> {
pub updates: ::buffa::RepeatedView<
'a,
super::super::__buffa::view::ZippedAssetSupplyUpdateView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ZippedAssetSupplyBatchView<'a> {
type Owned = super::super::ZippedAssetSupplyBatch;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
view.updates
.push(
<super::super::__buffa::view::ZippedAssetSupplyUpdateView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ZippedAssetSupplyBatch,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ZippedAssetSupplyBatch,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ZippedAssetSupplyBatch {
updates: self
.updates
.iter()
.map(|v| v.to_owned_from_source(__buffa_src))
.collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ZippedAssetSupplyBatchView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.updates {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.updates {
::buffa::types::put_len_delimited_header(
1u32,
__cache.consume_next(),
buf,
);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ZippedAssetSupplyBatchView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !self.updates.is_empty() {
__map.serialize_entry("updates", &*self.updates)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ZippedAssetSupplyBatchView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ZippedAssetSupplyBatch";
const FULL_NAME: &'static str = "chain.zipper.v1.ZippedAssetSupplyBatch";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ZippedAssetSupplyBatch";
}
::buffa::impl_default_view_instance!(ZippedAssetSupplyBatchView);
::buffa::impl_view_reborrow!(ZippedAssetSupplyBatchView);
#[derive(Clone, Debug)]
pub struct ZippedAssetSupplyBatchOwnedView(
::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>>,
);
impl ZippedAssetSupplyBatchOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZippedAssetSupplyBatchOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZippedAssetSupplyBatchOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ZippedAssetSupplyBatch,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ZippedAssetSupplyBatchOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &ZippedAssetSupplyBatchView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ZippedAssetSupplyBatch,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn updates(
&self,
) -> &::buffa::RepeatedView<
'_,
super::super::__buffa::view::ZippedAssetSupplyUpdateView<'_>,
> {
&self.0.reborrow().updates
}
}
impl ::core::convert::From<
::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>>,
> for ZippedAssetSupplyBatchOwnedView {
fn from(
inner: ::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>>,
) -> Self {
ZippedAssetSupplyBatchOwnedView(inner)
}
}
impl ::core::convert::From<ZippedAssetSupplyBatchOwnedView>
for ::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>> {
fn from(wrapper: ZippedAssetSupplyBatchOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>>,
> for ZippedAssetSupplyBatchOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<ZippedAssetSupplyBatchView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ZippedAssetSupplyBatch {
type View<'a> = ZippedAssetSupplyBatchView<'a>;
type ViewHandle = ZippedAssetSupplyBatchOwnedView;
}
impl ::serde::Serialize for ZippedAssetSupplyBatchOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct AssetConfigView<'a> {
pub asset: &'a str,
pub ledger_id: u32,
pub name: &'a str,
pub icon: &'a str,
pub quantity_scale: u32,
pub quantity_display_decimals: u32,
pub variants: ::buffa::RepeatedView<
'a,
super::super::__buffa::view::AssetChainVariantView<'a>,
>,
pub u_asset_id: &'a str,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for AssetConfigView<'a> {
type Owned = super::super::AssetConfig;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.asset = ::buffa::types::borrow_str(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.ledger_id = ::buffa::types::decode_uint32(&mut cur)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.name = ::buffa::types::borrow_str(&mut cur)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.icon = ::buffa::types::borrow_str(&mut cur)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.quantity_scale = ::buffa::types::decode_uint32(&mut cur)?;
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.quantity_display_decimals = ::buffa::types::decode_uint32(
&mut cur,
)?;
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.u_asset_id = ::buffa::types::borrow_str(&mut cur)?;
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
view.variants
.push(
<super::super::__buffa::view::AssetChainVariantView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::AssetConfig,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::AssetConfig,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::AssetConfig {
asset: self.asset.to_string(),
ledger_id: self.ledger_id,
name: self.name.to_string(),
icon: self.icon.to_string(),
quantity_scale: self.quantity_scale,
quantity_display_decimals: self.quantity_display_decimals,
variants: self
.variants
.iter()
.map(|v| v.to_owned_from_source(__buffa_src))
.collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
u_asset_id: self.u_asset_id.to_string(),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for AssetConfigView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.asset.is_empty() {
size
+= 1u32 + ::buffa::types::string_encoded_len(&self.asset) as u32;
}
if self.ledger_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.ledger_id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.icon.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.icon) as u32;
}
if self.quantity_scale != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.quantity_scale)
as u32;
}
if self.quantity_display_decimals != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(
self.quantity_display_decimals,
) as u32;
}
for v in &self.variants {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.u_asset_id.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.u_asset_id)
as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.asset.is_empty() {
::buffa::types::put_string_field(1u32, &self.asset, buf);
}
if self.ledger_id != 0u32 {
::buffa::types::put_uint32_field(2u32, self.ledger_id, buf);
}
if !self.name.is_empty() {
::buffa::types::put_string_field(3u32, &self.name, buf);
}
if !self.icon.is_empty() {
::buffa::types::put_string_field(4u32, &self.icon, buf);
}
if self.quantity_scale != 0u32 {
::buffa::types::put_uint32_field(5u32, self.quantity_scale, buf);
}
if self.quantity_display_decimals != 0u32 {
::buffa::types::put_uint32_field(
6u32,
self.quantity_display_decimals,
buf,
);
}
for v in &self.variants {
::buffa::types::put_len_delimited_header(
7u32,
__cache.consume_next(),
buf,
);
v.write_to(__cache, buf);
}
if !self.u_asset_id.is_empty() {
::buffa::types::put_string_field(8u32, &self.u_asset_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for AssetConfigView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.asset) {
__map.serialize_entry("asset", self.asset)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.ledger_id) {
__map
.serialize_entry(
"ledgerId",
&::buffa::json_helpers::ProtoJson(&self.ledger_id),
)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
__map.serialize_entry("name", self.name)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.icon) {
__map.serialize_entry("icon", self.icon)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.quantity_scale) {
__map
.serialize_entry(
"quantityScale",
&::buffa::json_helpers::ProtoJson(&self.quantity_scale),
)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(
&self.quantity_display_decimals,
) {
__map
.serialize_entry(
"quantityDisplayDecimals",
&::buffa::json_helpers::ProtoJson(
&self.quantity_display_decimals,
),
)?;
}
if !self.variants.is_empty() {
__map.serialize_entry("variants", &*self.variants)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.u_asset_id) {
__map.serialize_entry("uAssetId", self.u_asset_id)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for AssetConfigView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "AssetConfig";
const FULL_NAME: &'static str = "chain.zipper.v1.AssetConfig";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.AssetConfig";
}
::buffa::impl_default_view_instance!(AssetConfigView);
::buffa::impl_view_reborrow!(AssetConfigView);
#[derive(Clone, Debug)]
pub struct AssetConfigOwnedView(::buffa::OwnedView<AssetConfigView<'static>>);
impl AssetConfigOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
AssetConfigOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
AssetConfigOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::AssetConfig,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
AssetConfigOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &AssetConfigView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::AssetConfig,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn asset(&self) -> &'_ str {
self.0.reborrow().asset
}
#[must_use]
pub fn ledger_id(&self) -> u32 {
self.0.reborrow().ledger_id
}
#[must_use]
pub fn name(&self) -> &'_ str {
self.0.reborrow().name
}
#[must_use]
pub fn icon(&self) -> &'_ str {
self.0.reborrow().icon
}
#[must_use]
pub fn quantity_scale(&self) -> u32 {
self.0.reborrow().quantity_scale
}
#[must_use]
pub fn quantity_display_decimals(&self) -> u32 {
self.0.reborrow().quantity_display_decimals
}
#[must_use]
pub fn variants(
&self,
) -> &::buffa::RepeatedView<
'_,
super::super::__buffa::view::AssetChainVariantView<'_>,
> {
&self.0.reborrow().variants
}
#[must_use]
pub fn u_asset_id(&self) -> &'_ str {
self.0.reborrow().u_asset_id
}
}
impl ::core::convert::From<::buffa::OwnedView<AssetConfigView<'static>>>
for AssetConfigOwnedView {
fn from(inner: ::buffa::OwnedView<AssetConfigView<'static>>) -> Self {
AssetConfigOwnedView(inner)
}
}
impl ::core::convert::From<AssetConfigOwnedView>
for ::buffa::OwnedView<AssetConfigView<'static>> {
fn from(wrapper: AssetConfigOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<AssetConfigView<'static>>>
for AssetConfigOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<AssetConfigView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::AssetConfig {
type View<'a> = AssetConfigView<'a>;
type ViewHandle = AssetConfigOwnedView;
}
impl ::serde::Serialize for AssetConfigOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ChainContractConfigView<'a> {
pub name: &'a str,
pub address: &'a str,
pub r#type: &'a str,
pub description: &'a str,
pub version: u32,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ChainContractConfigView<'a> {
type Owned = super::super::ChainContractConfig;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.name = ::buffa::types::borrow_str(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.address = ::buffa::types::borrow_str(&mut cur)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.r#type = ::buffa::types::borrow_str(&mut cur)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.description = ::buffa::types::borrow_str(&mut cur)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.version = ::buffa::types::decode_uint32(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ChainContractConfig,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ChainContractConfig,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ChainContractConfig {
name: self.name.to_string(),
address: self.address.to_string(),
r#type: self.r#type.to_string(),
description: self.description.to_string(),
version: self.version,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ChainContractConfigView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.address) as u32;
}
if !self.r#type.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.r#type) as u32;
}
if !self.description.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.description)
as u32;
}
if self.version != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.version) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::types::put_string_field(1u32, &self.name, buf);
}
if !self.address.is_empty() {
::buffa::types::put_string_field(2u32, &self.address, buf);
}
if !self.r#type.is_empty() {
::buffa::types::put_string_field(3u32, &self.r#type, buf);
}
if !self.description.is_empty() {
::buffa::types::put_string_field(4u32, &self.description, buf);
}
if self.version != 0u32 {
::buffa::types::put_uint32_field(5u32, self.version, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ChainContractConfigView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
__map.serialize_entry("name", self.name)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.address) {
__map.serialize_entry("address", self.address)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.r#type) {
__map.serialize_entry("type", self.r#type)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.description) {
__map.serialize_entry("description", self.description)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(&self.version) {
__map
.serialize_entry(
"version",
&::buffa::json_helpers::ProtoJson(&self.version),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ChainContractConfigView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "ChainContractConfig";
const FULL_NAME: &'static str = "chain.zipper.v1.ChainContractConfig";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.ChainContractConfig";
}
::buffa::impl_default_view_instance!(ChainContractConfigView);
::buffa::impl_view_reborrow!(ChainContractConfigView);
#[derive(Clone, Debug)]
pub struct ChainContractConfigOwnedView(
::buffa::OwnedView<ChainContractConfigView<'static>>,
);
impl ChainContractConfigOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ChainContractConfigOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ChainContractConfigOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ChainContractConfig,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ChainContractConfigOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &ChainContractConfigView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ChainContractConfig,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn name(&self) -> &'_ str {
self.0.reborrow().name
}
#[must_use]
pub fn address(&self) -> &'_ str {
self.0.reborrow().address
}
#[must_use]
pub fn r#type(&self) -> &'_ str {
self.0.reborrow().r#type
}
#[must_use]
pub fn description(&self) -> &'_ str {
self.0.reborrow().description
}
#[must_use]
pub fn version(&self) -> u32 {
self.0.reborrow().version
}
}
impl ::core::convert::From<::buffa::OwnedView<ChainContractConfigView<'static>>>
for ChainContractConfigOwnedView {
fn from(
inner: ::buffa::OwnedView<ChainContractConfigView<'static>>,
) -> Self {
ChainContractConfigOwnedView(inner)
}
}
impl ::core::convert::From<ChainContractConfigOwnedView>
for ::buffa::OwnedView<ChainContractConfigView<'static>> {
fn from(wrapper: ChainContractConfigOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<ChainContractConfigView<'static>>>
for ChainContractConfigOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<ChainContractConfigView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ChainContractConfig {
type View<'a> = ChainContractConfigView<'a>;
type ViewHandle = ChainContractConfigOwnedView;
}
impl ::serde::Serialize for ChainContractConfigOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct GetDepositWithdrawConfigRequestView<'a> {
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for GetDepositWithdrawConfigRequestView<'a> {
type Owned = super::super::GetDepositWithdrawConfigRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GetDepositWithdrawConfigRequest,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::GetDepositWithdrawConfigRequest,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::GetDepositWithdrawConfigRequest {
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for GetDepositWithdrawConfigRequestView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for GetDepositWithdrawConfigRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
__map.end()
}
}
impl<'a> ::buffa::MessageName for GetDepositWithdrawConfigRequestView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "GetDepositWithdrawConfigRequest";
const FULL_NAME: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigRequest";
}
::buffa::impl_default_view_instance!(GetDepositWithdrawConfigRequestView);
::buffa::impl_view_reborrow!(GetDepositWithdrawConfigRequestView);
#[derive(Clone, Debug)]
pub struct GetDepositWithdrawConfigRequestOwnedView(
::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>>,
);
impl GetDepositWithdrawConfigRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetDepositWithdrawConfigRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetDepositWithdrawConfigRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::GetDepositWithdrawConfigRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetDepositWithdrawConfigRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &GetDepositWithdrawConfigRequestView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GetDepositWithdrawConfigRequest,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
}
impl ::core::convert::From<
::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>>,
> for GetDepositWithdrawConfigRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>>,
) -> Self {
GetDepositWithdrawConfigRequestOwnedView(inner)
}
}
impl ::core::convert::From<GetDepositWithdrawConfigRequestOwnedView>
for ::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>> {
fn from(wrapper: GetDepositWithdrawConfigRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>>,
> for GetDepositWithdrawConfigRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<GetDepositWithdrawConfigRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::GetDepositWithdrawConfigRequest {
type View<'a> = GetDepositWithdrawConfigRequestView<'a>;
type ViewHandle = GetDepositWithdrawConfigRequestOwnedView;
}
impl ::serde::Serialize for GetDepositWithdrawConfigRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct GetDepositWithdrawConfigResponseView<'a> {
pub chains: ::buffa::RepeatedView<
'a,
super::super::__buffa::view::ChainConfigView<'a>,
>,
pub assets: ::buffa::RepeatedView<
'a,
super::super::__buffa::view::AssetConfigView<'a>,
>,
pub ts_sec: u64,
pub polyester_chain_id: u32,
pub contracts: ::buffa::RepeatedView<
'a,
super::super::__buffa::view::ChainContractConfigView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for GetDepositWithdrawConfigResponseView<'a> {
type Owned = super::super::GetDepositWithdrawConfigResponse;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.ts_sec = ::buffa::types::decode_uint64(&mut cur)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.polyester_chain_id = ::buffa::types::decode_uint32(
&mut cur,
)?;
}
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
view.chains
.push(
<super::super::__buffa::view::ChainConfigView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
view.assets
.push(
<super::super::__buffa::view::AssetConfigView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
view.contracts
.push(
<super::super::__buffa::view::ChainContractConfigView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GetDepositWithdrawConfigResponse,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::GetDepositWithdrawConfigResponse,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::GetDepositWithdrawConfigResponse {
chains: self
.chains
.iter()
.map(|v| v.to_owned_from_source(__buffa_src))
.collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
assets: self
.assets
.iter()
.map(|v| v.to_owned_from_source(__buffa_src))
.collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
ts_sec: self.ts_sec,
polyester_chain_id: self.polyester_chain_id,
contracts: self
.contracts
.iter()
.map(|v| v.to_owned_from_source(__buffa_src))
.collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for GetDepositWithdrawConfigResponseView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.chains {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.assets {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.ts_sec != 0u64 {
size
+= 1u32 + ::buffa::types::uint64_encoded_len(self.ts_sec) as u32;
}
if self.polyester_chain_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.polyester_chain_id)
as u32;
}
for v in &self.contracts {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.chains {
::buffa::types::put_len_delimited_header(
1u32,
__cache.consume_next(),
buf,
);
v.write_to(__cache, buf);
}
for v in &self.assets {
::buffa::types::put_len_delimited_header(
2u32,
__cache.consume_next(),
buf,
);
v.write_to(__cache, buf);
}
if self.ts_sec != 0u64 {
::buffa::types::put_uint64_field(3u32, self.ts_sec, buf);
}
if self.polyester_chain_id != 0u32 {
::buffa::types::put_uint32_field(4u32, self.polyester_chain_id, buf);
}
for v in &self.contracts {
::buffa::types::put_len_delimited_header(
5u32,
__cache.consume_next(),
buf,
);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for GetDepositWithdrawConfigResponseView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !self.chains.is_empty() {
__map.serialize_entry("chains", &*self.chains)?;
}
if !self.assets.is_empty() {
__map.serialize_entry("assets", &*self.assets)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.ts_sec) {
__map
.serialize_entry(
"tsSec",
&::buffa::json_helpers::ProtoJson(&self.ts_sec),
)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u32(
&self.polyester_chain_id,
) {
__map
.serialize_entry(
"polyesterChainId",
&::buffa::json_helpers::ProtoJson(&self.polyester_chain_id),
)?;
}
if !self.contracts.is_empty() {
__map.serialize_entry("contracts", &*self.contracts)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for GetDepositWithdrawConfigResponseView<'a> {
const PACKAGE: &'static str = "chain.zipper.v1";
const NAME: &'static str = "GetDepositWithdrawConfigResponse";
const FULL_NAME: &'static str = "chain.zipper.v1.GetDepositWithdrawConfigResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.zipper.v1.GetDepositWithdrawConfigResponse";
}
::buffa::impl_default_view_instance!(GetDepositWithdrawConfigResponseView);
::buffa::impl_view_reborrow!(GetDepositWithdrawConfigResponseView);
#[derive(Clone, Debug)]
pub struct GetDepositWithdrawConfigResponseOwnedView(
::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>>,
);
impl GetDepositWithdrawConfigResponseOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetDepositWithdrawConfigResponseOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetDepositWithdrawConfigResponseOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::GetDepositWithdrawConfigResponse,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetDepositWithdrawConfigResponseOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &GetDepositWithdrawConfigResponseView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GetDepositWithdrawConfigResponse,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn chains(
&self,
) -> &::buffa::RepeatedView<
'_,
super::super::__buffa::view::ChainConfigView<'_>,
> {
&self.0.reborrow().chains
}
#[must_use]
pub fn assets(
&self,
) -> &::buffa::RepeatedView<
'_,
super::super::__buffa::view::AssetConfigView<'_>,
> {
&self.0.reborrow().assets
}
#[must_use]
pub fn ts_sec(&self) -> u64 {
self.0.reborrow().ts_sec
}
#[must_use]
pub fn polyester_chain_id(&self) -> u32 {
self.0.reborrow().polyester_chain_id
}
#[must_use]
pub fn contracts(
&self,
) -> &::buffa::RepeatedView<
'_,
super::super::__buffa::view::ChainContractConfigView<'_>,
> {
&self.0.reborrow().contracts
}
}
impl ::core::convert::From<
::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>>,
> for GetDepositWithdrawConfigResponseOwnedView {
fn from(
inner: ::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>>,
) -> Self {
GetDepositWithdrawConfigResponseOwnedView(inner)
}
}
impl ::core::convert::From<GetDepositWithdrawConfigResponseOwnedView>
for ::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>> {
fn from(wrapper: GetDepositWithdrawConfigResponseOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>>,
> for GetDepositWithdrawConfigResponseOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<GetDepositWithdrawConfigResponseView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::GetDepositWithdrawConfigResponse {
type View<'a> = GetDepositWithdrawConfigResponseView<'a>;
type ViewHandle = GetDepositWithdrawConfigResponseOwnedView;
}
impl ::serde::Serialize for GetDepositWithdrawConfigResponseOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
}
pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
reg.register_json_any(super::__ZIPPER_REASON_DETAILS_JSON_ANY);
reg.register_json_any(super::__CHAIN_CONFIG_JSON_ANY);
reg.register_json_any(super::__ASSET_CHAIN_VARIANT_JSON_ANY);
reg.register_json_any(super::__ZIPPED_ASSET_SUPPLY_UPDATE_JSON_ANY);
reg.register_json_any(super::__ZIPPED_ASSET_SUPPLY_BATCH_JSON_ANY);
reg.register_json_any(super::__ASSET_CONFIG_JSON_ANY);
reg.register_json_any(super::__CHAIN_CONTRACT_CONFIG_JSON_ANY);
reg.register_json_any(super::__GET_DEPOSIT_WITHDRAW_CONFIG_REQUEST_JSON_ANY);
reg.register_json_any(super::__GET_DEPOSIT_WITHDRAW_CONFIG_RESPONSE_JSON_ANY);
}
}
#[doc(inline)]
pub use self::__buffa::view::ZipperReasonDetailsView;
#[doc(inline)]
pub use self::__buffa::view::ZipperReasonDetailsOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ChainConfigView;
#[doc(inline)]
pub use self::__buffa::view::ChainConfigOwnedView;
#[doc(inline)]
pub use self::__buffa::view::AssetChainVariantView;
#[doc(inline)]
pub use self::__buffa::view::AssetChainVariantOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ZippedAssetSupplyUpdateView;
#[doc(inline)]
pub use self::__buffa::view::ZippedAssetSupplyUpdateOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ZippedAssetSupplyBatchView;
#[doc(inline)]
pub use self::__buffa::view::ZippedAssetSupplyBatchOwnedView;
#[doc(inline)]
pub use self::__buffa::view::AssetConfigView;
#[doc(inline)]
pub use self::__buffa::view::AssetConfigOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ChainContractConfigView;
#[doc(inline)]
pub use self::__buffa::view::ChainContractConfigOwnedView;
#[doc(inline)]
pub use self::__buffa::view::GetDepositWithdrawConfigRequestView;
#[doc(inline)]
pub use self::__buffa::view::GetDepositWithdrawConfigRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::GetDepositWithdrawConfigResponseView;
#[doc(inline)]
pub use self::__buffa::view::GetDepositWithdrawConfigResponseOwnedView;
#[doc(inline)]
pub use self::__buffa::register_types;