pub enum AsyncPaymentsContext {
OfferPathsRequest {
recipient_id: Vec<u8>,
path_absolute_expiry: Option<Duration>,
},
OfferPaths {
invoice_slot: u16,
path_absolute_expiry: Duration,
},
ServeStaticInvoice {
recipient_id: Vec<u8>,
invoice_slot: u16,
path_absolute_expiry: Duration,
},
StaticInvoicePersisted {
offer_id: OfferId,
invoice_created_at: Duration,
},
OutboundPayment {
payment_id: PaymentId,
},
InboundPayment {
path_absolute_expiry: Duration,
},
ReleaseHeldHtlc {
intercept_id: InterceptId,
prev_outbound_scid_alias: u64,
htlc_id: u64,
},
}Expand description
Contains data specific to an AsyncPaymentsMessage.
Variants§
OfferPathsRequest
Context used by a BlindedMessagePath provided out-of-band to an async recipient, where the
context is provided back to the static invoice server in corresponding OfferPathsRequests.
Fields
recipient_id: Vec<u8>An identifier for the async recipient that is requesting blinded paths to include in their
Offer::paths. This ID will be surfaced when the async recipient eventually sends a
corresponding ServeStaticInvoice message, and can be used to rate limit the recipient.
OfferPaths
Context used by a reply path to an OfferPathsRequest, provided back to us as an async
recipient in corresponding OfferPaths messages from the static invoice server.
Fields
invoice_slot: u16The “slot” in the static invoice server’s database that the invoice corresponding to these
offer paths should go into, originally set by us in OfferPathsRequest::invoice_slot. This
value allows us as the recipient to replace a specific invoice that is stored by the server,
which is useful for limiting the number of invoices stored by the server while also keeping
all the invoices persisted with the server fresh.
path_absolute_expiry: DurationThe time as duration since the Unix epoch at which this path expires and messages sent over it should be ignored.
This avoids the situation where the OfferPaths message is very delayed and thus
outdated.
ServeStaticInvoice
Context used by a reply path to an OfferPaths message, provided back to us as the static
invoice server in corresponding ServeStaticInvoice messages.
Fields
recipient_id: Vec<u8>An identifier for the async recipient that is requesting that a StaticInvoice be served
on their behalf.
Useful when surfaced alongside the below invoice_slot when payers send an
InvoiceRequest, to pull the specific static invoice from the database.
Also useful to rate limit the invoices being persisted on behalf of a particular recipient.
This id will be provided back to us as the static invoice server via
OffersContext::StaticInvoiceRequested::recipient_id.
invoice_slot: u16The slot number for the specific StaticInvoice that the recipient is requesting be
served on their behalf. Useful when surfaced alongside the above recipient_id when payers
send an InvoiceRequest, to pull the specific static invoice from the database. This id
will be provided back to us as the static invoice server via
OffersContext::StaticInvoiceRequested::invoice_slot.
StaticInvoicePersisted
Context used by a reply path to a ServeStaticInvoice message, provided back to us in
corresponding StaticInvoicePersisted messages.
Fields
offer_id: OfferIdThe id of the offer in the cache corresponding to the StaticInvoice that has been
persisted. This invoice is now ready to be provided by the static invoice server in response
to InvoiceRequests, so the corresponding offer can be marked as ready to receive
payments.
OutboundPayment
Context contained within the reply BlindedMessagePath we put in outbound
HeldHtlcAvailable messages, provided back to us in corresponding ReleaseHeldHtlc
messages if we are an always-online sender paying an async recipient.
Fields
InboundPayment
Context contained within the BlindedMessagePaths we put in static invoices, provided back
to us in corresponding HeldHtlcAvailable messages.
Fields
ReleaseHeldHtlc
Context contained within the reply BlindedMessagePath put in outbound
HeldHtlcAvailable messages, provided back to the async sender’s always-online counterparty
in corresponding ReleaseHeldHtlc messages.
Fields
intercept_id: InterceptIdAn identifier for the HTLC that should be released by us as the sender’s always-online channel counterparty to the often-offline recipient.
prev_outbound_scid_alias: u64The short channel id alias corresponding to the to-be-released inbound HTLC, to help locate
the HTLC internally if the ReleaseHeldHtlc races our node decoding the held HTLC’s
onion.
We use the outbound scid alias because it is stable even if the channel splices, unlike regular short channel ids.
htlc_id: u64The id of the to-be-released HTLC, to help locate the HTLC internally if the
ReleaseHeldHtlc races our node decoding the held HTLC’s onion.
Trait Implementations§
Source§impl Clone for AsyncPaymentsContext
impl Clone for AsyncPaymentsContext
Source§fn clone(&self) -> AsyncPaymentsContext
fn clone(&self) -> AsyncPaymentsContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AsyncPaymentsContext
impl Debug for AsyncPaymentsContext
Source§impl Readable for AsyncPaymentsContext
impl Readable for AsyncPaymentsContext
Source§impl Writeable for AsyncPaymentsContext
impl Writeable for AsyncPaymentsContext
Auto Trait Implementations§
impl Freeze for AsyncPaymentsContext
impl RefUnwindSafe for AsyncPaymentsContext
impl Send for AsyncPaymentsContext
impl Sync for AsyncPaymentsContext
impl Unpin for AsyncPaymentsContext
impl UnwindSafe for AsyncPaymentsContext
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<T> LengthReadable for Twhere
T: Readable,
impl<T> LengthReadable for Twhere
T: Readable,
Source§fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
Self in from the given LengthLimitedRead.