hopr_bindings/codegen/
hoprannouncementsevents.rs

1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface HoprAnnouncementsEvents {
6    event AddressAnnouncement(address node, string baseMultiaddr);
7    event KeyBinding(bytes32 ed25519_sig_0, bytes32 ed25519_sig_1, bytes32 ed25519_pub_key, address chain_key);
8    event RevokeAnnouncement(address node);
9}
10```
11
12...which was generated by the following JSON ABI:
13```json
14[
15  {
16    "type": "event",
17    "name": "AddressAnnouncement",
18    "inputs": [
19      {
20        "name": "node",
21        "type": "address",
22        "indexed": false,
23        "internalType": "address"
24      },
25      {
26        "name": "baseMultiaddr",
27        "type": "string",
28        "indexed": false,
29        "internalType": "string"
30      }
31    ],
32    "anonymous": false
33  },
34  {
35    "type": "event",
36    "name": "KeyBinding",
37    "inputs": [
38      {
39        "name": "ed25519_sig_0",
40        "type": "bytes32",
41        "indexed": false,
42        "internalType": "bytes32"
43      },
44      {
45        "name": "ed25519_sig_1",
46        "type": "bytes32",
47        "indexed": false,
48        "internalType": "bytes32"
49      },
50      {
51        "name": "ed25519_pub_key",
52        "type": "bytes32",
53        "indexed": false,
54        "internalType": "bytes32"
55      },
56      {
57        "name": "chain_key",
58        "type": "address",
59        "indexed": false,
60        "internalType": "address"
61      }
62    ],
63    "anonymous": false
64  },
65  {
66    "type": "event",
67    "name": "RevokeAnnouncement",
68    "inputs": [
69      {
70        "name": "node",
71        "type": "address",
72        "indexed": false,
73        "internalType": "address"
74      }
75    ],
76    "anonymous": false
77  }
78]
79```*/
80#[allow(
81    non_camel_case_types,
82    non_snake_case,
83    clippy::pub_underscore_fields,
84    clippy::style,
85    clippy::empty_structs_with_brackets
86)]
87pub mod HoprAnnouncementsEvents {
88    use super::*;
89    use alloy::sol_types as alloy_sol_types;
90    /// The creation / init bytecode of the contract.
91    ///
92    /// ```text
93    ///0x
94    /// ```
95    #[rustfmt::skip]
96    #[allow(clippy::all)]
97    pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
98        b"",
99    );
100    /// The runtime bytecode of the contract, as deployed on the network.
101    ///
102    /// ```text
103    ///0x
104    /// ```
105    #[rustfmt::skip]
106    #[allow(clippy::all)]
107    pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
108        b"",
109    );
110    #[derive(serde::Serialize, serde::Deserialize)]
111    #[derive(Default, Debug, PartialEq, Eq, Hash)]
112    /**Event with signature `AddressAnnouncement(address,string)` and selector `0xc4df5ba16814838ab2618829d68f8623bb897302f24dbdba2279dbe45adb3d14`.
113```solidity
114event AddressAnnouncement(address node, string baseMultiaddr);
115```*/
116    #[allow(
117        non_camel_case_types,
118        non_snake_case,
119        clippy::pub_underscore_fields,
120        clippy::style
121    )]
122    #[derive(Clone)]
123    pub struct AddressAnnouncement {
124        #[allow(missing_docs)]
125        pub node: alloy::sol_types::private::Address,
126        #[allow(missing_docs)]
127        pub baseMultiaddr: alloy::sol_types::private::String,
128    }
129    #[allow(
130        non_camel_case_types,
131        non_snake_case,
132        clippy::pub_underscore_fields,
133        clippy::style
134    )]
135    const _: () = {
136        use alloy::sol_types as alloy_sol_types;
137        #[automatically_derived]
138        impl alloy_sol_types::SolEvent for AddressAnnouncement {
139            type DataTuple<'a> = (
140                alloy::sol_types::sol_data::Address,
141                alloy::sol_types::sol_data::String,
142            );
143            type DataToken<'a> = <Self::DataTuple<
144                'a,
145            > as alloy_sol_types::SolType>::Token<'a>;
146            type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,);
147            const SIGNATURE: &'static str = "AddressAnnouncement(address,string)";
148            const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
149                196u8, 223u8, 91u8, 161u8, 104u8, 20u8, 131u8, 138u8, 178u8, 97u8, 136u8,
150                41u8, 214u8, 143u8, 134u8, 35u8, 187u8, 137u8, 115u8, 2u8, 242u8, 77u8,
151                189u8, 186u8, 34u8, 121u8, 219u8, 228u8, 90u8, 219u8, 61u8, 20u8,
152            ]);
153            const ANONYMOUS: bool = false;
154            #[allow(unused_variables)]
155            #[inline]
156            fn new(
157                topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
158                data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
159            ) -> Self {
160                Self {
161                    node: data.0,
162                    baseMultiaddr: data.1,
163                }
164            }
165            #[inline]
166            fn check_signature(
167                topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
168            ) -> alloy_sol_types::Result<()> {
169                if topics.0 != Self::SIGNATURE_HASH {
170                    return Err(
171                        alloy_sol_types::Error::invalid_event_signature_hash(
172                            Self::SIGNATURE,
173                            topics.0,
174                            Self::SIGNATURE_HASH,
175                        ),
176                    );
177                }
178                Ok(())
179            }
180            #[inline]
181            fn tokenize_body(&self) -> Self::DataToken<'_> {
182                (
183                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
184                        &self.node,
185                    ),
186                    <alloy::sol_types::sol_data::String as alloy_sol_types::SolType>::tokenize(
187                        &self.baseMultiaddr,
188                    ),
189                )
190            }
191            #[inline]
192            fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
193                (Self::SIGNATURE_HASH.into(),)
194            }
195            #[inline]
196            fn encode_topics_raw(
197                &self,
198                out: &mut [alloy_sol_types::abi::token::WordToken],
199            ) -> alloy_sol_types::Result<()> {
200                if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
201                    return Err(alloy_sol_types::Error::Overrun);
202                }
203                out[0usize] = alloy_sol_types::abi::token::WordToken(
204                    Self::SIGNATURE_HASH,
205                );
206                Ok(())
207            }
208        }
209        #[automatically_derived]
210        impl alloy_sol_types::private::IntoLogData for AddressAnnouncement {
211            fn to_log_data(&self) -> alloy_sol_types::private::LogData {
212                From::from(self)
213            }
214            fn into_log_data(self) -> alloy_sol_types::private::LogData {
215                From::from(&self)
216            }
217        }
218        #[automatically_derived]
219        impl From<&AddressAnnouncement> for alloy_sol_types::private::LogData {
220            #[inline]
221            fn from(this: &AddressAnnouncement) -> alloy_sol_types::private::LogData {
222                alloy_sol_types::SolEvent::encode_log_data(this)
223            }
224        }
225    };
226    #[derive(serde::Serialize, serde::Deserialize)]
227    #[derive(Default, Debug, PartialEq, Eq, Hash)]
228    /**Event with signature `KeyBinding(bytes32,bytes32,bytes32,address)` and selector `0xbf49ccd41a4118c7e1e72143bad844e5f6ed12bf60caa642d88d19ca10244c36`.
229```solidity
230event KeyBinding(bytes32 ed25519_sig_0, bytes32 ed25519_sig_1, bytes32 ed25519_pub_key, address chain_key);
231```*/
232    #[allow(
233        non_camel_case_types,
234        non_snake_case,
235        clippy::pub_underscore_fields,
236        clippy::style
237    )]
238    #[derive(Clone)]
239    pub struct KeyBinding {
240        #[allow(missing_docs)]
241        pub ed25519_sig_0: alloy::sol_types::private::FixedBytes<32>,
242        #[allow(missing_docs)]
243        pub ed25519_sig_1: alloy::sol_types::private::FixedBytes<32>,
244        #[allow(missing_docs)]
245        pub ed25519_pub_key: alloy::sol_types::private::FixedBytes<32>,
246        #[allow(missing_docs)]
247        pub chain_key: alloy::sol_types::private::Address,
248    }
249    #[allow(
250        non_camel_case_types,
251        non_snake_case,
252        clippy::pub_underscore_fields,
253        clippy::style
254    )]
255    const _: () = {
256        use alloy::sol_types as alloy_sol_types;
257        #[automatically_derived]
258        impl alloy_sol_types::SolEvent for KeyBinding {
259            type DataTuple<'a> = (
260                alloy::sol_types::sol_data::FixedBytes<32>,
261                alloy::sol_types::sol_data::FixedBytes<32>,
262                alloy::sol_types::sol_data::FixedBytes<32>,
263                alloy::sol_types::sol_data::Address,
264            );
265            type DataToken<'a> = <Self::DataTuple<
266                'a,
267            > as alloy_sol_types::SolType>::Token<'a>;
268            type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,);
269            const SIGNATURE: &'static str = "KeyBinding(bytes32,bytes32,bytes32,address)";
270            const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
271                191u8, 73u8, 204u8, 212u8, 26u8, 65u8, 24u8, 199u8, 225u8, 231u8, 33u8,
272                67u8, 186u8, 216u8, 68u8, 229u8, 246u8, 237u8, 18u8, 191u8, 96u8, 202u8,
273                166u8, 66u8, 216u8, 141u8, 25u8, 202u8, 16u8, 36u8, 76u8, 54u8,
274            ]);
275            const ANONYMOUS: bool = false;
276            #[allow(unused_variables)]
277            #[inline]
278            fn new(
279                topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
280                data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
281            ) -> Self {
282                Self {
283                    ed25519_sig_0: data.0,
284                    ed25519_sig_1: data.1,
285                    ed25519_pub_key: data.2,
286                    chain_key: data.3,
287                }
288            }
289            #[inline]
290            fn check_signature(
291                topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
292            ) -> alloy_sol_types::Result<()> {
293                if topics.0 != Self::SIGNATURE_HASH {
294                    return Err(
295                        alloy_sol_types::Error::invalid_event_signature_hash(
296                            Self::SIGNATURE,
297                            topics.0,
298                            Self::SIGNATURE_HASH,
299                        ),
300                    );
301                }
302                Ok(())
303            }
304            #[inline]
305            fn tokenize_body(&self) -> Self::DataToken<'_> {
306                (
307                    <alloy::sol_types::sol_data::FixedBytes<
308                        32,
309                    > as alloy_sol_types::SolType>::tokenize(&self.ed25519_sig_0),
310                    <alloy::sol_types::sol_data::FixedBytes<
311                        32,
312                    > as alloy_sol_types::SolType>::tokenize(&self.ed25519_sig_1),
313                    <alloy::sol_types::sol_data::FixedBytes<
314                        32,
315                    > as alloy_sol_types::SolType>::tokenize(&self.ed25519_pub_key),
316                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
317                        &self.chain_key,
318                    ),
319                )
320            }
321            #[inline]
322            fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
323                (Self::SIGNATURE_HASH.into(),)
324            }
325            #[inline]
326            fn encode_topics_raw(
327                &self,
328                out: &mut [alloy_sol_types::abi::token::WordToken],
329            ) -> alloy_sol_types::Result<()> {
330                if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
331                    return Err(alloy_sol_types::Error::Overrun);
332                }
333                out[0usize] = alloy_sol_types::abi::token::WordToken(
334                    Self::SIGNATURE_HASH,
335                );
336                Ok(())
337            }
338        }
339        #[automatically_derived]
340        impl alloy_sol_types::private::IntoLogData for KeyBinding {
341            fn to_log_data(&self) -> alloy_sol_types::private::LogData {
342                From::from(self)
343            }
344            fn into_log_data(self) -> alloy_sol_types::private::LogData {
345                From::from(&self)
346            }
347        }
348        #[automatically_derived]
349        impl From<&KeyBinding> for alloy_sol_types::private::LogData {
350            #[inline]
351            fn from(this: &KeyBinding) -> alloy_sol_types::private::LogData {
352                alloy_sol_types::SolEvent::encode_log_data(this)
353            }
354        }
355    };
356    #[derive(serde::Serialize, serde::Deserialize)]
357    #[derive(Default, Debug, PartialEq, Eq, Hash)]
358    /**Event with signature `RevokeAnnouncement(address)` and selector `0xa4de30a528becadf82649d1395c0e30dd18ae35b5a96ce71e9295bb14bc9f3bc`.
359```solidity
360event RevokeAnnouncement(address node);
361```*/
362    #[allow(
363        non_camel_case_types,
364        non_snake_case,
365        clippy::pub_underscore_fields,
366        clippy::style
367    )]
368    #[derive(Clone)]
369    pub struct RevokeAnnouncement {
370        #[allow(missing_docs)]
371        pub node: alloy::sol_types::private::Address,
372    }
373    #[allow(
374        non_camel_case_types,
375        non_snake_case,
376        clippy::pub_underscore_fields,
377        clippy::style
378    )]
379    const _: () = {
380        use alloy::sol_types as alloy_sol_types;
381        #[automatically_derived]
382        impl alloy_sol_types::SolEvent for RevokeAnnouncement {
383            type DataTuple<'a> = (alloy::sol_types::sol_data::Address,);
384            type DataToken<'a> = <Self::DataTuple<
385                'a,
386            > as alloy_sol_types::SolType>::Token<'a>;
387            type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,);
388            const SIGNATURE: &'static str = "RevokeAnnouncement(address)";
389            const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
390                164u8, 222u8, 48u8, 165u8, 40u8, 190u8, 202u8, 223u8, 130u8, 100u8,
391                157u8, 19u8, 149u8, 192u8, 227u8, 13u8, 209u8, 138u8, 227u8, 91u8, 90u8,
392                150u8, 206u8, 113u8, 233u8, 41u8, 91u8, 177u8, 75u8, 201u8, 243u8, 188u8,
393            ]);
394            const ANONYMOUS: bool = false;
395            #[allow(unused_variables)]
396            #[inline]
397            fn new(
398                topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
399                data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
400            ) -> Self {
401                Self { node: data.0 }
402            }
403            #[inline]
404            fn check_signature(
405                topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
406            ) -> alloy_sol_types::Result<()> {
407                if topics.0 != Self::SIGNATURE_HASH {
408                    return Err(
409                        alloy_sol_types::Error::invalid_event_signature_hash(
410                            Self::SIGNATURE,
411                            topics.0,
412                            Self::SIGNATURE_HASH,
413                        ),
414                    );
415                }
416                Ok(())
417            }
418            #[inline]
419            fn tokenize_body(&self) -> Self::DataToken<'_> {
420                (
421                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
422                        &self.node,
423                    ),
424                )
425            }
426            #[inline]
427            fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
428                (Self::SIGNATURE_HASH.into(),)
429            }
430            #[inline]
431            fn encode_topics_raw(
432                &self,
433                out: &mut [alloy_sol_types::abi::token::WordToken],
434            ) -> alloy_sol_types::Result<()> {
435                if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
436                    return Err(alloy_sol_types::Error::Overrun);
437                }
438                out[0usize] = alloy_sol_types::abi::token::WordToken(
439                    Self::SIGNATURE_HASH,
440                );
441                Ok(())
442            }
443        }
444        #[automatically_derived]
445        impl alloy_sol_types::private::IntoLogData for RevokeAnnouncement {
446            fn to_log_data(&self) -> alloy_sol_types::private::LogData {
447                From::from(self)
448            }
449            fn into_log_data(self) -> alloy_sol_types::private::LogData {
450                From::from(&self)
451            }
452        }
453        #[automatically_derived]
454        impl From<&RevokeAnnouncement> for alloy_sol_types::private::LogData {
455            #[inline]
456            fn from(this: &RevokeAnnouncement) -> alloy_sol_types::private::LogData {
457                alloy_sol_types::SolEvent::encode_log_data(this)
458            }
459        }
460    };
461    ///Container for all the [`HoprAnnouncementsEvents`](self) events.
462    #[derive(serde::Serialize, serde::Deserialize)]
463    #[derive(Debug, PartialEq, Eq, Hash)]
464    pub enum HoprAnnouncementsEventsEvents {
465        #[allow(missing_docs)]
466        AddressAnnouncement(AddressAnnouncement),
467        #[allow(missing_docs)]
468        KeyBinding(KeyBinding),
469        #[allow(missing_docs)]
470        RevokeAnnouncement(RevokeAnnouncement),
471    }
472    #[automatically_derived]
473    impl HoprAnnouncementsEventsEvents {
474        /// All the selectors of this enum.
475        ///
476        /// Note that the selectors might not be in the same order as the variants.
477        /// No guarantees are made about the order of the selectors.
478        ///
479        /// Prefer using `SolInterface` methods instead.
480        pub const SELECTORS: &'static [[u8; 32usize]] = &[
481            [
482                164u8, 222u8, 48u8, 165u8, 40u8, 190u8, 202u8, 223u8, 130u8, 100u8,
483                157u8, 19u8, 149u8, 192u8, 227u8, 13u8, 209u8, 138u8, 227u8, 91u8, 90u8,
484                150u8, 206u8, 113u8, 233u8, 41u8, 91u8, 177u8, 75u8, 201u8, 243u8, 188u8,
485            ],
486            [
487                191u8, 73u8, 204u8, 212u8, 26u8, 65u8, 24u8, 199u8, 225u8, 231u8, 33u8,
488                67u8, 186u8, 216u8, 68u8, 229u8, 246u8, 237u8, 18u8, 191u8, 96u8, 202u8,
489                166u8, 66u8, 216u8, 141u8, 25u8, 202u8, 16u8, 36u8, 76u8, 54u8,
490            ],
491            [
492                196u8, 223u8, 91u8, 161u8, 104u8, 20u8, 131u8, 138u8, 178u8, 97u8, 136u8,
493                41u8, 214u8, 143u8, 134u8, 35u8, 187u8, 137u8, 115u8, 2u8, 242u8, 77u8,
494                189u8, 186u8, 34u8, 121u8, 219u8, 228u8, 90u8, 219u8, 61u8, 20u8,
495            ],
496        ];
497    }
498    #[automatically_derived]
499    impl alloy_sol_types::SolEventInterface for HoprAnnouncementsEventsEvents {
500        const NAME: &'static str = "HoprAnnouncementsEventsEvents";
501        const COUNT: usize = 3usize;
502        fn decode_raw_log(
503            topics: &[alloy_sol_types::Word],
504            data: &[u8],
505        ) -> alloy_sol_types::Result<Self> {
506            match topics.first().copied() {
507                Some(
508                    <AddressAnnouncement as alloy_sol_types::SolEvent>::SIGNATURE_HASH,
509                ) => {
510                    <AddressAnnouncement as alloy_sol_types::SolEvent>::decode_raw_log(
511                            topics,
512                            data,
513                        )
514                        .map(Self::AddressAnnouncement)
515                }
516                Some(<KeyBinding as alloy_sol_types::SolEvent>::SIGNATURE_HASH) => {
517                    <KeyBinding as alloy_sol_types::SolEvent>::decode_raw_log(
518                            topics,
519                            data,
520                        )
521                        .map(Self::KeyBinding)
522                }
523                Some(
524                    <RevokeAnnouncement as alloy_sol_types::SolEvent>::SIGNATURE_HASH,
525                ) => {
526                    <RevokeAnnouncement as alloy_sol_types::SolEvent>::decode_raw_log(
527                            topics,
528                            data,
529                        )
530                        .map(Self::RevokeAnnouncement)
531                }
532                _ => {
533                    alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog {
534                        name: <Self as alloy_sol_types::SolEventInterface>::NAME,
535                        log: alloy_sol_types::private::Box::new(
536                            alloy_sol_types::private::LogData::new_unchecked(
537                                topics.to_vec(),
538                                data.to_vec().into(),
539                            ),
540                        ),
541                    })
542                }
543            }
544        }
545    }
546    #[automatically_derived]
547    impl alloy_sol_types::private::IntoLogData for HoprAnnouncementsEventsEvents {
548        fn to_log_data(&self) -> alloy_sol_types::private::LogData {
549            match self {
550                Self::AddressAnnouncement(inner) => {
551                    alloy_sol_types::private::IntoLogData::to_log_data(inner)
552                }
553                Self::KeyBinding(inner) => {
554                    alloy_sol_types::private::IntoLogData::to_log_data(inner)
555                }
556                Self::RevokeAnnouncement(inner) => {
557                    alloy_sol_types::private::IntoLogData::to_log_data(inner)
558                }
559            }
560        }
561        fn into_log_data(self) -> alloy_sol_types::private::LogData {
562            match self {
563                Self::AddressAnnouncement(inner) => {
564                    alloy_sol_types::private::IntoLogData::into_log_data(inner)
565                }
566                Self::KeyBinding(inner) => {
567                    alloy_sol_types::private::IntoLogData::into_log_data(inner)
568                }
569                Self::RevokeAnnouncement(inner) => {
570                    alloy_sol_types::private::IntoLogData::into_log_data(inner)
571                }
572            }
573        }
574    }
575    use alloy::contract as alloy_contract;
576    /**Creates a new wrapper around an on-chain [`HoprAnnouncementsEvents`](self) contract instance.
577
578See the [wrapper's documentation](`HoprAnnouncementsEventsInstance`) for more details.*/
579    #[inline]
580    pub const fn new<
581        P: alloy_contract::private::Provider<N>,
582        N: alloy_contract::private::Network,
583    >(
584        address: alloy_sol_types::private::Address,
585        provider: P,
586    ) -> HoprAnnouncementsEventsInstance<P, N> {
587        HoprAnnouncementsEventsInstance::<P, N>::new(address, provider)
588    }
589    /**Deploys this contract using the given `provider` and constructor arguments, if any.
590
591Returns a new instance of the contract, if the deployment was successful.
592
593For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
594    #[inline]
595    pub fn deploy<
596        P: alloy_contract::private::Provider<N>,
597        N: alloy_contract::private::Network,
598    >(
599        provider: P,
600    ) -> impl ::core::future::Future<
601        Output = alloy_contract::Result<HoprAnnouncementsEventsInstance<P, N>>,
602    > {
603        HoprAnnouncementsEventsInstance::<P, N>::deploy(provider)
604    }
605    /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
606and constructor arguments, if any.
607
608This is a simple wrapper around creating a `RawCallBuilder` with the data set to
609the bytecode concatenated with the constructor's ABI-encoded arguments.*/
610    #[inline]
611    pub fn deploy_builder<
612        P: alloy_contract::private::Provider<N>,
613        N: alloy_contract::private::Network,
614    >(provider: P) -> alloy_contract::RawCallBuilder<P, N> {
615        HoprAnnouncementsEventsInstance::<P, N>::deploy_builder(provider)
616    }
617    /**A [`HoprAnnouncementsEvents`](self) instance.
618
619Contains type-safe methods for interacting with an on-chain instance of the
620[`HoprAnnouncementsEvents`](self) contract located at a given `address`, using a given
621provider `P`.
622
623If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
624documentation on how to provide it), the `deploy` and `deploy_builder` methods can
625be used to deploy a new instance of the contract.
626
627See the [module-level documentation](self) for all the available methods.*/
628    #[derive(Clone)]
629    pub struct HoprAnnouncementsEventsInstance<
630        P,
631        N = alloy_contract::private::Ethereum,
632    > {
633        address: alloy_sol_types::private::Address,
634        provider: P,
635        _network: ::core::marker::PhantomData<N>,
636    }
637    #[automatically_derived]
638    impl<P, N> ::core::fmt::Debug for HoprAnnouncementsEventsInstance<P, N> {
639        #[inline]
640        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
641            f.debug_tuple("HoprAnnouncementsEventsInstance")
642                .field(&self.address)
643                .finish()
644        }
645    }
646    /// Instantiation and getters/setters.
647    #[automatically_derived]
648    impl<
649        P: alloy_contract::private::Provider<N>,
650        N: alloy_contract::private::Network,
651    > HoprAnnouncementsEventsInstance<P, N> {
652        /**Creates a new wrapper around an on-chain [`HoprAnnouncementsEvents`](self) contract instance.
653
654See the [wrapper's documentation](`HoprAnnouncementsEventsInstance`) for more details.*/
655        #[inline]
656        pub const fn new(
657            address: alloy_sol_types::private::Address,
658            provider: P,
659        ) -> Self {
660            Self {
661                address,
662                provider,
663                _network: ::core::marker::PhantomData,
664            }
665        }
666        /**Deploys this contract using the given `provider` and constructor arguments, if any.
667
668Returns a new instance of the contract, if the deployment was successful.
669
670For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
671        #[inline]
672        pub async fn deploy(
673            provider: P,
674        ) -> alloy_contract::Result<HoprAnnouncementsEventsInstance<P, N>> {
675            let call_builder = Self::deploy_builder(provider);
676            let contract_address = call_builder.deploy().await?;
677            Ok(Self::new(contract_address, call_builder.provider))
678        }
679        /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
680and constructor arguments, if any.
681
682This is a simple wrapper around creating a `RawCallBuilder` with the data set to
683the bytecode concatenated with the constructor's ABI-encoded arguments.*/
684        #[inline]
685        pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<P, N> {
686            alloy_contract::RawCallBuilder::new_raw_deploy(
687                provider,
688                ::core::clone::Clone::clone(&BYTECODE),
689            )
690        }
691        /// Returns a reference to the address.
692        #[inline]
693        pub const fn address(&self) -> &alloy_sol_types::private::Address {
694            &self.address
695        }
696        /// Sets the address.
697        #[inline]
698        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
699            self.address = address;
700        }
701        /// Sets the address and returns `self`.
702        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
703            self.set_address(address);
704            self
705        }
706        /// Returns a reference to the provider.
707        #[inline]
708        pub const fn provider(&self) -> &P {
709            &self.provider
710        }
711    }
712    impl<P: ::core::clone::Clone, N> HoprAnnouncementsEventsInstance<&P, N> {
713        /// Clones the provider and returns a new instance with the cloned provider.
714        #[inline]
715        pub fn with_cloned_provider(self) -> HoprAnnouncementsEventsInstance<P, N> {
716            HoprAnnouncementsEventsInstance {
717                address: self.address,
718                provider: ::core::clone::Clone::clone(&self.provider),
719                _network: ::core::marker::PhantomData,
720            }
721        }
722    }
723    /// Function calls.
724    #[automatically_derived]
725    impl<
726        P: alloy_contract::private::Provider<N>,
727        N: alloy_contract::private::Network,
728    > HoprAnnouncementsEventsInstance<P, N> {
729        /// Creates a new call builder using this contract instance's provider and address.
730        ///
731        /// Note that the call can be any function call, not just those defined in this
732        /// contract. Prefer using the other methods for building type-safe contract calls.
733        pub fn call_builder<C: alloy_sol_types::SolCall>(
734            &self,
735            call: &C,
736        ) -> alloy_contract::SolCallBuilder<&P, C, N> {
737            alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
738        }
739    }
740    /// Event filters.
741    #[automatically_derived]
742    impl<
743        P: alloy_contract::private::Provider<N>,
744        N: alloy_contract::private::Network,
745    > HoprAnnouncementsEventsInstance<P, N> {
746        /// Creates a new event filter using this contract instance's provider and address.
747        ///
748        /// Note that the type can be any event, not just those defined in this contract.
749        /// Prefer using the other methods for building type-safe event filters.
750        pub fn event_filter<E: alloy_sol_types::SolEvent>(
751            &self,
752        ) -> alloy_contract::Event<&P, E, N> {
753            alloy_contract::Event::new_sol(&self.provider, &self.address)
754        }
755        ///Creates a new event filter for the [`AddressAnnouncement`] event.
756        pub fn AddressAnnouncement_filter(
757            &self,
758        ) -> alloy_contract::Event<&P, AddressAnnouncement, N> {
759            self.event_filter::<AddressAnnouncement>()
760        }
761        ///Creates a new event filter for the [`KeyBinding`] event.
762        pub fn KeyBinding_filter(&self) -> alloy_contract::Event<&P, KeyBinding, N> {
763            self.event_filter::<KeyBinding>()
764        }
765        ///Creates a new event filter for the [`RevokeAnnouncement`] event.
766        pub fn RevokeAnnouncement_filter(
767            &self,
768        ) -> alloy_contract::Event<&P, RevokeAnnouncement, N> {
769            self.event_filter::<RevokeAnnouncement>()
770        }
771    }
772}