|
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, Router as LdkRouter};
|
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;
|
@@ -1037,7 +1037,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
|
1037 | 1037 | }
|
1038 | 1038 |
|
1039 | 1039 | /// Send a payment given an invoice.
|
1040 |
| - pub fn send_payment(&self, invoice: &Invoice) -> Result<PaymentHash, Error> { |
| 1040 | + pub fn send_payment(&self, invoice: &Bolt11Invoice) -> Result<PaymentHash, Error> { |
1041 | 1041 | let rt_lock = self.runtime.read().unwrap();
|
1042 | 1042 | if rt_lock.is_none() {
|
1043 | 1043 | return Err(Error::NotRunning);
|
@@ -1113,7 +1113,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
|
1113 | 1113 | /// This can be used to pay a so-called "zero-amount" invoice, i.e., an invoice that leaves the
|
1114 | 1114 | /// amount paid to be determined by the user.
|
1115 | 1115 | pub fn send_payment_using_amount(
|
1116 |
| - &self, invoice: &Invoice, amount_msat: u64, |
| 1116 | + &self, invoice: &Bolt11Invoice, amount_msat: u64, |
1117 | 1117 | ) -> Result<PaymentHash, Error> {
|
1118 | 1118 | let rt_lock = self.runtime.read().unwrap();
|
1119 | 1119 | if rt_lock.is_none() {
|
@@ -1297,7 +1297,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
|
1297 | 1297 | /// the actual payment. Note this is only useful if there likely is sufficient time for the
|
1298 | 1298 | /// probe to settle before sending out the actual payment, e.g., when waiting for user
|
1299 | 1299 | /// confirmation in a wallet UI.
|
1300 |
| - pub fn send_payment_probe(&self, invoice: &Invoice) -> Result<(), Error> { |
| 1300 | + pub fn send_payment_probe(&self, invoice: &Bolt11Invoice) -> Result<(), Error> { |
1301 | 1301 | let rt_lock = self.runtime.read().unwrap();
|
1302 | 1302 | if rt_lock.is_none() {
|
1303 | 1303 | return Err(Error::NotRunning);
|
@@ -1391,21 +1391,21 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
|
1391 | 1391 | /// given.
|
1392 | 1392 | pub fn receive_payment(
|
1393 | 1393 | &self, amount_msat: u64, description: &str, expiry_secs: u32,
|
1394 |
| - ) -> Result<Invoice, Error> { |
| 1394 | + ) -> Result<Bolt11Invoice, Error> { |
1395 | 1395 | self.receive_payment_inner(Some(amount_msat), description, expiry_secs)
|
1396 | 1396 | }
|
1397 | 1397 |
|
1398 | 1398 | /// Returns a payable invoice that can be used to request and receive a payment for which the
|
1399 | 1399 | /// amount is to be determined by the user, also known as a "zero-amount" invoice.
|
1400 | 1400 | pub fn receive_variable_amount_payment(
|
1401 | 1401 | &self, description: &str, expiry_secs: u32,
|
1402 |
| - ) -> Result<Invoice, Error> { |
| 1402 | + ) -> Result<Bolt11Invoice, Error> { |
1403 | 1403 | self.receive_payment_inner(None, description, expiry_secs)
|
1404 | 1404 | }
|
1405 | 1405 |
|
1406 | 1406 | fn receive_payment_inner(
|
1407 | 1407 | &self, amount_msat: Option<u64>, description: &str, expiry_secs: u32,
|
1408 |
| - ) -> Result<Invoice, Error> { |
| 1408 | + ) -> Result<Bolt11Invoice, Error> { |
1409 | 1409 | let currency = Currency::from(self.config.network);
|
1410 | 1410 | let keys_manager = Arc::clone(&self.keys_manager);
|
1411 | 1411 | let invoice = match lightning_invoice::utils::create_invoice_from_channelmanager(
|
|
0 commit comments