pub struct UnsignedInvoiceRequest { /* private fields */ }
Expand description

A semantically valid InvoiceRequest that hasn’t been signed.

§Serialization

This is serialized as a TLV stream, which includes TLV records from the originating message. As such, it may include unknown, odd TLV records.

Implementations§

§

impl UnsignedInvoiceRequest

pub fn tagged_hash(&self) -> &TaggedHash

Returns the TaggedHash of the invoice to sign.

pub fn sign<F, E>(self, sign: F) -> Result<InvoiceRequest, SignError<E>>

Signs the TaggedHash of the invoice request using the given function.

Note: The hash computation may have included unknown, odd TLV records.

This is not exported to bindings users as functions are not yet mapped.

§

impl UnsignedInvoiceRequest

pub fn chains(&self) -> Vec<ChainHash>

The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet). Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats) for the selected chain.

pub fn metadata(&self) -> Option<&Vec<u8>>

Opaque bytes set by the originator. Useful for authentication and validating fields since it is reflected in invoice_request messages along with all the other fields from the offer.

pub fn amount(&self) -> Option<&Amount>

The minimum amount required for a successful payment of a single item.

pub fn description(&self) -> PrintableString<'_>

A complete description of the purpose of the payment. Intended to be displayed to the user but with the caveat that it has not been verified in any way.

pub fn offer_features(&self) -> &Features<OfferContext>

Features pertaining to the offer.

pub fn absolute_expiry(&self) -> Option<Duration>

Duration since the Unix epoch when an invoice should no longer be requested.

If None, the offer does not expire.

pub fn issuer(&self) -> Option<PrintableString<'_>>

The issuer of the offer, possibly beginning with user@domain or domain. Intended to be displayed to the user but with the caveat that it has not been verified in any way.

pub fn paths(&self) -> &[BlindedPath]

Paths to the recipient originating from publicly reachable nodes. Blinded paths provide recipient privacy by obfuscating its node id.

pub fn supported_quantity(&self) -> Quantity

The quantity of items supported.

pub fn signing_pubkey(&self) -> PublicKey

The public key used by the recipient to sign invoices.

pub fn payer_metadata(&self) -> &[u8]

An unpredictable series of bytes, typically containing information about the derivation of payer_id.

pub fn chain(&self) -> ChainHash

A chain from Offer::chains that the offer is valid for.

pub fn amount_msats(&self) -> Option<u64>

The amount to pay in msats (i.e., the minimum lightning-payable unit for chain), which must be greater than or equal to Offer::amount, converted if necessary.

pub fn invoice_request_features(&self) -> &Features<InvoiceRequestContext>

Features pertaining to requesting an invoice.

pub fn quantity(&self) -> Option<u64>

The quantity of the offer’s item conforming to Offer::is_valid_quantity.

pub fn payer_id(&self) -> PublicKey

A possibly transient pubkey used to sign the invoice request.

pub fn payer_note(&self) -> Option<PrintableString<'_>>

A payer-provided note which will be seen by the recipient and reflected back in the invoice response.

Trait Implementations§

§

impl AsRef<TaggedHash> for UnsignedInvoiceRequest

§

fn as_ref(&self) -> &TaggedHash

Converts this type into a shared reference of the (usually inferred) input type.
§

impl TryFrom<Vec<u8>> for UnsignedInvoiceRequest

§

type Error = Bolt12ParseError

The type returned in the event of a conversion error.
§

fn try_from( bytes: Vec<u8>, ) -> Result<UnsignedInvoiceRequest, <UnsignedInvoiceRequest as TryFrom<Vec<u8>>>::Error>

Performs the conversion.
§

impl Writeable for UnsignedInvoiceRequest

§

fn write<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Writer,

Writes self out to the given Writer.
§

fn encode(&self) -> Vec<u8>

Writes self out to a Vec<u8>.
§

fn serialized_length(&self) -> usize

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DartSafe for T

§

impl<T> TaskRetFutTrait for T
where T: Send,