diff --git a/cli/Cargo.lock b/cli/Cargo.lock
index 7b3921380..f27bc6475 100644
--- a/cli/Cargo.lock
+++ b/cli/Cargo.lock
@@ -3436,7 +3436,7 @@ dependencies = [
[[package]]
name = "sdk-common"
version = "0.6.2"
-source = "git+https://github.com/breez/breez-sdk?rev=e537feb8ed134bc3c7af5196e10a0a189dd36ac7#e537feb8ed134bc3c7af5196e10a0a189dd36ac7"
+source = "git+https://github.com/breez/breez-sdk?rev=f77208acd34d74b571388889e856444908c59a85#f77208acd34d74b571388889e856444908c59a85"
dependencies = [
"aes 0.8.4",
"anyhow",
diff --git a/lib/Cargo.lock b/lib/Cargo.lock
index e83aefc6b..557adfdbb 100644
--- a/lib/Cargo.lock
+++ b/lib/Cargo.lock
@@ -3530,7 +3530,7 @@ dependencies = [
[[package]]
name = "sdk-common"
version = "0.6.2"
-source = "git+https://github.com/breez/breez-sdk?rev=e537feb8ed134bc3c7af5196e10a0a189dd36ac7#e537feb8ed134bc3c7af5196e10a0a189dd36ac7"
+source = "git+https://github.com/breez/breez-sdk?rev=f77208acd34d74b571388889e856444908c59a85#f77208acd34d74b571388889e856444908c59a85"
dependencies = [
"aes 0.8.4",
"anyhow",
diff --git a/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h b/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h
index ced162528..2280a07d3 100644
--- a/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h
+++ b/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h
@@ -237,6 +237,18 @@ typedef struct wire_cst_send_destination {
union SendDestinationKind kind;
} wire_cst_send_destination;
+typedef struct wire_cst_ln_url_pay_request_data {
+ struct wire_cst_list_prim_u_8_strict *callback;
+ uint64_t min_sendable;
+ uint64_t max_sendable;
+ struct wire_cst_list_prim_u_8_strict *metadata_str;
+ uint16_t comment_allowed;
+ struct wire_cst_list_prim_u_8_strict *domain;
+ bool allows_nostr;
+ struct wire_cst_list_prim_u_8_strict *nostr_pubkey;
+ struct wire_cst_list_prim_u_8_strict *ln_address;
+} wire_cst_ln_url_pay_request_data;
+
typedef struct wire_cst_aes_success_action_data {
struct wire_cst_list_prim_u_8_strict *description;
struct wire_cst_list_prim_u_8_strict *ciphertext;
@@ -279,6 +291,8 @@ typedef struct wire_cst_success_action {
typedef struct wire_cst_prepare_ln_url_pay_response {
struct wire_cst_send_destination destination;
uint64_t fees_sat;
+ struct wire_cst_ln_url_pay_request_data data;
+ struct wire_cst_list_prim_u_8_strict *comment;
struct wire_cst_success_action *success_action;
} wire_cst_prepare_ln_url_pay_response;
@@ -316,18 +330,6 @@ typedef struct wire_cst_prepare_buy_bitcoin_request {
uint64_t amount_sat;
} wire_cst_prepare_buy_bitcoin_request;
-typedef struct wire_cst_ln_url_pay_request_data {
- struct wire_cst_list_prim_u_8_strict *callback;
- uint64_t min_sendable;
- uint64_t max_sendable;
- struct wire_cst_list_prim_u_8_strict *metadata_str;
- uint16_t comment_allowed;
- struct wire_cst_list_prim_u_8_strict *domain;
- bool allows_nostr;
- struct wire_cst_list_prim_u_8_strict *nostr_pubkey;
- struct wire_cst_list_prim_u_8_strict *ln_address;
-} wire_cst_ln_url_pay_request_data;
-
typedef struct wire_cst_prepare_ln_url_pay_request {
struct wire_cst_ln_url_pay_request_data data;
uint64_t amount_msat;
@@ -411,6 +413,62 @@ typedef struct wire_cst_binding_event_listener {
struct wire_cst_list_prim_u_8_strict *stream;
} wire_cst_binding_event_listener;
+typedef struct wire_cst_aes_success_action_data_decrypted {
+ struct wire_cst_list_prim_u_8_strict *description;
+ struct wire_cst_list_prim_u_8_strict *plaintext;
+} wire_cst_aes_success_action_data_decrypted;
+
+typedef struct wire_cst_AesSuccessActionDataResult_Decrypted {
+ struct wire_cst_aes_success_action_data_decrypted *data;
+} wire_cst_AesSuccessActionDataResult_Decrypted;
+
+typedef struct wire_cst_AesSuccessActionDataResult_ErrorStatus {
+ struct wire_cst_list_prim_u_8_strict *reason;
+} wire_cst_AesSuccessActionDataResult_ErrorStatus;
+
+typedef union AesSuccessActionDataResultKind {
+ struct wire_cst_AesSuccessActionDataResult_Decrypted Decrypted;
+ struct wire_cst_AesSuccessActionDataResult_ErrorStatus ErrorStatus;
+} AesSuccessActionDataResultKind;
+
+typedef struct wire_cst_aes_success_action_data_result {
+ int32_t tag;
+ union AesSuccessActionDataResultKind kind;
+} wire_cst_aes_success_action_data_result;
+
+typedef struct wire_cst_SuccessActionProcessed_Aes {
+ struct wire_cst_aes_success_action_data_result *result;
+} wire_cst_SuccessActionProcessed_Aes;
+
+typedef struct wire_cst_SuccessActionProcessed_Message {
+ struct wire_cst_message_success_action_data *data;
+} wire_cst_SuccessActionProcessed_Message;
+
+typedef struct wire_cst_SuccessActionProcessed_Url {
+ struct wire_cst_url_success_action_data *data;
+} wire_cst_SuccessActionProcessed_Url;
+
+typedef union SuccessActionProcessedKind {
+ struct wire_cst_SuccessActionProcessed_Aes Aes;
+ struct wire_cst_SuccessActionProcessed_Message Message;
+ struct wire_cst_SuccessActionProcessed_Url Url;
+} SuccessActionProcessedKind;
+
+typedef struct wire_cst_success_action_processed {
+ int32_t tag;
+ union SuccessActionProcessedKind kind;
+} wire_cst_success_action_processed;
+
+typedef struct wire_cst_ln_url_info {
+ struct wire_cst_list_prim_u_8_strict *ln_address;
+ struct wire_cst_list_prim_u_8_strict *lnurl_pay_comment;
+ struct wire_cst_list_prim_u_8_strict *lnurl_pay_domain;
+ struct wire_cst_list_prim_u_8_strict *lnurl_pay_metadata;
+ struct wire_cst_success_action_processed *lnurl_pay_success_action;
+ struct wire_cst_success_action *lnurl_pay_unprocessed_success_action;
+ struct wire_cst_list_prim_u_8_strict *lnurl_withdraw_endpoint;
+} wire_cst_ln_url_info;
+
typedef struct wire_cst_PaymentDetails_Lightning {
struct wire_cst_list_prim_u_8_strict *swap_id;
struct wire_cst_list_prim_u_8_strict *description;
@@ -418,6 +476,7 @@ typedef struct wire_cst_PaymentDetails_Lightning {
struct wire_cst_list_prim_u_8_strict *bolt11;
struct wire_cst_list_prim_u_8_strict *bolt12_offer;
struct wire_cst_list_prim_u_8_strict *payment_hash;
+ struct wire_cst_ln_url_info *lnurl_info;
struct wire_cst_list_prim_u_8_strict *refund_tx_id;
uint64_t *refund_tx_amount_sat;
} wire_cst_PaymentDetails_Lightning;
@@ -526,29 +585,6 @@ typedef struct wire_cst_connect_request {
struct wire_cst_list_prim_u_8_strict *mnemonic;
} wire_cst_connect_request;
-typedef struct wire_cst_aes_success_action_data_decrypted {
- struct wire_cst_list_prim_u_8_strict *description;
- struct wire_cst_list_prim_u_8_strict *plaintext;
-} wire_cst_aes_success_action_data_decrypted;
-
-typedef struct wire_cst_AesSuccessActionDataResult_Decrypted {
- struct wire_cst_aes_success_action_data_decrypted *data;
-} wire_cst_AesSuccessActionDataResult_Decrypted;
-
-typedef struct wire_cst_AesSuccessActionDataResult_ErrorStatus {
- struct wire_cst_list_prim_u_8_strict *reason;
-} wire_cst_AesSuccessActionDataResult_ErrorStatus;
-
-typedef union AesSuccessActionDataResultKind {
- struct wire_cst_AesSuccessActionDataResult_Decrypted Decrypted;
- struct wire_cst_AesSuccessActionDataResult_ErrorStatus ErrorStatus;
-} AesSuccessActionDataResultKind;
-
-typedef struct wire_cst_aes_success_action_data_result {
- int32_t tag;
- union AesSuccessActionDataResultKind kind;
-} wire_cst_aes_success_action_data_result;
-
typedef struct wire_cst_bitcoin_address_data {
struct wire_cst_list_prim_u_8_strict *address;
int32_t network;
@@ -566,29 +602,6 @@ typedef struct wire_cst_ln_url_pay_error_data {
struct wire_cst_list_prim_u_8_strict *reason;
} wire_cst_ln_url_pay_error_data;
-typedef struct wire_cst_SuccessActionProcessed_Aes {
- struct wire_cst_aes_success_action_data_result *result;
-} wire_cst_SuccessActionProcessed_Aes;
-
-typedef struct wire_cst_SuccessActionProcessed_Message {
- struct wire_cst_message_success_action_data *data;
-} wire_cst_SuccessActionProcessed_Message;
-
-typedef struct wire_cst_SuccessActionProcessed_Url {
- struct wire_cst_url_success_action_data *data;
-} wire_cst_SuccessActionProcessed_Url;
-
-typedef union SuccessActionProcessedKind {
- struct wire_cst_SuccessActionProcessed_Aes Aes;
- struct wire_cst_SuccessActionProcessed_Message Message;
- struct wire_cst_SuccessActionProcessed_Url Url;
-} SuccessActionProcessedKind;
-
-typedef struct wire_cst_success_action_processed {
- int32_t tag;
- union SuccessActionProcessedKind kind;
-} wire_cst_success_action_processed;
-
typedef struct wire_cst_ln_url_pay_success_data {
struct wire_cst_payment payment;
struct wire_cst_success_action_processed *success_action;
@@ -1237,6 +1250,8 @@ struct wire_cst_ln_url_auth_request_data *frbgen_breez_liquid_cst_new_box_autoad
struct wire_cst_ln_url_error_data *frbgen_breez_liquid_cst_new_box_autoadd_ln_url_error_data(void);
+struct wire_cst_ln_url_info *frbgen_breez_liquid_cst_new_box_autoadd_ln_url_info(void);
+
struct wire_cst_ln_url_pay_error_data *frbgen_breez_liquid_cst_new_box_autoadd_ln_url_pay_error_data(void);
struct wire_cst_ln_url_pay_request *frbgen_breez_liquid_cst_new_box_autoadd_ln_url_pay_request(void);
@@ -1345,6 +1360,7 @@ static int64_t dummy_method_to_enforce_bundling(void) {
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_offer);
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_auth_request_data);
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_error_data);
+ dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_info);
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_pay_error_data);
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_pay_request);
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_pay_request_data);
diff --git a/lib/bindings/langs/swift/Sources/BreezSDKLiquid/Task/SwapUpdated.swift b/lib/bindings/langs/swift/Sources/BreezSDKLiquid/Task/SwapUpdated.swift
index 49ea38709..fd70f715b 100644
--- a/lib/bindings/langs/swift/Sources/BreezSDKLiquid/Task/SwapUpdated.swift
+++ b/lib/bindings/langs/swift/Sources/BreezSDKLiquid/Task/SwapUpdated.swift
@@ -54,7 +54,7 @@ class SwapUpdatedTask : TaskProtocol {
switch details {
case let .bitcoin(swapId, _, _, _):
return swapId
- case let .lightning(swapId, _, _, _, _, _, _, _):
+ case let .lightning(swapId, _, _, _, _, _, _, _, _):
return swapId
default:
break
diff --git a/lib/bindings/src/breez_sdk_liquid.udl b/lib/bindings/src/breez_sdk_liquid.udl
index d9674047a..7b0f69f00 100644
--- a/lib/bindings/src/breez_sdk_liquid.udl
+++ b/lib/bindings/src/breez_sdk_liquid.udl
@@ -389,6 +389,8 @@ dictionary PrepareLnUrlPayRequest {
dictionary PrepareLnUrlPayResponse {
SendDestination destination;
u64 fees_sat;
+ LnUrlPayRequestData data;
+ string? comment = null;
SuccessAction? success_action = null;
};
@@ -538,9 +540,19 @@ interface GetPaymentRequest {
Lightning(string payment_hash);
};
+dictionary LnUrlInfo {
+ string? ln_address;
+ string? lnurl_pay_comment;
+ string? lnurl_pay_domain;
+ string? lnurl_pay_metadata;
+ SuccessActionProcessed? lnurl_pay_success_action;
+ SuccessAction? lnurl_pay_unprocessed_success_action;
+ string? lnurl_withdraw_endpoint;
+};
+
[Enum]
interface PaymentDetails {
- Lightning(string swap_id, string description, string? preimage, string? bolt11, string? bolt12_offer, string? payment_hash, string? refund_tx_id, u64? refund_tx_amount_sat);
+ Lightning(string swap_id, string description, string? preimage, string? bolt11, string? bolt12_offer, string? payment_hash, LnUrlInfo? lnurl_info, string? refund_tx_id, u64? refund_tx_amount_sat);
Liquid(string destination, string description);
Bitcoin(string swap_id, string description, string? refund_tx_id, u64? refund_tx_amount_sat);
};
diff --git a/lib/core/Cargo.toml b/lib/core/Cargo.toml
index f97c6ea3e..26af69232 100644
--- a/lib/core/Cargo.toml
+++ b/lib/core/Cargo.toml
@@ -32,7 +32,7 @@ lwk_wollet = { git = "https://github.com/dangeross/lwk", branch = "savage-full-s
#lwk_wollet = "0.7.0"
rusqlite = { version = "0.31", features = ["backup", "bundled"] }
rusqlite_migration = "1.0"
-sdk-common = { git = "https://github.com/breez/breez-sdk", rev = "e537feb8ed134bc3c7af5196e10a0a189dd36ac7", features = ["liquid"] }
+sdk-common = { git = "https://github.com/breez/breez-sdk", rev = "f77208acd34d74b571388889e856444908c59a85", features = ["liquid"] }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.116"
strum = "0.25"
diff --git a/lib/core/src/chain_swap.rs b/lib/core/src/chain_swap.rs
index 59a7704bf..09b95195b 100644
--- a/lib/core/src/chain_swap.rs
+++ b/lib/core/src/chain_swap.rs
@@ -485,7 +485,7 @@ impl ChainSwapHandler {
fees_sat: lockup_tx_fees_sat + swap.claim_fees_sat,
payment_type: PaymentType::Send,
is_confirmed: false,
- }, None, None)?;
+ }, None, false)?;
self.update_swap_info(&ChainSwapUpdate {
swap_id: id,
@@ -840,7 +840,7 @@ impl ChainSwapHandler {
is_confirmed: false,
},
None,
- None,
+ false,
)?;
Some(claim_tx_id.clone())
}
@@ -1320,9 +1320,8 @@ impl ChainSwapHandler {
#[cfg(test)]
mod tests {
- use std::collections::{HashMap, HashSet};
-
use anyhow::Result;
+ use std::collections::{HashMap, HashSet};
use crate::{
model::{
diff --git a/lib/core/src/frb_generated.rs b/lib/core/src/frb_generated.rs
index 620e3867e..7c4a00c1e 100644
--- a/lib/core/src/frb_generated.rs
+++ b/lib/core/src/frb_generated.rs
@@ -2989,6 +2989,30 @@ impl SseDecode for crate::bindings::LnUrlErrorData {
}
}
+impl SseDecode for crate::model::LnUrlInfo {
+ // Codec=Sse (Serialization based), see doc to use other codecs
+ fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
+ let mut var_lnAddress =