hopr_bindings/codegen/
hopr_channels_events.rs

1pub use hopr_channels_events::*;
2/// This module was auto-generated with ethers-rs Abigen.
3/// More information at: <https://github.com/gakonst/ethers-rs>
4#[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_channels_events {
13    #[allow(deprecated)]
14    fn __abi() -> ::ethers::core::abi::Abi {
15        ::ethers::core::abi::ethabi::Contract {
16            constructor: ::core::option::Option::None,
17            functions: ::std::collections::BTreeMap::new(),
18            events: ::core::convert::From::from([
19                (
20                    ::std::borrow::ToOwned::to_owned("ChannelBalanceDecreased"),
21                    ::std::vec![
22                        ::ethers::core::abi::ethabi::Event {
23                            name: ::std::borrow::ToOwned::to_owned(
24                                "ChannelBalanceDecreased",
25                            ),
26                            inputs: ::std::vec![
27                                ::ethers::core::abi::ethabi::EventParam {
28                                    name: ::std::borrow::ToOwned::to_owned("channelId"),
29                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
30                                        32usize,
31                                    ),
32                                    indexed: true,
33                                },
34                                ::ethers::core::abi::ethabi::EventParam {
35                                    name: ::std::borrow::ToOwned::to_owned("newBalance"),
36                                    kind: ::ethers::core::abi::ethabi::ParamType::Uint(96usize),
37                                    indexed: false,
38                                },
39                            ],
40                            anonymous: false,
41                        },
42                    ],
43                ),
44                (
45                    ::std::borrow::ToOwned::to_owned("ChannelBalanceIncreased"),
46                    ::std::vec![
47                        ::ethers::core::abi::ethabi::Event {
48                            name: ::std::borrow::ToOwned::to_owned(
49                                "ChannelBalanceIncreased",
50                            ),
51                            inputs: ::std::vec![
52                                ::ethers::core::abi::ethabi::EventParam {
53                                    name: ::std::borrow::ToOwned::to_owned("channelId"),
54                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
55                                        32usize,
56                                    ),
57                                    indexed: true,
58                                },
59                                ::ethers::core::abi::ethabi::EventParam {
60                                    name: ::std::borrow::ToOwned::to_owned("newBalance"),
61                                    kind: ::ethers::core::abi::ethabi::ParamType::Uint(96usize),
62                                    indexed: false,
63                                },
64                            ],
65                            anonymous: false,
66                        },
67                    ],
68                ),
69                (
70                    ::std::borrow::ToOwned::to_owned("ChannelClosed"),
71                    ::std::vec![
72                        ::ethers::core::abi::ethabi::Event {
73                            name: ::std::borrow::ToOwned::to_owned("ChannelClosed"),
74                            inputs: ::std::vec![
75                                ::ethers::core::abi::ethabi::EventParam {
76                                    name: ::std::borrow::ToOwned::to_owned("channelId"),
77                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
78                                        32usize,
79                                    ),
80                                    indexed: true,
81                                },
82                            ],
83                            anonymous: false,
84                        },
85                    ],
86                ),
87                (
88                    ::std::borrow::ToOwned::to_owned("ChannelOpened"),
89                    ::std::vec![
90                        ::ethers::core::abi::ethabi::Event {
91                            name: ::std::borrow::ToOwned::to_owned("ChannelOpened"),
92                            inputs: ::std::vec![
93                                ::ethers::core::abi::ethabi::EventParam {
94                                    name: ::std::borrow::ToOwned::to_owned("source"),
95                                    kind: ::ethers::core::abi::ethabi::ParamType::Address,
96                                    indexed: true,
97                                },
98                                ::ethers::core::abi::ethabi::EventParam {
99                                    name: ::std::borrow::ToOwned::to_owned("destination"),
100                                    kind: ::ethers::core::abi::ethabi::ParamType::Address,
101                                    indexed: true,
102                                },
103                            ],
104                            anonymous: false,
105                        },
106                    ],
107                ),
108                (
109                    ::std::borrow::ToOwned::to_owned("DomainSeparatorUpdated"),
110                    ::std::vec![
111                        ::ethers::core::abi::ethabi::Event {
112                            name: ::std::borrow::ToOwned::to_owned(
113                                "DomainSeparatorUpdated",
114                            ),
115                            inputs: ::std::vec![
116                                ::ethers::core::abi::ethabi::EventParam {
117                                    name: ::std::borrow::ToOwned::to_owned("domainSeparator"),
118                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
119                                        32usize,
120                                    ),
121                                    indexed: true,
122                                },
123                            ],
124                            anonymous: false,
125                        },
126                    ],
127                ),
128                (
129                    ::std::borrow::ToOwned::to_owned("OutgoingChannelClosureInitiated"),
130                    ::std::vec![
131                        ::ethers::core::abi::ethabi::Event {
132                            name: ::std::borrow::ToOwned::to_owned(
133                                "OutgoingChannelClosureInitiated",
134                            ),
135                            inputs: ::std::vec![
136                                ::ethers::core::abi::ethabi::EventParam {
137                                    name: ::std::borrow::ToOwned::to_owned("channelId"),
138                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
139                                        32usize,
140                                    ),
141                                    indexed: true,
142                                },
143                                ::ethers::core::abi::ethabi::EventParam {
144                                    name: ::std::borrow::ToOwned::to_owned("closureTime"),
145                                    kind: ::ethers::core::abi::ethabi::ParamType::Uint(32usize),
146                                    indexed: false,
147                                },
148                            ],
149                            anonymous: false,
150                        },
151                    ],
152                ),
153                (
154                    ::std::borrow::ToOwned::to_owned("TicketRedeemed"),
155                    ::std::vec![
156                        ::ethers::core::abi::ethabi::Event {
157                            name: ::std::borrow::ToOwned::to_owned("TicketRedeemed"),
158                            inputs: ::std::vec![
159                                ::ethers::core::abi::ethabi::EventParam {
160                                    name: ::std::borrow::ToOwned::to_owned("channelId"),
161                                    kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes(
162                                        32usize,
163                                    ),
164                                    indexed: true,
165                                },
166                                ::ethers::core::abi::ethabi::EventParam {
167                                    name: ::std::borrow::ToOwned::to_owned("newTicketIndex"),
168                                    kind: ::ethers::core::abi::ethabi::ParamType::Uint(48usize),
169                                    indexed: false,
170                                },
171                            ],
172                            anonymous: false,
173                        },
174                    ],
175                ),
176            ]),
177            errors: ::std::collections::BTreeMap::new(),
178            receive: false,
179            fallback: false,
180        }
181    }
182    ///The parsed JSON ABI of the contract.
183    pub static HOPRCHANNELSEVENTS_ABI: ::ethers::contract::Lazy<
184        ::ethers::core::abi::Abi,
185    > = ::ethers::contract::Lazy::new(__abi);
186    pub struct HoprChannelsEvents<M>(::ethers::contract::Contract<M>);
187    impl<M> ::core::clone::Clone for HoprChannelsEvents<M> {
188        fn clone(&self) -> Self {
189            Self(::core::clone::Clone::clone(&self.0))
190        }
191    }
192    impl<M> ::core::ops::Deref for HoprChannelsEvents<M> {
193        type Target = ::ethers::contract::Contract<M>;
194        fn deref(&self) -> &Self::Target {
195            &self.0
196        }
197    }
198    impl<M> ::core::ops::DerefMut for HoprChannelsEvents<M> {
199        fn deref_mut(&mut self) -> &mut Self::Target {
200            &mut self.0
201        }
202    }
203    impl<M> ::core::fmt::Debug for HoprChannelsEvents<M> {
204        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
205            f.debug_tuple(::core::stringify!(HoprChannelsEvents))
206                .field(&self.address())
207                .finish()
208        }
209    }
210    impl<M: ::ethers::providers::Middleware> HoprChannelsEvents<M> {
211        /// Creates a new contract instance with the specified `ethers` client at
212        /// `address`. The contract derefs to a `ethers::Contract` object.
213        pub fn new<T: Into<::ethers::core::types::Address>>(
214            address: T,
215            client: ::std::sync::Arc<M>,
216        ) -> Self {
217            Self(
218                ::ethers::contract::Contract::new(
219                    address.into(),
220                    HOPRCHANNELSEVENTS_ABI.clone(),
221                    client,
222                ),
223            )
224        }
225        ///Gets the contract's `ChannelBalanceDecreased` event
226        pub fn channel_balance_decreased_filter(
227            &self,
228        ) -> ::ethers::contract::builders::Event<
229            ::std::sync::Arc<M>,
230            M,
231            ChannelBalanceDecreasedFilter,
232        > {
233            self.0.event()
234        }
235        ///Gets the contract's `ChannelBalanceIncreased` event
236        pub fn channel_balance_increased_filter(
237            &self,
238        ) -> ::ethers::contract::builders::Event<
239            ::std::sync::Arc<M>,
240            M,
241            ChannelBalanceIncreasedFilter,
242        > {
243            self.0.event()
244        }
245        ///Gets the contract's `ChannelClosed` event
246        pub fn channel_closed_filter(
247            &self,
248        ) -> ::ethers::contract::builders::Event<
249            ::std::sync::Arc<M>,
250            M,
251            ChannelClosedFilter,
252        > {
253            self.0.event()
254        }
255        ///Gets the contract's `ChannelOpened` event
256        pub fn channel_opened_filter(
257            &self,
258        ) -> ::ethers::contract::builders::Event<
259            ::std::sync::Arc<M>,
260            M,
261            ChannelOpenedFilter,
262        > {
263            self.0.event()
264        }
265        ///Gets the contract's `DomainSeparatorUpdated` event
266        pub fn domain_separator_updated_filter(
267            &self,
268        ) -> ::ethers::contract::builders::Event<
269            ::std::sync::Arc<M>,
270            M,
271            DomainSeparatorUpdatedFilter,
272        > {
273            self.0.event()
274        }
275        ///Gets the contract's `OutgoingChannelClosureInitiated` event
276        pub fn outgoing_channel_closure_initiated_filter(
277            &self,
278        ) -> ::ethers::contract::builders::Event<
279            ::std::sync::Arc<M>,
280            M,
281            OutgoingChannelClosureInitiatedFilter,
282        > {
283            self.0.event()
284        }
285        ///Gets the contract's `TicketRedeemed` event
286        pub fn ticket_redeemed_filter(
287            &self,
288        ) -> ::ethers::contract::builders::Event<
289            ::std::sync::Arc<M>,
290            M,
291            TicketRedeemedFilter,
292        > {
293            self.0.event()
294        }
295        /// Returns an `Event` builder for all the events of this contract.
296        pub fn events(
297            &self,
298        ) -> ::ethers::contract::builders::Event<
299            ::std::sync::Arc<M>,
300            M,
301            HoprChannelsEventsEvents,
302        > {
303            self.0.event_with_filter(::core::default::Default::default())
304        }
305    }
306    impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
307    for HoprChannelsEvents<M> {
308        fn from(contract: ::ethers::contract::Contract<M>) -> Self {
309            Self::new(contract.address(), contract.client())
310        }
311    }
312    #[derive(
313        Clone,
314        ::ethers::contract::EthEvent,
315        ::ethers::contract::EthDisplay,
316        serde::Serialize,
317        serde::Deserialize,
318        Default,
319        Debug,
320        PartialEq,
321        Eq,
322        Hash
323    )]
324    #[ethevent(
325        name = "ChannelBalanceDecreased",
326        abi = "ChannelBalanceDecreased(bytes32,uint96)"
327    )]
328    pub struct ChannelBalanceDecreasedFilter {
329        #[ethevent(indexed)]
330        pub channel_id: [u8; 32],
331        pub new_balance: u128,
332    }
333    #[derive(
334        Clone,
335        ::ethers::contract::EthEvent,
336        ::ethers::contract::EthDisplay,
337        serde::Serialize,
338        serde::Deserialize,
339        Default,
340        Debug,
341        PartialEq,
342        Eq,
343        Hash
344    )]
345    #[ethevent(
346        name = "ChannelBalanceIncreased",
347        abi = "ChannelBalanceIncreased(bytes32,uint96)"
348    )]
349    pub struct ChannelBalanceIncreasedFilter {
350        #[ethevent(indexed)]
351        pub channel_id: [u8; 32],
352        pub new_balance: u128,
353    }
354    #[derive(
355        Clone,
356        ::ethers::contract::EthEvent,
357        ::ethers::contract::EthDisplay,
358        serde::Serialize,
359        serde::Deserialize,
360        Default,
361        Debug,
362        PartialEq,
363        Eq,
364        Hash
365    )]
366    #[ethevent(name = "ChannelClosed", abi = "ChannelClosed(bytes32)")]
367    pub struct ChannelClosedFilter {
368        #[ethevent(indexed)]
369        pub channel_id: [u8; 32],
370    }
371    #[derive(
372        Clone,
373        ::ethers::contract::EthEvent,
374        ::ethers::contract::EthDisplay,
375        serde::Serialize,
376        serde::Deserialize,
377        Default,
378        Debug,
379        PartialEq,
380        Eq,
381        Hash
382    )]
383    #[ethevent(name = "ChannelOpened", abi = "ChannelOpened(address,address)")]
384    pub struct ChannelOpenedFilter {
385        #[ethevent(indexed)]
386        pub source: ::ethers::core::types::Address,
387        #[ethevent(indexed)]
388        pub destination: ::ethers::core::types::Address,
389    }
390    #[derive(
391        Clone,
392        ::ethers::contract::EthEvent,
393        ::ethers::contract::EthDisplay,
394        serde::Serialize,
395        serde::Deserialize,
396        Default,
397        Debug,
398        PartialEq,
399        Eq,
400        Hash
401    )]
402    #[ethevent(name = "DomainSeparatorUpdated", abi = "DomainSeparatorUpdated(bytes32)")]
403    pub struct DomainSeparatorUpdatedFilter {
404        #[ethevent(indexed)]
405        pub domain_separator: [u8; 32],
406    }
407    #[derive(
408        Clone,
409        ::ethers::contract::EthEvent,
410        ::ethers::contract::EthDisplay,
411        serde::Serialize,
412        serde::Deserialize,
413        Default,
414        Debug,
415        PartialEq,
416        Eq,
417        Hash
418    )]
419    #[ethevent(
420        name = "OutgoingChannelClosureInitiated",
421        abi = "OutgoingChannelClosureInitiated(bytes32,uint32)"
422    )]
423    pub struct OutgoingChannelClosureInitiatedFilter {
424        #[ethevent(indexed)]
425        pub channel_id: [u8; 32],
426        pub closure_time: u32,
427    }
428    #[derive(
429        Clone,
430        ::ethers::contract::EthEvent,
431        ::ethers::contract::EthDisplay,
432        serde::Serialize,
433        serde::Deserialize,
434        Default,
435        Debug,
436        PartialEq,
437        Eq,
438        Hash
439    )]
440    #[ethevent(name = "TicketRedeemed", abi = "TicketRedeemed(bytes32,uint48)")]
441    pub struct TicketRedeemedFilter {
442        #[ethevent(indexed)]
443        pub channel_id: [u8; 32],
444        pub new_ticket_index: u64,
445    }
446    ///Container type for all of the contract's events
447    #[derive(
448        Clone,
449        ::ethers::contract::EthAbiType,
450        serde::Serialize,
451        serde::Deserialize,
452        Debug,
453        PartialEq,
454        Eq,
455        Hash
456    )]
457    pub enum HoprChannelsEventsEvents {
458        ChannelBalanceDecreasedFilter(ChannelBalanceDecreasedFilter),
459        ChannelBalanceIncreasedFilter(ChannelBalanceIncreasedFilter),
460        ChannelClosedFilter(ChannelClosedFilter),
461        ChannelOpenedFilter(ChannelOpenedFilter),
462        DomainSeparatorUpdatedFilter(DomainSeparatorUpdatedFilter),
463        OutgoingChannelClosureInitiatedFilter(OutgoingChannelClosureInitiatedFilter),
464        TicketRedeemedFilter(TicketRedeemedFilter),
465    }
466    impl ::ethers::contract::EthLogDecode for HoprChannelsEventsEvents {
467        fn decode_log(
468            log: &::ethers::core::abi::RawLog,
469        ) -> ::core::result::Result<Self, ::ethers::core::abi::Error> {
470            if let Ok(decoded) = ChannelBalanceDecreasedFilter::decode_log(log) {
471                return Ok(
472                    HoprChannelsEventsEvents::ChannelBalanceDecreasedFilter(decoded),
473                );
474            }
475            if let Ok(decoded) = ChannelBalanceIncreasedFilter::decode_log(log) {
476                return Ok(
477                    HoprChannelsEventsEvents::ChannelBalanceIncreasedFilter(decoded),
478                );
479            }
480            if let Ok(decoded) = ChannelClosedFilter::decode_log(log) {
481                return Ok(HoprChannelsEventsEvents::ChannelClosedFilter(decoded));
482            }
483            if let Ok(decoded) = ChannelOpenedFilter::decode_log(log) {
484                return Ok(HoprChannelsEventsEvents::ChannelOpenedFilter(decoded));
485            }
486            if let Ok(decoded) = DomainSeparatorUpdatedFilter::decode_log(log) {
487                return Ok(
488                    HoprChannelsEventsEvents::DomainSeparatorUpdatedFilter(decoded),
489                );
490            }
491            if let Ok(decoded) = OutgoingChannelClosureInitiatedFilter::decode_log(log) {
492                return Ok(
493                    HoprChannelsEventsEvents::OutgoingChannelClosureInitiatedFilter(
494                        decoded,
495                    ),
496                );
497            }
498            if let Ok(decoded) = TicketRedeemedFilter::decode_log(log) {
499                return Ok(HoprChannelsEventsEvents::TicketRedeemedFilter(decoded));
500            }
501            Err(::ethers::core::abi::Error::InvalidData)
502        }
503    }
504    impl ::core::fmt::Display for HoprChannelsEventsEvents {
505        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
506            match self {
507                Self::ChannelBalanceDecreasedFilter(element) => {
508                    ::core::fmt::Display::fmt(element, f)
509                }
510                Self::ChannelBalanceIncreasedFilter(element) => {
511                    ::core::fmt::Display::fmt(element, f)
512                }
513                Self::ChannelClosedFilter(element) => {
514                    ::core::fmt::Display::fmt(element, f)
515                }
516                Self::ChannelOpenedFilter(element) => {
517                    ::core::fmt::Display::fmt(element, f)
518                }
519                Self::DomainSeparatorUpdatedFilter(element) => {
520                    ::core::fmt::Display::fmt(element, f)
521                }
522                Self::OutgoingChannelClosureInitiatedFilter(element) => {
523                    ::core::fmt::Display::fmt(element, f)
524                }
525                Self::TicketRedeemedFilter(element) => {
526                    ::core::fmt::Display::fmt(element, f)
527                }
528            }
529        }
530    }
531    impl ::core::convert::From<ChannelBalanceDecreasedFilter>
532    for HoprChannelsEventsEvents {
533        fn from(value: ChannelBalanceDecreasedFilter) -> Self {
534            Self::ChannelBalanceDecreasedFilter(value)
535        }
536    }
537    impl ::core::convert::From<ChannelBalanceIncreasedFilter>
538    for HoprChannelsEventsEvents {
539        fn from(value: ChannelBalanceIncreasedFilter) -> Self {
540            Self::ChannelBalanceIncreasedFilter(value)
541        }
542    }
543    impl ::core::convert::From<ChannelClosedFilter> for HoprChannelsEventsEvents {
544        fn from(value: ChannelClosedFilter) -> Self {
545            Self::ChannelClosedFilter(value)
546        }
547    }
548    impl ::core::convert::From<ChannelOpenedFilter> for HoprChannelsEventsEvents {
549        fn from(value: ChannelOpenedFilter) -> Self {
550            Self::ChannelOpenedFilter(value)
551        }
552    }
553    impl ::core::convert::From<DomainSeparatorUpdatedFilter>
554    for HoprChannelsEventsEvents {
555        fn from(value: DomainSeparatorUpdatedFilter) -> Self {
556            Self::DomainSeparatorUpdatedFilter(value)
557        }
558    }
559    impl ::core::convert::From<OutgoingChannelClosureInitiatedFilter>
560    for HoprChannelsEventsEvents {
561        fn from(value: OutgoingChannelClosureInitiatedFilter) -> Self {
562            Self::OutgoingChannelClosureInitiatedFilter(value)
563        }
564    }
565    impl ::core::convert::From<TicketRedeemedFilter> for HoprChannelsEventsEvents {
566        fn from(value: TicketRedeemedFilter) -> Self {
567            Self::TicketRedeemedFilter(value)
568        }
569    }
570}