Module utils

Expand description

Convenient utilities to create an invoice.

Functions§

create_invoice_from_channelmanager
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.
create_invoice_from_channelmanager_and_duration_since_epoch
See create_invoice_from_channelmanager This version can be used in a no_std environment, where std::time::SystemTime is not available and the current time is supplied by the caller.
create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash
See create_invoice_from_channelmanager_and_duration_since_epoch This version allows for providing a custom PaymentHash for the invoice. This may be useful if you’re building an on-chain swap or involving another protocol where the payment hash is also involved outside the scope of lightning.
create_invoice_from_channelmanager_with_description_hash
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. Use this variant if you want to pass the description_hash to the invoice.
create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch
See create_invoice_from_channelmanager_with_description_hash This version can be used in a no_std environment, where std::time::SystemTime is not available and the current time is supplied by the caller.
create_phantom_invoice
Utility to create an invoice that can be paid to one of multiple nodes, or a “phantom invoice.” See PhantomKeysManager for more information on phantom node payments.
create_phantom_invoice_with_description_hash
Utility to create an invoice that can be paid to one of multiple nodes, or a “phantom invoice.” See PhantomKeysManager for more information on phantom node payments.