Struct breez_sdk_liquid::lightning::offers::invoice::Bolt12Invoice
pub struct Bolt12Invoice { /* private fields */ }
Expand description
A Bolt12Invoice
is a payment request, typically corresponding to an Offer
or a Refund
.
An invoice may be sent in response to an InvoiceRequest
in the case of an offer or sent
directly after scanning a refund. It includes all the information needed to pay a recipient.
Implementations§
§impl Bolt12Invoice
impl Bolt12Invoice
pub fn description(&self) -> PrintableString<'_>
pub fn description(&self) -> PrintableString<'_>
A complete description of the purpose of the originating offer or refund. Intended to be displayed to the user but with the caveat that it has not been verified in any way.
pub fn payment_paths(&self) -> &[(BlindedPayInfo, BlindedPath)]
pub fn payment_paths(&self) -> &[(BlindedPayInfo, BlindedPath)]
Paths to the recipient originating from publicly reachable nodes, including information needed for routing payments across them.
Blinded paths provide recipient privacy by obfuscating its node id. Note, however, that this
privacy is lost if a public node id is used for Bolt12Invoice::signing_pubkey
.
This is not exported to bindings users as slices with non-reference types cannot be ABI matched in another language.
pub fn created_at(&self) -> Duration
pub fn created_at(&self) -> Duration
Duration since the Unix epoch when the invoice was created.
pub fn relative_expiry(&self) -> Duration
pub fn relative_expiry(&self) -> Duration
Duration since Bolt12Invoice::created_at
when the invoice has expired and therefore
should no longer be paid.
pub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Whether the invoice has expired.
pub fn payment_hash(&self) -> PaymentHash
pub fn payment_hash(&self) -> PaymentHash
SHA256 hash of the payment preimage that will be given in return for paying the invoice.
pub fn amount_msats(&self) -> u64
pub fn amount_msats(&self) -> u64
The minimum amount required for a successful payment of the invoice.
pub fn fallbacks(&self) -> Vec<Address>
pub fn fallbacks(&self) -> Vec<Address>
Fallback addresses for paying the invoice on-chain, in order of most-preferred to least-preferred.
pub fn signing_pubkey(&self) -> PublicKey
pub fn signing_pubkey(&self) -> PublicKey
The public key corresponding to the key used to sign the invoice.
pub fn signature(&self) -> Signature
pub fn signature(&self) -> Signature
Signature of the invoice verified using Bolt12Invoice::signing_pubkey
.
pub fn signable_hash(&self) -> [u8; 32]
pub fn signable_hash(&self) -> [u8; 32]
Hash that was used for signing the invoice.
pub fn verify<T>(&self, key: &ExpandedKey, secp_ctx: &Secp256k1<T>) -> boolwhere
T: Signing,
pub fn verify<T>(&self, key: &ExpandedKey, secp_ctx: &Secp256k1<T>) -> boolwhere
T: Signing,
Verifies that the invoice was for a request or refund created using the given key.
Trait Implementations§
§impl Clone for Bolt12Invoice
impl Clone for Bolt12Invoice
§fn clone(&self) -> Bolt12Invoice
fn clone(&self) -> Bolt12Invoice
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for Bolt12Invoice
impl Debug for Bolt12Invoice
§impl TryFrom<ParsedMessage<(PayerTlvStream, OfferTlvStream, InvoiceRequestTlvStream, InvoiceTlvStream, SignatureTlvStream)>> for Bolt12Invoice
impl TryFrom<ParsedMessage<(PayerTlvStream, OfferTlvStream, InvoiceRequestTlvStream, InvoiceTlvStream, SignatureTlvStream)>> for Bolt12Invoice
§type Error = Bolt12ParseError
type Error = Bolt12ParseError
§fn try_from(
invoice: ParsedMessage<(PayerTlvStream, OfferTlvStream, InvoiceRequestTlvStream, InvoiceTlvStream, SignatureTlvStream)>,
) -> Result<Bolt12Invoice, <Bolt12Invoice as TryFrom<ParsedMessage<(PayerTlvStream, OfferTlvStream, InvoiceRequestTlvStream, InvoiceTlvStream, SignatureTlvStream)>>>::Error>
fn try_from( invoice: ParsedMessage<(PayerTlvStream, OfferTlvStream, InvoiceRequestTlvStream, InvoiceTlvStream, SignatureTlvStream)>, ) -> Result<Bolt12Invoice, <Bolt12Invoice as TryFrom<ParsedMessage<(PayerTlvStream, OfferTlvStream, InvoiceRequestTlvStream, InvoiceTlvStream, SignatureTlvStream)>>>::Error>
§impl TryFrom<Vec<u8>> for Bolt12Invoice
impl TryFrom<Vec<u8>> for Bolt12Invoice
§type Error = Bolt12ParseError
type Error = Bolt12ParseError
§impl Writeable for Bolt12Invoice
impl Writeable for Bolt12Invoice
Auto Trait Implementations§
impl Freeze for Bolt12Invoice
impl RefUnwindSafe for Bolt12Invoice
impl Send for Bolt12Invoice
impl Sync for Bolt12Invoice
impl Unpin for Bolt12Invoice
impl UnwindSafe for Bolt12Invoice
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request