Update auto-generated bindings to include ln-transaction-sync
[ldk-c-bindings] / lightning-c-bindings / src / lightning_transaction_sync / mod.rs
1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
3 //
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.
8
9 //! Provides utilities for syncing LDK via the transaction-based [`Confirm`] interface.
10 //!
11 //! The provided synchronization clients need to be registered with a [`ChainMonitor`] via the
12 //! [`Filter`] interface. Then, the respective `fn sync` needs to be called with the [`Confirm`]
13 //! implementations to be synchronized, i.e., usually instances of [`ChannelManager`] and
14 //! [`ChainMonitor`].
15 //!
16 //! ## Features and Backend Support
17 //!
18 //!- `esplora-blocking` enables syncing against an Esplora backend based on a blocking client.
19 //!- `esplora-async` enables syncing against an Esplora backend based on an async client.
20 //!- `esplora-async-https` enables the async Esplora client with support for HTTPS.
21 //!
22 //! ## Version Compatibility
23 //!
24 //! Currently this crate is compatible with LDK version 0.0.114 and above using channels which were
25 //! created on LDK version 0.0.113 and above.
26 //!
27 //! ## Usage Example:
28 //!
29 //! ```ignore
30 //! let tx_sync = Arc::new(EsploraSyncClient::new(
31 //! \tesplora_server_url,
32 //! \tArc::clone(&some_logger),
33 //! ));
34 //!
35 //! let chain_monitor = Arc::new(ChainMonitor::new(
36 //! \tSome(Arc::clone(&tx_sync)),
37 //! \tArc::clone(&some_broadcaster),
38 //! \tArc::clone(&some_logger),
39 //! \tArc::clone(&some_fee_estimator),
40 //! \tArc::clone(&some_persister),
41 //! ));
42 //!
43 //! let channel_manager = Arc::new(ChannelManager::new(
44 //! \tArc::clone(&some_fee_estimator),
45 //! \tArc::clone(&chain_monitor),
46 //! \tArc::clone(&some_broadcaster),
47 //! \tArc::clone(&some_router),
48 //! \tArc::clone(&some_logger),
49 //! \tArc::clone(&some_entropy_source),
50 //! \tArc::clone(&some_node_signer),
51 //! \tArc::clone(&some_signer_provider),
52 //! \tuser_config,
53 //! \tchain_params,
54 //! ));
55 //!
56 //! let confirmables = vec![
57 //! \t&*channel_manager as &(dyn Confirm + Sync + Send),
58 //! \t&*chain_monitor as &(dyn Confirm + Sync + Send),
59 //! ];
60 //!
61 //! tx_sync.sync(confirmables).unwrap();
62 //! ```
63 //!
64 //! [`Confirm`]: lightning::chain::Confirm
65 //! [`Filter`]: lightning::chain::Filter
66 //! [`ChainMonitor`]: lightning::chain::chainmonitor::ChainMonitor
67 //! [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
68
69 use alloc::str::FromStr;
70 use alloc::string::String;
71 use core::ffi::c_void;
72 use core::convert::Infallible;
73 use bitcoin::hashes::Hash;
74 use crate::c_types::*;
75 #[cfg(feature="no-std")]
76 use alloc::{vec::Vec, boxed::Box};
77
78 pub mod esplora;
79 pub mod electrum;
80 pub mod error;
81 mod common {
82
83 use alloc::str::FromStr;
84 use alloc::string::String;
85 use core::ffi::c_void;
86 use core::convert::Infallible;
87 use bitcoin::hashes::Hash;
88 use crate::c_types::*;
89 #[cfg(feature="no-std")]
90 use alloc::{vec::Vec, boxed::Box};
91
92 }