Add support for paying to BOLT12 (#549)

Add support for paying to BOLT12
This commit is contained in:
ok300
2024-11-19 13:08:50 +00:00
committed by GitHub
parent 0750e2e0fd
commit fe1dc30917
33 changed files with 2944 additions and 203 deletions

View File

@@ -617,10 +617,11 @@ sealed class PaymentDetails with _$PaymentDetails {
/// In case of a Send swap, this is the preimage of the paid invoice (proof of payment).
String? preimage,
/// Represents the invoice associated with a payment
/// Represents the Bolt11 invoice associated with a payment
/// In the case of a Send payment, this is the invoice paid by the swapper
/// In the case of a Receive payment, this is the invoice paid by the user
String? bolt11,
String? bolt12Offer,
/// The payment hash of the invoice
String? paymentHash,
@@ -1007,7 +1008,7 @@ class PrepareRefundResponse {
/// An argument when calling [crate::sdk::LiquidSdk::prepare_send_payment].
class PrepareSendRequest {
/// The destination we intend to pay to.
/// Supports BIP21 URIs, BOLT11 invoices and Liquid addresses
/// Supports BIP21 URIs, BOLT11 invoices, BOLT12 offers and Liquid addresses
final String destination;
/// Should only be set when paying directly onchain or to a BIP21 URI
@@ -1263,6 +1264,10 @@ sealed class SendDestination with _$SendDestination {
const factory SendDestination.bolt11({
required LNInvoice invoice,
}) = SendDestination_Bolt11;
const factory SendDestination.bolt12({
required LNOffer offer,
required BigInt receiverAmountSat,
}) = SendDestination_Bolt12;
}
/// An argument when calling [crate::sdk::LiquidSdk::send_payment].