@@ -116,7 +116,7 @@ use crate::ln::channelmanager::PaymentId;
116
116
use crate :: ln:: features:: { BlindedHopFeatures , Bolt12InvoiceFeatures , InvoiceRequestFeatures , OfferFeatures } ;
117
117
use crate :: ln:: inbound_payment:: ExpandedKey ;
118
118
use crate :: ln:: msgs:: DecodeError ;
119
- use crate :: offers:: invoice_macros:: invoice_builder_methods_common;
119
+ use crate :: offers:: invoice_macros:: { invoice_accessors_common , invoice_builder_methods_common} ;
120
120
use crate :: offers:: invoice_request:: { INVOICE_REQUEST_PAYER_ID_TYPE , INVOICE_REQUEST_TYPES , IV_BYTES as INVOICE_REQUEST_IV_BYTES , InvoiceRequest , InvoiceRequestContents , InvoiceRequestTlvStream , InvoiceRequestTlvStreamRef } ;
121
121
use crate :: offers:: merkle:: { SignError , SignFn , SignatureTlvStream , SignatureTlvStreamRef , TaggedHash , TlvStream , WithoutSignatures , self } ;
122
122
use crate :: offers:: offer:: { Amount , OFFER_TYPES , OfferTlvStream , OfferTlvStreamRef , Quantity } ;
@@ -740,35 +740,6 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
740
740
$contents. payer_note( )
741
741
}
742
742
743
- /// Paths to the recipient originating from publicly reachable nodes, including information
744
- /// needed for routing payments across them.
745
- ///
746
- /// Blinded paths provide recipient privacy by obfuscating its node id. Note, however, that this
747
- /// privacy is lost if a public node id is used for [`Bolt12Invoice::signing_pubkey`].
748
- ///
749
- /// This is not exported to bindings users as slices with non-reference types cannot be ABI
750
- /// matched in another language.
751
- pub fn payment_paths( & $self) -> & [ ( BlindedPayInfo , BlindedPath ) ] {
752
- $contents. payment_paths( )
753
- }
754
-
755
- /// Duration since the Unix epoch when the invoice was created.
756
- pub fn created_at( & $self) -> Duration {
757
- $contents. created_at( )
758
- }
759
-
760
- /// Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
761
- /// should no longer be paid.
762
- pub fn relative_expiry( & $self) -> Duration {
763
- $contents. relative_expiry( )
764
- }
765
-
766
- /// Whether the invoice has expired.
767
- #[ cfg( feature = "std" ) ]
768
- pub fn is_expired( & $self) -> bool {
769
- $contents. is_expired( )
770
- }
771
-
772
743
/// SHA256 hash of the payment preimage that will be given in return for paying the invoice.
773
744
pub fn payment_hash( & $self) -> PaymentHash {
774
745
$contents. payment_hash( )
@@ -778,29 +749,15 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
778
749
pub fn amount_msats( & $self) -> u64 {
779
750
$contents. amount_msats( )
780
751
}
781
-
782
- /// Fallback addresses for paying the invoice on-chain, in order of most-preferred to
783
- /// least-preferred.
784
- pub fn fallbacks( & $self) -> Vec <Address > {
785
- $contents. fallbacks( )
786
- }
787
-
788
- /// Features pertaining to paying an invoice.
789
- pub fn invoice_features( & $self) -> & Bolt12InvoiceFeatures {
790
- $contents. features( )
791
- }
792
-
793
- /// The public key corresponding to the key used to sign the invoice.
794
- pub fn signing_pubkey( & $self) -> PublicKey {
795
- $contents. signing_pubkey( )
796
- }
797
752
} }
798
753
799
754
impl UnsignedBolt12Invoice {
755
+ invoice_accessors_common ! ( self , self . contents) ;
800
756
invoice_accessors ! ( self , self . contents) ;
801
757
}
802
758
803
759
impl Bolt12Invoice {
760
+ invoice_accessors_common ! ( self , self . contents) ;
804
761
invoice_accessors ! ( self , self . contents) ;
805
762
806
763
/// Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
0 commit comments