pub struct FixedAmountPaymentInstructions { /* private fields */ }
Expand description
Parsed payment instructions representing a set of possible ways to pay a fixed quantity to a recipient, as well as some associated metadata.
Implementations§
Source§impl FixedAmountPaymentInstructions
impl FixedAmountPaymentInstructions
Sourcepub fn max_amount(&self) -> Option<Amount>
pub fn max_amount(&self) -> Option<Amount>
The maximum amount any payment instruction requires payment for.
If None
, the only available payment method requires payment in a currency other than
sats, requiring currency conversion to determine the amount required.
Note that we may allow different Self::methods
to have slightly different amounts (e.g.
if a recipient wishes to be paid more for on-chain payments to offset their future fees),
but only up to MAX_AMOUNT_DIFFERENCE
.
Sourcepub fn ln_payment_amount(&self) -> Option<Amount>
pub fn ln_payment_amount(&self) -> Option<Amount>
The amount which the payment instruction requires payment for when paid over lightning.
We require that all lightning payment methods in payment instructions require an identical
amount for payment, and thus if this method returns None
it indicates either:
- no lightning payment instructions exist,
- the only lightning payment instructions are for a BOLT 12 offer denominated in a non-Bitcoin currency.
Note that if this object was built by resolving a ConfigurableAmountPaymentInstructions
with set_amount
on a lightning BOLT 11 or BOLT 12 invoice-containing instruction, this
will return Some
but the Self::methods
with PaymentMethod::LightningBolt11
or
PaymentMethod::LightningBolt12
may still contain instructions without amounts.
Sourcepub fn onchain_payment_amount(&self) -> Option<Amount>
pub fn onchain_payment_amount(&self) -> Option<Amount>
The amount which the payment instruction requires payment for when paid on-chain.
Will return None
if no on-chain payment instructions are available.
There is no way to encode different payment amounts for multiple on-chain formats
currently, and as such all on-chain PaymentMethod
s are for the same amount.
Sourcepub fn methods(&self) -> &[PaymentMethod]
pub fn methods(&self) -> &[PaymentMethod]
The list of PaymentMethod
s.
Source§impl FixedAmountPaymentInstructions
impl FixedAmountPaymentInstructions
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
label
ormessage
parameter in a BIP 321 bitcoin: URI - the
description
field in a lightning BOLT 11 invoice - the
description
field 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 FixedAmountPaymentInstructions
impl Clone for FixedAmountPaymentInstructions
Source§fn clone(&self) -> FixedAmountPaymentInstructions
fn clone(&self) -> FixedAmountPaymentInstructions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl PartialEq for FixedAmountPaymentInstructions
impl PartialEq for FixedAmountPaymentInstructions
Source§fn eq(&self, other: &FixedAmountPaymentInstructions) -> bool
fn eq(&self, other: &FixedAmountPaymentInstructions) -> bool
self
and other
values to be equal, and is used by ==
.impl Eq for FixedAmountPaymentInstructions
impl StructuralPartialEq for FixedAmountPaymentInstructions
Auto Trait Implementations§
impl Freeze for FixedAmountPaymentInstructions
impl RefUnwindSafe for FixedAmountPaymentInstructions
impl Send for FixedAmountPaymentInstructions
impl Sync for FixedAmountPaymentInstructions
impl Unpin for FixedAmountPaymentInstructions
impl UnwindSafe for FixedAmountPaymentInstructions
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.