Struct InvoiceBuilder
pub struct InvoiceBuilder<'a, S>where
    S: SigningPubkeyStrategy,{ /* private fields */ }Expand description
Builds a Bolt12Invoice from either:
- an 
InvoiceRequestfor the “offer to be paid” flow or - a 
Refundfor the “offer for money” flow. 
See module-level documentation for usage.
This is not exported to bindings users as builder patterns don’t map outside of move semantics.
Implementations§
§impl<'a> InvoiceBuilder<'a, ExplicitSigningPubkey>
 
impl<'a> InvoiceBuilder<'a, ExplicitSigningPubkey>
pub fn build(self) -> Result<UnsignedBolt12Invoice, Bolt12SemanticError>
pub fn build(self) -> Result<UnsignedBolt12Invoice, Bolt12SemanticError>
Builds an unsigned Bolt12Invoice after checking for valid semantics. It can be signed by
UnsignedBolt12Invoice::sign.
§impl<'a> InvoiceBuilder<'a, DerivedSigningPubkey>
 
impl<'a> InvoiceBuilder<'a, DerivedSigningPubkey>
pub fn build_and_sign<T>(
    self,
    secp_ctx: &Secp256k1<T>,
) -> Result<Bolt12Invoice, Bolt12SemanticError>where
    T: Signing,
pub fn build_and_sign<T>(
    self,
    secp_ctx: &Secp256k1<T>,
) -> Result<Bolt12Invoice, Bolt12SemanticError>where
    T: Signing,
Builds a signed Bolt12Invoice after checking for valid semantics.
§impl<'a, S> InvoiceBuilder<'a, S>where
    S: SigningPubkeyStrategy,
 
impl<'a, S> InvoiceBuilder<'a, S>where
    S: SigningPubkeyStrategy,
pub fn relative_expiry(self, relative_expiry_secs: u32) -> InvoiceBuilder<'a, S>
pub fn relative_expiry(self, relative_expiry_secs: u32) -> InvoiceBuilder<'a, S>
Sets the Bolt12Invoice::relative_expiry as seconds since Bolt12Invoice::created_at.
Any expiry that has already passed is valid and can be checked for using
Bolt12Invoice::is_expired.
Successive calls to this method will override the previous setting.
pub fn fallback_v0_p2wsh(
    self,
    script_hash: &WScriptHash,
) -> InvoiceBuilder<'a, S>
pub fn fallback_v0_p2wsh( self, script_hash: &WScriptHash, ) -> InvoiceBuilder<'a, S>
Adds a P2WSH address to Bolt12Invoice::fallbacks.
Successive calls to this method will add another address. Caller is responsible for not adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
pub fn fallback_v0_p2wpkh(
    self,
    pubkey_hash: &WPubkeyHash,
) -> InvoiceBuilder<'a, S>
pub fn fallback_v0_p2wpkh( self, pubkey_hash: &WPubkeyHash, ) -> InvoiceBuilder<'a, S>
Adds a P2WPKH address to Bolt12Invoice::fallbacks.
Successive calls to this method will add another address. Caller is responsible for not adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
pub fn fallback_v1_p2tr_tweaked(
    self,
    output_key: &TweakedPublicKey,
) -> InvoiceBuilder<'a, S>
pub fn fallback_v1_p2tr_tweaked( self, output_key: &TweakedPublicKey, ) -> InvoiceBuilder<'a, S>
Adds a P2TR address to Bolt12Invoice::fallbacks.
Successive calls to this method will add another address. Caller is responsible for not adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
pub fn allow_mpp(self) -> InvoiceBuilder<'a, S>
pub fn allow_mpp(self) -> InvoiceBuilder<'a, S>
Sets Bolt12Invoice::invoice_features to indicate MPP may be used. Otherwise, MPP is
disallowed.
Auto Trait Implementations§
impl<'a, S> Freeze for InvoiceBuilder<'a, S>where
    S: Freeze,
impl<'a, S> RefUnwindSafe for InvoiceBuilder<'a, S>where
    S: RefUnwindSafe,
impl<'a, S> Send for InvoiceBuilder<'a, S>where
    S: Send,
impl<'a, S> Sync for InvoiceBuilder<'a, S>where
    S: Sync,
impl<'a, S> Unpin for InvoiceBuilder<'a, S>where
    S: Unpin,
impl<'a, S> UnwindSafe for InvoiceBuilder<'a, S>where
    S: UnwindSafe,
Blanket Implementations§
§impl<T> AnySync for T
 
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
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
§impl<T> Downcast for Twhere
    T: AsAny + ?Sized,
 
impl<T> Downcast for Twhere
    T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
    T: AsAny,
 
fn downcast_ref<T>(&self) -> Option<&T>where
    T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
    T: AsAny,
 
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
    T: AsAny,
Any.§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> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
 
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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