Struct lnd_grpc_rust::lnrpc::Invoice
source · pub struct Invoice {Show 27 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,
pub payment_addr: Vec<u8>,
pub is_amp: bool,
pub amp_invoice_state: HashMap<String, AmpInvoiceState>,
}
Fields§
§memo: String
An 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. Note: Output only, don’t specify for creating an invoice.
value: i64
The value of this invoice in satoshis
The fields value and value_msat are mutually exclusive.
value_msat: i64
The value of this invoice in millisatoshis
The fields value and value_msat are mutually exclusive.
settled: bool
Whether this invoice has been fulfilled.
The field is deprecated. Use the state field instead (compare to SETTLED).
creation_date: i64
When this invoice was created. Measured in seconds since the unix epoch. Note: Output only, don’t specify for creating an invoice.
settle_date: i64
When this invoice was settled. Measured in seconds since the unix epoch. Note: Output only, don’t specify for creating an invoice.
payment_request: String
A 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. Note: Output only, don’t specify for creating an invoice.
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
Payment request expiry time in seconds. Default is 86400 (24 hours).
fallback_addr: String
Fallback on-chain address.
cltv_expiry: u64
Delta to use for the time-lock of the CLTV extended to the final hop.
route_hints: Vec<RouteHint>
Route hints that can each be individually used to assist in reaching the invoice’s destination.
private: bool
Whether this invoice should include routing hints for private channels. Note: When enabled, if value and value_msat are zero, a large number of hints with these channels can be included, which might not be desirable.
add_index: u64
The “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. Note: Output only, don’t specify for creating an invoice.
settle_index: u64
The “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. Note: Output only, don’t specify for creating an invoice.
amt_paid: i64
Deprecated, use amt_paid_sat or amt_paid_msat.
amt_paid_sat: i64
The amount that was accepted for this invoice, in satoshis. This will ONLY be set if this invoice has been settled or accepted. 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. Note: Output only, don’t specify for creating an invoice.
amt_paid_msat: i64
The amount that was accepted for this invoice, in millisatoshis. This will ONLY be set if this invoice has been settled or accepted. 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. Note: Output only, don’t specify for creating an invoice.
state: i32
The state the invoice is in. Note: Output only, don’t specify for creating an invoice.
htlcs: Vec<InvoiceHtlc>
List of HTLCs paying to this invoice [EXPERIMENTAL]. Note: Output only, don’t specify for creating an invoice.
features: HashMap<u32, Feature>
List of features advertised on the invoice. Note: Output only, don’t specify for creating an invoice.
is_keysend: bool
Indicates if this invoice was a spontaneous payment that arrived via keysend [EXPERIMENTAL]. Note: Output only, don’t specify for creating an invoice.
payment_addr: Vec<u8>
The payment address of this invoice. This value will be used in MPP payments, and also for newer invoices that always require the MPP payload for added end-to-end security. Note: Output only, don’t specify for creating an invoice.
is_amp: bool
Signals whether or not this is an AMP invoice.
amp_invoice_state: HashMap<String, AmpInvoiceState>
[EXPERIMENTAL]:
Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the given set ID. This field is always populated for AMP invoices, and can be used along side LookupInvoice to obtain the HTLC information related to a given sub-invoice. Note: Output only, don’t specify for creating an invoice.
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>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
.source§impl PartialEq for Invoice
impl PartialEq for Invoice
impl StructuralPartialEq for Invoice
Auto Trait Implementations§
impl RefUnwindSafe for Invoice
impl Send for Invoice
impl Sync for Invoice
impl Unpin 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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