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)ChannelManagercan verify that the payment secret is valid when the invoice is paid. - create_
invoice_ from_ channelmanager_ and_ duration_ since_ epoch - See
create_invoice_from_channelmanagerThis version can be used in ano_stdenvironment, wherestd::time::SystemTimeis 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_epochThis version allows for providing a customPaymentHashfor 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)ChannelManagercan verify that the payment secret is valid when the invoice is paid. Use this variant if you want to pass thedescription_hashto the invoice. - create_
invoice_ from_ channelmanager_ with_ description_ hash_ and_ duration_ since_ epoch - See
create_invoice_from_channelmanager_with_description_hashThis version can be used in ano_stdenvironment, wherestd::time::SystemTimeis 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
PhantomKeysManagerfor 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
PhantomKeysManagerfor more information on phantom node payments.