pub struct Invoice {Show 24 fields
pub memo: String,
pub r_preimage: Vec<u8>,
pub r_hash: Vec<u8>,
pub value: i64,
pub value_msat: i64,
pub settled: bool,
pub creation_date: i64,
pub settle_date: i64,
pub payment_request: String,
pub description_hash: Vec<u8>,
pub expiry: i64,
pub fallback_addr: String,
pub cltv_expiry: u64,
pub route_hints: Vec<RouteHint>,
pub private: bool,
pub add_index: u64,
pub settle_index: u64,
pub amt_paid: i64,
pub amt_paid_sat: i64,
pub amt_paid_msat: i64,
pub state: i32,
pub htlcs: Vec<InvoiceHtlc>,
pub features: HashMap<u32, Feature>,
pub is_keysend: bool,
}Fields§
§memo: StringAn optional memo to attach along with the invoice. Used for record keeping purposes for the invoice’s creator, and will also be set in the description field of the encoded payment request if the description_hash field is not being used.
r_preimage: Vec<u8>The hex-encoded preimage (32 byte) which will allow settling an incoming HTLC payable to this preimage. When using REST, this field must be encoded as base64.
r_hash: Vec<u8>The hash of the preimage. When using REST, this field must be encoded as base64.
value: i64The value of this invoice in satoshis
The fields value and value_msat are mutually exclusive.
value_msat: i64The value of this invoice in millisatoshis
The fields value and value_msat are mutually exclusive.
settled: bool§creation_date: i64§settle_date: i64§payment_request: StringA bare-bones invoice for a payment within the Lightning Network. With the details of the invoice, the sender has all the data necessary to send a payment to the recipient.
description_hash: Vec<u8>Hash (SHA-256) of a description of the payment. Used if the description of payment (memo) is too long to naturally fit within the description field of an encoded payment request. When using REST, this field must be encoded as base64.
expiry: i64§fallback_addr: String§cltv_expiry: u64§route_hints: Vec<RouteHint>Route hints that can each be individually used to assist in reaching the invoice’s destination.
private: bool§add_index: u64The “add” index of this invoice. Each newly created invoice will increment this index making it monotonically increasing. Callers to the SubscribeInvoices call can use this to instantly get notified of all added invoices with an add_index greater than this one.
settle_index: u64The “settle” index of this invoice. Each newly settled invoice will increment this index making it monotonically increasing. Callers to the SubscribeInvoices call can use this to instantly get notified of all settled invoices with an settle_index greater than this one.
amt_paid: i64§amt_paid_sat: i64The amount that was accepted for this invoice, in satoshis. This will ONLY be set if this invoice has been settled. We provide this field as if the invoice was created with a zero value, then we need to record what amount was ultimately accepted. Additionally, it’s possible that the sender paid MORE that was specified in the original invoice. So we’ll record that here as well.
amt_paid_msat: i64The amount that was accepted for this invoice, in millisatoshis. This will ONLY be set if this invoice has been settled. We provide this field as if the invoice was created with a zero value, then we need to record what amount was ultimately accepted. Additionally, it’s possible that the sender paid MORE that was specified in the original invoice. So we’ll record that here as well.
state: i32The state the invoice is in.
htlcs: Vec<InvoiceHtlc>§features: HashMap<u32, Feature>§is_keysend: boolIndicates if this invoice was a spontaneous payment that arrived via keysend [EXPERIMENTAL].
Implementations§
Source§impl Invoice
impl Invoice
Sourcepub fn state(&self) -> InvoiceState
pub fn state(&self) -> InvoiceState
Returns the enum value of state, or the default if the field is set to an invalid enum value.
Sourcepub fn set_state(&mut self, value: InvoiceState)
pub fn set_state(&mut self, value: InvoiceState)
Sets state to the provided enum value.
Trait Implementations§
Source§impl Message for Invoice
impl Message for Invoice
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.impl StructuralPartialEq for Invoice
Auto Trait Implementations§
impl Freeze for Invoice
impl RefUnwindSafe for Invoice
impl Send for Invoice
impl Sync for Invoice
impl Unpin for Invoice
impl UnsafeUnpin for Invoice
impl UnwindSafe for Invoice
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§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