1pub use i_orion_pool_v2_router_02_ext::*;
2#[allow(
3 clippy::too_many_arguments,
4 non_camel_case_types,
5 clippy::upper_case_acronyms
6)]
7pub mod i_orion_pool_v2_router_02_ext {
8 #![allow(clippy::enum_variant_names)]
9 #![allow(dead_code)]
10 #![allow(clippy::type_complexity)]
11 #![allow(unused_imports)]
12 use ::ethers::contract::{
14 builders::{ContractCall, Event},
15 Contract, Lazy,
16 };
17 use ::ethers::core::{
18 abi::{Abi, Detokenize, InvalidOutputType, Token, Tokenizable},
19 types::*,
20 };
21 use ::ethers::providers::Middleware;
22 use std::sync::Arc;
23 #[rustfmt::skip]
24 const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amountOutMin\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"payable\",\"type\":\"function\",\"name\":\"swapExactTokensForTokensAutoRoute\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amountInMax\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"address[]\",\"name\":\"path\",\"type\":\"address[]\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"payable\",\"type\":\"function\",\"name\":\"swapTokensForExactTokensAutoRoute\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\",\"components\":[]}]}]";
25 pub static IORIONPOOLV2ROUTER02EXT_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
27 ::ethers::contract::Lazy::new(|| {
28 ::ethers::core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid")
29 });
30 pub struct IOrionPoolV2Router02Ext<M>(::ethers::contract::Contract<M>);
31 impl<M> Clone for IOrionPoolV2Router02Ext<M> {
32 fn clone(&self) -> Self {
33 IOrionPoolV2Router02Ext(self.0.clone())
34 }
35 }
36 impl<M> std::ops::Deref for IOrionPoolV2Router02Ext<M> {
37 type Target = ::ethers::contract::Contract<M>;
38 fn deref(&self) -> &Self::Target {
39 &self.0
40 }
41 }
42 impl<M> std::fmt::Debug for IOrionPoolV2Router02Ext<M> {
43 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
44 f.debug_tuple(stringify!(IOrionPoolV2Router02Ext))
45 .field(&self.address())
46 .finish()
47 }
48 }
49 impl<M: ::ethers::providers::Middleware> IOrionPoolV2Router02Ext<M> {
50 pub fn new<T: Into<::ethers::core::types::Address>>(
54 address: T,
55 client: ::std::sync::Arc<M>,
56 ) -> Self {
57 Self(::ethers::contract::Contract::new(
58 address.into(),
59 IORIONPOOLV2ROUTER02EXT_ABI.clone(),
60 client,
61 ))
62 }
63 pub fn swap_exact_tokens_for_tokens_auto_route(
65 &self,
66 amount_in: ::ethers::core::types::U256,
67 amount_out_min: ::ethers::core::types::U256,
68 path: ::std::vec::Vec<::ethers::core::types::Address>,
69 to: ::ethers::core::types::Address,
70 ) -> ::ethers::contract::builders::ContractCall<
71 M,
72 ::std::vec::Vec<::ethers::core::types::U256>,
73 > {
74 self.0
75 .method_hash([93, 168, 152, 19], (amount_in, amount_out_min, path, to))
76 .expect("method not found (this should never happen)")
77 }
78 pub fn swap_tokens_for_exact_tokens_auto_route(
80 &self,
81 amount_out: ::ethers::core::types::U256,
82 amount_in_max: ::ethers::core::types::U256,
83 path: ::std::vec::Vec<::ethers::core::types::Address>,
84 to: ::ethers::core::types::Address,
85 ) -> ::ethers::contract::builders::ContractCall<
86 M,
87 ::std::vec::Vec<::ethers::core::types::U256>,
88 > {
89 self.0
90 .method_hash([187, 162, 45, 14], (amount_out, amount_in_max, path, to))
91 .expect("method not found (this should never happen)")
92 }
93 }
94 impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
95 for IOrionPoolV2Router02Ext<M>
96 {
97 fn from(contract: ::ethers::contract::Contract<M>) -> Self {
98 Self::new(contract.address(), contract.client())
99 }
100 }
101 #[derive(
103 Clone,
104 Debug,
105 Eq,
106 PartialEq,
107 ::ethers::contract::EthCall,
108 ::ethers::contract::EthDisplay,
109 Default,
110 )]
111 #[ethcall(
112 name = "swapExactTokensForTokensAutoRoute",
113 abi = "swapExactTokensForTokensAutoRoute(uint256,uint256,address[],address)"
114 )]
115 pub struct SwapExactTokensForTokensAutoRouteCall {
116 pub amount_in: ::ethers::core::types::U256,
117 pub amount_out_min: ::ethers::core::types::U256,
118 pub path: ::std::vec::Vec<::ethers::core::types::Address>,
119 pub to: ::ethers::core::types::Address,
120 }
121 #[derive(
123 Clone,
124 Debug,
125 Eq,
126 PartialEq,
127 ::ethers::contract::EthCall,
128 ::ethers::contract::EthDisplay,
129 Default,
130 )]
131 #[ethcall(
132 name = "swapTokensForExactTokensAutoRoute",
133 abi = "swapTokensForExactTokensAutoRoute(uint256,uint256,address[],address)"
134 )]
135 pub struct SwapTokensForExactTokensAutoRouteCall {
136 pub amount_out: ::ethers::core::types::U256,
137 pub amount_in_max: ::ethers::core::types::U256,
138 pub path: ::std::vec::Vec<::ethers::core::types::Address>,
139 pub to: ::ethers::core::types::Address,
140 }
141 #[derive(Debug, Clone, PartialEq, Eq, ::ethers::contract::EthAbiType)]
142 pub enum IOrionPoolV2Router02ExtCalls {
143 SwapExactTokensForTokensAutoRoute(SwapExactTokensForTokensAutoRouteCall),
144 SwapTokensForExactTokensAutoRoute(SwapTokensForExactTokensAutoRouteCall),
145 }
146 impl ::ethers::core::abi::AbiDecode for IOrionPoolV2Router02ExtCalls {
147 fn decode(
148 data: impl AsRef<[u8]>,
149 ) -> ::std::result::Result<Self, ::ethers::core::abi::AbiError> {
150 if let Ok(decoded) =
151 <SwapExactTokensForTokensAutoRouteCall as ::ethers::core::abi::AbiDecode>::decode(
152 data.as_ref(),
153 )
154 {
155 return Ok(
156 IOrionPoolV2Router02ExtCalls::SwapExactTokensForTokensAutoRoute(decoded),
157 );
158 }
159 if let Ok(decoded) =
160 <SwapTokensForExactTokensAutoRouteCall as ::ethers::core::abi::AbiDecode>::decode(
161 data.as_ref(),
162 )
163 {
164 return Ok(
165 IOrionPoolV2Router02ExtCalls::SwapTokensForExactTokensAutoRoute(decoded),
166 );
167 }
168 Err(::ethers::core::abi::Error::InvalidData.into())
169 }
170 }
171 impl ::ethers::core::abi::AbiEncode for IOrionPoolV2Router02ExtCalls {
172 fn encode(self) -> Vec<u8> {
173 match self {
174 IOrionPoolV2Router02ExtCalls::SwapExactTokensForTokensAutoRoute(element) => {
175 element.encode()
176 }
177 IOrionPoolV2Router02ExtCalls::SwapTokensForExactTokensAutoRoute(element) => {
178 element.encode()
179 }
180 }
181 }
182 }
183 impl ::std::fmt::Display for IOrionPoolV2Router02ExtCalls {
184 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
185 match self {
186 IOrionPoolV2Router02ExtCalls::SwapExactTokensForTokensAutoRoute(element) => {
187 element.fmt(f)
188 }
189 IOrionPoolV2Router02ExtCalls::SwapTokensForExactTokensAutoRoute(element) => {
190 element.fmt(f)
191 }
192 }
193 }
194 }
195 impl ::std::convert::From<SwapExactTokensForTokensAutoRouteCall> for IOrionPoolV2Router02ExtCalls {
196 fn from(var: SwapExactTokensForTokensAutoRouteCall) -> Self {
197 IOrionPoolV2Router02ExtCalls::SwapExactTokensForTokensAutoRoute(var)
198 }
199 }
200 impl ::std::convert::From<SwapTokensForExactTokensAutoRouteCall> for IOrionPoolV2Router02ExtCalls {
201 fn from(var: SwapTokensForExactTokensAutoRouteCall) -> Self {
202 IOrionPoolV2Router02ExtCalls::SwapTokensForExactTokensAutoRoute(var)
203 }
204 }
205 #[derive(
207 Clone,
208 Debug,
209 Eq,
210 PartialEq,
211 ::ethers::contract::EthAbiType,
212 ::ethers::contract::EthAbiCodec,
213 Default,
214 )]
215 pub struct SwapExactTokensForTokensAutoRouteReturn {
216 pub amounts: ::std::vec::Vec<::ethers::core::types::U256>,
217 }
218 #[derive(
220 Clone,
221 Debug,
222 Eq,
223 PartialEq,
224 ::ethers::contract::EthAbiType,
225 ::ethers::contract::EthAbiCodec,
226 Default,
227 )]
228 pub struct SwapTokensForExactTokensAutoRouteReturn {
229 pub amounts: ::std::vec::Vec<::ethers::core::types::U256>,
230 }
231}