pub struct ConfigurableAmountPaymentInstructions { /* private fields */ }Expand description
Parsed payment instructions representing a set of possible ways to pay a configurable quantity of Bitcoin, as well as some associated metadata.
Implementations§
Source§impl ConfigurableAmountPaymentInstructions
impl ConfigurableAmountPaymentInstructions
Sourcepub fn min_amt(&self) -> Option<Amount>
pub fn min_amt(&self) -> Option<Amount>
The minimum amount which the recipient will accept payment for, if provided as a part of the payment instructions.
Sourcepub fn max_amt(&self) -> Option<Amount>
pub fn max_amt(&self) -> Option<Amount>
The minimum amount which the recipient will accept payment for, if provided as a part of the payment instructions.
Sourcepub fn methods<'a>(
&'a self,
) -> impl Iterator<Item = PossiblyResolvedPaymentMethod<'a>>
pub fn methods<'a>( &'a self, ) -> impl Iterator<Item = PossiblyResolvedPaymentMethod<'a>>
The supported list of PossiblyResolvedPaymentMethod.
See PossiblyResolvedPaymentMethod::method_type for the specific payment protocol which
each payment method will ultimately resolve to.
Sourcepub async fn set_amount<R: HrnResolver>(
self,
amount: Amount,
resolver: &R,
) -> Result<FixedAmountPaymentInstructions, &'static str>
pub async fn set_amount<R: HrnResolver>( self, amount: Amount, resolver: &R, ) -> Result<FixedAmountPaymentInstructions, &'static str>
Resolve the configurable amount to a fixed amount and create a
FixedAmountPaymentInstructions.
May resolve LNURL-Pay instructions that were created from an LN-Address Human Readable
Name into a lightning Bolt11Invoice.
Note that for lightning BOLT 11 or BOLT 12 instructions, we cannot modify the invoice/offer
itself and thus cannot set a specific amount on the PaymentMethod::LightningBolt11 or
PaymentMethod::LightningBolt12 inner fields themselves. Still,
FixedAmountPaymentInstructions::ln_payment_amount will return the value provided in
amount.
Source§impl ConfigurableAmountPaymentInstructions
impl ConfigurableAmountPaymentInstructions
Sourcepub fn recipient_description(&self) -> Option<&str>
pub fn recipient_description(&self) -> Option<&str>
A recipient-provided description of the payment instructions.
This may be:
- the
labelormessageparameter in a BIP 321 bitcoin: URI - the
descriptionfield in a lightning BOLT 11 invoice - the
descriptionfield in a lightning BOLT 12 offer
Sourcepub fn pop_callback(&self) -> Option<&str>
pub fn pop_callback(&self) -> Option<&str>
Fetches the proof-of-payment callback URI.
Once a payment has been completed, the proof-of-payment (hex-encoded payment preimage for a lightning BOLT 11 invoice, raw transaction serialized in hex for on-chain payments, not-yet-defined for lightning BOLT 12 invoices) must be appended to this URI and the URI opened with the default system URI handler.
Sourcepub fn human_readable_name(&self) -> &Option<HumanReadableName>
pub fn human_readable_name(&self) -> &Option<HumanReadableName>
Fetches the HumanReadableName which was resolved, if the resolved payment instructions
were for a Human Readable Name.
Sourcepub fn bip_353_dnssec_proof(&self) -> &Option<Vec<u8>>
pub fn bip_353_dnssec_proof(&self) -> &Option<Vec<u8>>
Fetches the BIP 353 DNSSEC proof which was used to resolve these payment instructions, if they were resolved from a HumanReadable Name using BIP 353.
This proof should be included in any PSBT output (as type PSBT_OUT_DNSSEC_PROOF)
generated using these payment instructions.
It should also be stored to allow us to later prove that this payment was made to
Self::human_readable_name.
Trait Implementations§
Source§impl Clone for ConfigurableAmountPaymentInstructions
impl Clone for ConfigurableAmountPaymentInstructions
Source§fn clone(&self) -> ConfigurableAmountPaymentInstructions
fn clone(&self) -> ConfigurableAmountPaymentInstructions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl PartialEq for ConfigurableAmountPaymentInstructions
impl PartialEq for ConfigurableAmountPaymentInstructions
Source§fn eq(&self, other: &ConfigurableAmountPaymentInstructions) -> bool
fn eq(&self, other: &ConfigurableAmountPaymentInstructions) -> bool
self and other values to be equal, and is used by ==.impl Eq for ConfigurableAmountPaymentInstructions
impl StructuralPartialEq for ConfigurableAmountPaymentInstructions
Auto Trait Implementations§
impl Freeze for ConfigurableAmountPaymentInstructions
impl RefUnwindSafe for ConfigurableAmountPaymentInstructions
impl Send for ConfigurableAmountPaymentInstructions
impl Sync for ConfigurableAmountPaymentInstructions
impl Unpin for ConfigurableAmountPaymentInstructions
impl UnwindSafe for ConfigurableAmountPaymentInstructions
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.