pub fn create_invoice_from_channelmanager<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>(
channelmanager: &ChannelManager<Signer, M, T, K, F, L>,
keys_manager: K,
logger: L,
network: Currency,
amt_msat: Option<u64>,
description: String,
invoice_expiry_delta_secs: u32
) -> Result<Invoice, SignOrCreationError<()>>where
M::Target: Watch<Signer>,
T::Target: BroadcasterInterface,
K::Target: KeysInterface<Signer = Signer>,
F::Target: FeeEstimator,
L::Target: Logger,
Available on crate feature
std
only.Expand description
Utility to construct an invoice. Generally, unless you want to do something like a custom
cltv_expiry, this is what you should be using to create an invoice. The reason being, this
method stores the invoice’s payment secret and preimage in ChannelManager
, so (a) the user
doesn’t have to store preimage/payment secret information and (b) ChannelManager
can verify
that the payment secret is valid when the invoice is paid.
invoice_expiry_delta_secs
describes the number of seconds that the invoice is valid for
in excess of the current time.