1pub use hopr_ledger::*;
2#[allow(
5 clippy::enum_variant_names,
6 clippy::too_many_arguments,
7 clippy::upper_case_acronyms,
8 clippy::type_complexity,
9 dead_code,
10 non_camel_case_types,
11)]
12pub mod hopr_ledger {
13 #[allow(deprecated)]
14 fn __abi() -> ::ethers::core::abi::Abi {
15 ::ethers::core::abi::ethabi::Contract {
16 constructor: ::core::option::Option::None,
17 functions: ::core::convert::From::from([
18 (
19 ::std::borrow::ToOwned::to_owned("LEDGER_VERSION"),
20 ::std::vec![
21 ::ethers::core::abi::ethabi::Function {
22 name: ::std::borrow::ToOwned::to_owned("LEDGER_VERSION"),
23 inputs: ::std::vec![],
24 outputs: ::std::vec![
25 ::ethers::core::abi::ethabi::Param {
26 name: ::std::string::String::new(),
27 kind: ::ethers::core::abi::ethabi::ParamType::String,
28 internal_type: ::core::option::Option::Some(
29 ::std::borrow::ToOwned::to_owned("string"),
30 ),
31 },
32 ],
33 constant: ::core::option::Option::None,
34 state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
35 },
36 ],
37 ),
38 (
39 ::std::borrow::ToOwned::to_owned("ledgerDomainSeparator"),
40 ::std::vec![
41 ::ethers::core::abi::ethabi::Function {
42 name: ::std::borrow::ToOwned::to_owned(
43 "ledgerDomainSeparator",
44 ),
45 inputs: ::std::vec![],
46 outputs: ::std::vec![
47 ::ethers::core::abi::ethabi::Param {
48 name: ::std::string::String::new(),
49 kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
50 32usize,
51 ),
52 internal_type: ::core::option::Option::Some(
53 ::std::borrow::ToOwned::to_owned("bytes32"),
54 ),
55 },
56 ],
57 constant: ::core::option::Option::None,
58 state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
59 },
60 ],
61 ),
62 (
63 ::std::borrow::ToOwned::to_owned("updateLedgerDomainSeparator"),
64 ::std::vec![
65 ::ethers::core::abi::ethabi::Function {
66 name: ::std::borrow::ToOwned::to_owned(
67 "updateLedgerDomainSeparator",
68 ),
69 inputs: ::std::vec![],
70 outputs: ::std::vec![],
71 constant: ::core::option::Option::None,
72 state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable,
73 },
74 ],
75 ),
76 ]),
77 events: ::core::convert::From::from([
78 (
79 ::std::borrow::ToOwned::to_owned("LedgerDomainSeparatorUpdated"),
80 ::std::vec![
81 ::ethers::core::abi::ethabi::Event {
82 name: ::std::borrow::ToOwned::to_owned(
83 "LedgerDomainSeparatorUpdated",
84 ),
85 inputs: ::std::vec![
86 ::ethers::core::abi::ethabi::EventParam {
87 name: ::std::borrow::ToOwned::to_owned(
88 "ledgerDomainSeparator",
89 ),
90 kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
91 32usize,
92 ),
93 indexed: true,
94 },
95 ],
96 anonymous: false,
97 },
98 ],
99 ),
100 ]),
101 errors: ::std::collections::BTreeMap::new(),
102 receive: false,
103 fallback: false,
104 }
105 }
106 pub static HOPRLEDGER_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new(
108 __abi,
109 );
110 pub struct HoprLedger<M>(::ethers::contract::Contract<M>);
111 impl<M> ::core::clone::Clone for HoprLedger<M> {
112 fn clone(&self) -> Self {
113 Self(::core::clone::Clone::clone(&self.0))
114 }
115 }
116 impl<M> ::core::ops::Deref for HoprLedger<M> {
117 type Target = ::ethers::contract::Contract<M>;
118 fn deref(&self) -> &Self::Target {
119 &self.0
120 }
121 }
122 impl<M> ::core::ops::DerefMut for HoprLedger<M> {
123 fn deref_mut(&mut self) -> &mut Self::Target {
124 &mut self.0
125 }
126 }
127 impl<M> ::core::fmt::Debug for HoprLedger<M> {
128 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
129 f.debug_tuple(::core::stringify!(HoprLedger)).field(&self.address()).finish()
130 }
131 }
132 impl<M: ::ethers::providers::Middleware> HoprLedger<M> {
133 pub fn new<T: Into<::ethers::core::types::Address>>(
136 address: T,
137 client: ::std::sync::Arc<M>,
138 ) -> Self {
139 Self(
140 ::ethers::contract::Contract::new(
141 address.into(),
142 HOPRLEDGER_ABI.clone(),
143 client,
144 ),
145 )
146 }
147 pub fn ledger_version(
149 &self,
150 ) -> ::ethers::contract::builders::ContractCall<M, ::std::string::String> {
151 self.0
152 .method_hash([221, 173, 25, 2], ())
153 .expect("method not found (this should never happen)")
154 }
155 pub fn ledger_domain_separator(
157 &self,
158 ) -> ::ethers::contract::builders::ContractCall<M, [u8; 32]> {
159 self.0
160 .method_hash([201, 102, 196, 254], ())
161 .expect("method not found (this should never happen)")
162 }
163 pub fn update_ledger_domain_separator(
165 &self,
166 ) -> ::ethers::contract::builders::ContractCall<M, ()> {
167 self.0
168 .method_hash([220, 150, 253, 80], ())
169 .expect("method not found (this should never happen)")
170 }
171 pub fn ledger_domain_separator_updated_filter(
173 &self,
174 ) -> ::ethers::contract::builders::Event<
175 ::std::sync::Arc<M>,
176 M,
177 LedgerDomainSeparatorUpdatedFilter,
178 > {
179 self.0.event()
180 }
181 pub fn events(
183 &self,
184 ) -> ::ethers::contract::builders::Event<
185 ::std::sync::Arc<M>,
186 M,
187 LedgerDomainSeparatorUpdatedFilter,
188 > {
189 self.0.event_with_filter(::core::default::Default::default())
190 }
191 }
192 impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
193 for HoprLedger<M> {
194 fn from(contract: ::ethers::contract::Contract<M>) -> Self {
195 Self::new(contract.address(), contract.client())
196 }
197 }
198 #[derive(
199 Clone,
200 ::ethers::contract::EthEvent,
201 ::ethers::contract::EthDisplay,
202 serde::Serialize,
203 serde::Deserialize,
204 Default,
205 Debug,
206 PartialEq,
207 Eq,
208 Hash
209 )]
210 #[ethevent(
211 name = "LedgerDomainSeparatorUpdated",
212 abi = "LedgerDomainSeparatorUpdated(bytes32)"
213 )]
214 pub struct LedgerDomainSeparatorUpdatedFilter {
215 #[ethevent(indexed)]
216 pub ledger_domain_separator: [u8; 32],
217 }
218 #[derive(
220 Clone,
221 ::ethers::contract::EthCall,
222 ::ethers::contract::EthDisplay,
223 serde::Serialize,
224 serde::Deserialize,
225 Default,
226 Debug,
227 PartialEq,
228 Eq,
229 Hash
230 )]
231 #[ethcall(name = "LEDGER_VERSION", abi = "LEDGER_VERSION()")]
232 pub struct LedgerVersionCall;
233 #[derive(
235 Clone,
236 ::ethers::contract::EthCall,
237 ::ethers::contract::EthDisplay,
238 serde::Serialize,
239 serde::Deserialize,
240 Default,
241 Debug,
242 PartialEq,
243 Eq,
244 Hash
245 )]
246 #[ethcall(name = "ledgerDomainSeparator", abi = "ledgerDomainSeparator()")]
247 pub struct LedgerDomainSeparatorCall;
248 #[derive(
250 Clone,
251 ::ethers::contract::EthCall,
252 ::ethers::contract::EthDisplay,
253 serde::Serialize,
254 serde::Deserialize,
255 Default,
256 Debug,
257 PartialEq,
258 Eq,
259 Hash
260 )]
261 #[ethcall(
262 name = "updateLedgerDomainSeparator",
263 abi = "updateLedgerDomainSeparator()"
264 )]
265 pub struct UpdateLedgerDomainSeparatorCall;
266 #[derive(
268 Clone,
269 ::ethers::contract::EthAbiType,
270 serde::Serialize,
271 serde::Deserialize,
272 Debug,
273 PartialEq,
274 Eq,
275 Hash
276 )]
277 pub enum HoprLedgerCalls {
278 LedgerVersion(LedgerVersionCall),
279 LedgerDomainSeparator(LedgerDomainSeparatorCall),
280 UpdateLedgerDomainSeparator(UpdateLedgerDomainSeparatorCall),
281 }
282 impl ::ethers::core::abi::AbiDecode for HoprLedgerCalls {
283 fn decode(
284 data: impl AsRef<[u8]>,
285 ) -> ::core::result::Result<Self, ::ethers::core::abi::AbiError> {
286 let data = data.as_ref();
287 if let Ok(decoded) = <LedgerVersionCall as ::ethers::core::abi::AbiDecode>::decode(
288 data,
289 ) {
290 return Ok(Self::LedgerVersion(decoded));
291 }
292 if let Ok(decoded) = <LedgerDomainSeparatorCall as ::ethers::core::abi::AbiDecode>::decode(
293 data,
294 ) {
295 return Ok(Self::LedgerDomainSeparator(decoded));
296 }
297 if let Ok(decoded) = <UpdateLedgerDomainSeparatorCall as ::ethers::core::abi::AbiDecode>::decode(
298 data,
299 ) {
300 return Ok(Self::UpdateLedgerDomainSeparator(decoded));
301 }
302 Err(::ethers::core::abi::Error::InvalidData.into())
303 }
304 }
305 impl ::ethers::core::abi::AbiEncode for HoprLedgerCalls {
306 fn encode(self) -> Vec<u8> {
307 match self {
308 Self::LedgerVersion(element) => {
309 ::ethers::core::abi::AbiEncode::encode(element)
310 }
311 Self::LedgerDomainSeparator(element) => {
312 ::ethers::core::abi::AbiEncode::encode(element)
313 }
314 Self::UpdateLedgerDomainSeparator(element) => {
315 ::ethers::core::abi::AbiEncode::encode(element)
316 }
317 }
318 }
319 }
320 impl ::core::fmt::Display for HoprLedgerCalls {
321 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
322 match self {
323 Self::LedgerVersion(element) => ::core::fmt::Display::fmt(element, f),
324 Self::LedgerDomainSeparator(element) => {
325 ::core::fmt::Display::fmt(element, f)
326 }
327 Self::UpdateLedgerDomainSeparator(element) => {
328 ::core::fmt::Display::fmt(element, f)
329 }
330 }
331 }
332 }
333 impl ::core::convert::From<LedgerVersionCall> for HoprLedgerCalls {
334 fn from(value: LedgerVersionCall) -> Self {
335 Self::LedgerVersion(value)
336 }
337 }
338 impl ::core::convert::From<LedgerDomainSeparatorCall> for HoprLedgerCalls {
339 fn from(value: LedgerDomainSeparatorCall) -> Self {
340 Self::LedgerDomainSeparator(value)
341 }
342 }
343 impl ::core::convert::From<UpdateLedgerDomainSeparatorCall> for HoprLedgerCalls {
344 fn from(value: UpdateLedgerDomainSeparatorCall) -> Self {
345 Self::UpdateLedgerDomainSeparator(value)
346 }
347 }
348 #[derive(
350 Clone,
351 ::ethers::contract::EthAbiType,
352 ::ethers::contract::EthAbiCodec,
353 serde::Serialize,
354 serde::Deserialize,
355 Default,
356 Debug,
357 PartialEq,
358 Eq,
359 Hash
360 )]
361 pub struct LedgerVersionReturn(pub ::std::string::String);
362 #[derive(
364 Clone,
365 ::ethers::contract::EthAbiType,
366 ::ethers::contract::EthAbiCodec,
367 serde::Serialize,
368 serde::Deserialize,
369 Default,
370 Debug,
371 PartialEq,
372 Eq,
373 Hash
374 )]
375 pub struct LedgerDomainSeparatorReturn(pub [u8; 32]);
376}