//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/codama-idl/codama>
//!

// #[cfg(feature = "proto")]
pub mod proto_types_parsers {
    use yellowstone_vixen_core::proto_helper_traits;
    proto_helper_traits!();
    use crate::proto_def;

    use crate::types::WithdrawDestToken;
    impl IntoProto<proto_def::WithdrawDestToken> for WithdrawDestToken {
        fn into_proto(self) -> proto_def::WithdrawDestToken {
            proto_def::WithdrawDestToken {
                withdraw_amount: self.withdraw_amount,
                coin_amount: self.coin_amount,
                pc_amount: self.pc_amount,
                dest_token_coin: self.dest_token_coin.to_string(),
                dest_token_pc: self.dest_token_pc.to_string(),
            }
        }
    }
    use crate::types::WithdrawQueue;
    impl IntoProto<proto_def::WithdrawQueue> for WithdrawQueue {
        fn into_proto(self) -> proto_def::WithdrawQueue {
            proto_def::WithdrawQueue {
                owner: self.owner.to_vec(),
                head: self.head,
                count: self.count,
                buf: self.buf.into_iter().map(|x| x.into_proto()).collect(),
            }
        }
    }
    use crate::types::TargetOrder;
    impl IntoProto<proto_def::TargetOrder> for TargetOrder {
        fn into_proto(self) -> proto_def::TargetOrder {
            proto_def::TargetOrder {
                price: self.price,
                vol: self.vol,
            }
        }
    }
    use crate::types::OutPutData;
    impl IntoProto<proto_def::OutPutData> for OutPutData {
        fn into_proto(self) -> proto_def::OutPutData {
            proto_def::OutPutData {
                need_take_pnl_coin: self.need_take_pnl_coin,
                need_take_pnl_pc: self.need_take_pnl_pc,
                total_pnl_pc: self.total_pnl_pc,
                total_pnl_coin: self.total_pnl_coin,
                pool_open_time: self.pool_open_time,
                punish_pc_amount: self.punish_pc_amount,
                punish_coin_amount: self.punish_coin_amount,
                orderbook_to_init_time: self.orderbook_to_init_time,
                swap_coin_in_amount: self.swap_coin_in_amount.to_string(),
                swap_pc_out_amount: self.swap_pc_out_amount.to_string(),
                swap_take_pc_fee: self.swap_take_pc_fee,
                swap_pc_in_amount: self.swap_pc_in_amount.to_string(),
                swap_coin_out_amount: self.swap_coin_out_amount.to_string(),
                swap_take_coin_fee: self.swap_take_coin_fee,
            }
        }
    }
    use crate::types::LastOrderDistance;
    impl IntoProto<proto_def::LastOrderDistance> for LastOrderDistance {
        fn into_proto(self) -> proto_def::LastOrderDistance {
            proto_def::LastOrderDistance {
                last_order_numerator: self.last_order_numerator,
                last_order_denominator: self.last_order_denominator,
            }
        }
    }
    use crate::types::NeedTake;
    impl IntoProto<proto_def::NeedTake> for NeedTake {
        fn into_proto(self) -> proto_def::NeedTake {
            proto_def::NeedTake {
                need_take_pc: self.need_take_pc,
                need_take_coin: self.need_take_coin,
            }
        }
    }
    use crate::types::SwapInstructionBaseIn;
    impl IntoProto<proto_def::SwapInstructionBaseIn> for SwapInstructionBaseIn {
        fn into_proto(self) -> proto_def::SwapInstructionBaseIn {
            proto_def::SwapInstructionBaseIn {
                amount_in: self.amount_in,
                minimum_amount_out: self.minimum_amount_out,
            }
        }
    }
    use crate::types::SwapInstructionBaseOut;
    impl IntoProto<proto_def::SwapInstructionBaseOut> for SwapInstructionBaseOut {
        fn into_proto(self) -> proto_def::SwapInstructionBaseOut {
            proto_def::SwapInstructionBaseOut {
                max_amount_in: self.max_amount_in,
                amount_out: self.amount_out,
            }
        }
    }
    use crate::types::Fees;
    impl IntoProto<proto_def::Fees> for Fees {
        fn into_proto(self) -> proto_def::Fees {
            proto_def::Fees {
                min_separate_numerator: self.min_separate_numerator,
                min_separate_denominator: self.min_separate_denominator,
                trade_fee_numerator: self.trade_fee_numerator,
                trade_fee_denominator: self.trade_fee_denominator,
                pnl_numerator: self.pnl_numerator,
                pnl_denominator: self.pnl_denominator,
                swap_fee_numerator: self.swap_fee_numerator,
                swap_fee_denominator: self.swap_fee_denominator,
            }
        }
    }
}
