|
27 | 27 | //!
|
28 | 28 | //! ```no_run
|
29 | 29 | //! use ldk_node::{Builder, NetAddress};
|
30 |
| -//! use ldk_node::lightning_invoice::Invoice; |
| 30 | +//! use ldk_node::lightning_invoice::Bolt11Invoice; |
31 | 31 | //! use ldk_node::bitcoin::secp256k1::PublicKey;
|
32 | 32 | //! use ldk_node::bitcoin::Network;
|
33 | 33 | //! use std::str::FromStr;
|
|
54 | 54 | //! println!("EVENT: {:?}", event);
|
55 | 55 | //! node.event_handled();
|
56 | 56 | //!
|
57 |
| -//! let invoice = Invoice::from_str("INVOICE_STR").unwrap(); |
| 57 | +//! let invoice = Bolt11Invoice::from_str("INVOICE_STR").unwrap(); |
58 | 58 | //! node.send_payment(&invoice).unwrap();
|
59 | 59 | //!
|
60 | 60 | //! node.stop().unwrap();
|
@@ -137,7 +137,7 @@ use lightning_background_processor::process_events_async;
|
137 | 137 | use lightning_transaction_sync::EsploraSyncClient;
|
138 | 138 |
|
139 | 139 | use lightning::routing::router::{PaymentParameters, RouteParameters};
|
140 |
| -use lightning_invoice::{payment, Currency, Invoice}; |
| 140 | +use lightning_invoice::{payment, Bolt11Invoice, Currency}; |
141 | 141 |
|
142 | 142 | use bitcoin::hashes::sha256::Hash as Sha256;
|
143 | 143 | use bitcoin::hashes::Hash;
|
@@ -1036,7 +1036,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
|
1036 | 1036 | }
|
1037 | 1037 |
|
1038 | 1038 | /// Send a payement given an invoice.
|
1039 |
| - pub fn send_payment(&self, invoice: &Invoice) -> Result<PaymentHash, Error> { |
| 1039 | + pub fn send_payment(&self, invoice: &Bolt11Invoice) -> Result<PaymentHash, Error> { |
1040 | 1040 | let rt_lock = self.runtime.read().unwrap();
|
1041 | 1041 | if rt_lock.is_none() {
|
1042 | 1042 | return Err(Error::NotRunning);
|
@@ -1112,7 +1112,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
|
1112 | 1112 | /// This can be used to pay a so-called "zero-amount" invoice, i.e., an invoice that leaves the
|
1113 | 1113 | /// amount paid to be determined by the user.
|
1114 | 1114 | pub fn send_payment_using_amount(
|
1115 |
| - &self, invoice: &Invoice, amount_msat: u64, |
| 1115 | + &self, invoice: &Bolt11Invoice, amount_msat: u64, |
1116 | 1116 | ) -> Result<PaymentHash, Error> {
|
1117 | 1117 | let rt_lock = self.runtime.read().unwrap();
|
1118 | 1118 | if rt_lock.is_none() {
|
@@ -1294,21 +1294,21 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
|
1294 | 1294 | /// given.
|
1295 | 1295 | pub fn receive_payment(
|
1296 | 1296 | &self, amount_msat: u64, description: &str, expiry_secs: u32,
|
1297 |
| - ) -> Result<Invoice, Error> { |
| 1297 | + ) -> Result<Bolt11Invoice, Error> { |
1298 | 1298 | self.receive_payment_inner(Some(amount_msat), description, expiry_secs)
|
1299 | 1299 | }
|
1300 | 1300 |
|
1301 | 1301 | /// Returns a payable invoice that can be used to request and receive a payment for which the
|
1302 | 1302 | /// amount is to be determined by the user, also known as a "zero-amount" invoice.
|
1303 | 1303 | pub fn receive_variable_amount_payment(
|
1304 | 1304 | &self, description: &str, expiry_secs: u32,
|
1305 |
| - ) -> Result<Invoice, Error> { |
| 1305 | + ) -> Result<Bolt11Invoice, Error> { |
1306 | 1306 | self.receive_payment_inner(None, description, expiry_secs)
|
1307 | 1307 | }
|
1308 | 1308 |
|
1309 | 1309 | fn receive_payment_inner(
|
1310 | 1310 | &self, amount_msat: Option<u64>, description: &str, expiry_secs: u32,
|
1311 |
| - ) -> Result<Invoice, Error> { |
| 1311 | + ) -> Result<Bolt11Invoice, Error> { |
1312 | 1312 | let currency = Currency::from(self.config.network);
|
1313 | 1313 | let keys_manager = Arc::clone(&self.keys_manager);
|
1314 | 1314 | let invoice = match lightning_invoice::utils::create_invoice_from_channelmanager(
|
|
0 commit comments