1#[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 #[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 #[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 #[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 #[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 #[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 #[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 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 #[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 #[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 #[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 #[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 #[automatically_derived]
648 impl<
649 P: alloy_contract::private::Provider<N>,
650 N: alloy_contract::private::Network,
651 > HoprAnnouncementsEventsInstance<P, N> {
652 #[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 #[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 #[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 #[inline]
693 pub const fn address(&self) -> &alloy_sol_types::private::Address {
694 &self.address
695 }
696 #[inline]
698 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
699 self.address = address;
700 }
701 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
703 self.set_address(address);
704 self
705 }
706 #[inline]
708 pub const fn provider(&self) -> &P {
709 &self.provider
710 }
711 }
712 impl<P: ::core::clone::Clone, N> HoprAnnouncementsEventsInstance<&P, N> {
713 #[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 #[automatically_derived]
725 impl<
726 P: alloy_contract::private::Provider<N>,
727 N: alloy_contract::private::Network,
728 > HoprAnnouncementsEventsInstance<P, N> {
729 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 #[automatically_derived]
742 impl<
743 P: alloy_contract::private::Provider<N>,
744 N: alloy_contract::private::Network,
745 > HoprAnnouncementsEventsInstance<P, N> {
746 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 pub fn AddressAnnouncement_filter(
757 &self,
758 ) -> alloy_contract::Event<&P, AddressAnnouncement, N> {
759 self.event_filter::<AddressAnnouncement>()
760 }
761 pub fn KeyBinding_filter(&self) -> alloy_contract::Event<&P, KeyBinding, N> {
763 self.event_filter::<KeyBinding>()
764 }
765 pub fn RevokeAnnouncement_filter(
767 &self,
768 ) -> alloy_contract::Event<&P, RevokeAnnouncement, N> {
769 self.event_filter::<RevokeAnnouncement>()
770 }
771 }
772}