1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
4 // This file is licensed under the license available in the LICENSE or LICENSE.md
5 // file in the root of this repository or, if no such file exists, the same
6 // license as that which applies to the original source files from which this
7 // source was automatically generated.
9 //! High level lightning structs and impls live here.
11 //! You probably want to create a [`ChannelManager`], and a [`P2PGossipSync`] first.
12 //! Then, you probably want to pass them both on to a peer_handler::PeerManager and use that to
13 //! create/manage connections and call get_and_clear_pending_events after each action, handling
14 //! them appropriately.
16 //! When you want to open/close a channel or send a payment, call into your [`ChannelManager`] and
17 //! when you want to learn things about the network topology (eg get a route for sending a payment),
18 //! call into your [`P2PGossipSync`].
20 //! [`ChannelManager`]: channelmanager::ChannelManager
21 //! [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
23 use alloc::str::FromStr;
24 use core::ffi::c_void;
25 use core::convert::Infallible;
26 use bitcoin::hashes::Hash;
27 use crate::c_types::*;
28 #[cfg(feature="no-std")]
29 use alloc::{vec::Vec, boxed::Box};
31 pub mod channelmanager;
32 pub mod inbound_payment;
38 pub mod outbound_payment;
40 mod peer_channel_encryptor {
42 use alloc::str::FromStr;
43 use core::ffi::c_void;
44 use core::convert::Infallible;
45 use bitcoin::hashes::Hash;
46 use crate::c_types::*;
47 #[cfg(feature="no-std")]
48 use alloc::{vec::Vec, boxed::Box};
53 use alloc::str::FromStr;
54 use core::ffi::c_void;
55 use core::convert::Infallible;
56 use bitcoin::hashes::Hash;
57 use crate::c_types::*;
58 #[cfg(feature="no-std")]
59 use alloc::{vec::Vec, boxed::Box};
64 use alloc::str::FromStr;
65 use core::ffi::c_void;
66 use core::convert::Infallible;
67 use bitcoin::hashes::Hash;
68 use crate::c_types::*;
69 #[cfg(feature="no-std")]
70 use alloc::{vec::Vec, boxed::Box};