Skip to content

Releases: getlipa/lipa-lightning-lib

v0.72.0-beta

25 Nov 16:30
95f4491
Compare
Choose a tag to compare

What's Changed

  • Use longer lived lsp fee offers for redeeming by @gcomte in #1273
  • Bump breez-sdk-core from 0.6.2 to 0.6.4 by @dependabot in #1278
  • Periodically check storage for payment in notification handling by @andrei-21 in #1279

UDL Changes

@@ -326,6 +326,9 @@ interface Swap {
     [Throws=SwapError]
     SwapAddressInfo create(OpeningFeeParams? lsp_fee_params);
 
+    [Throws=LnError]
+    CalculateLspFeeResponse calculate_lsp_fee_for_amount(u64 amount_sat);
+
     [Throws=LnError]
     OnchainResolvingFees? determine_resolving_fees(FailedSwapInfo failed_swap_info);

Full Changelog: v0.71.0-beta...v0.72.0-beta

v0.71.0-beta

21 Nov 15:24
ddf7b3f
Compare
Choose a tag to compare

What's Changed

UDL Changes:

index a203cb4..482baef 100644
--- a/src/lipalightninglib.udl
+++ b/src/lipalightninglib.udl
@@ -139,7 +139,7 @@ interface LightningNode {
     ResolveFailedSwapInfo prepare_resolve_failed_swap(FailedSwapInfo failed_swap_info, string to_address, u32 onchain_fee_rate);
 
     [Throws=LnError]
-    string swap_failed_swap_funds_to_lightning(FailedSwapInfo failed_swap_info, u32 sat_per_vbyte, OpeningFeeParams? lsp_fee_param);
+    string swap_failed_swap_funds_to_lightning(FailedSwapInfo failed_swap_info, u32 sats_per_vbyte, OpeningFeeParams? lsp_fee_param);
 
     [Throws=LnError]
     string resolve_failed_swap(ResolveFailedSwapInfo resolve_failed_swap_info);
@@ -204,6 +204,14 @@ interface LightningNode {
     FiatTopup fiat_topup();
 
     ActionsRequired actions_required();
+
+    Onchain onchain();
+
+    LightningAddress lightning_address();
+
+    PhoneNumber phone_number();
+
+    Util util();
 };
 
 interface Config {
@@ -306,6 +314,56 @@ interface ActionsRequired {
     void hide_unrecoverable_failed_swap_item(FailedSwapInfo failed_swap_info);
 };
 
+interface Onchain {
+    Swap swap();
+
+    ReverseSwap reverse_swap();
+
+    ChannelClose channel_close();
+};
+
+interface Swap {
+    [Throws=SwapError]
+    SwapAddressInfo create(OpeningFeeParams? lsp_fee_params);
+
+    [Throws=LnError]
+    OnchainResolvingFees? determine_resolving_fees(FailedSwapInfo failed_swap_info);
+
+    [Throws=LnError]
+    SweepFailedSwapInfo prepare_sweep(FailedSwapInfo failed_swap_info, BitcoinAddressData destination);
+
+    [Throws=LnError]
+    string sweep(SweepFailedSwapInfo sweep_failed_swap_info);
+
+    [Throws=LnError]
+    string swap(FailedSwapInfo failed_swap_info, u32 sats_per_vbyte, OpeningFeeParams? lsp_fee_param);
+};
+
+interface ReverseSwap {
+    [Throws=LnError]
+    RangeHit determine_clear_wallet_feasibility();
+
+    [Throws=LnError]
+    ClearWalletInfo prepare_clear_wallet();
+
+    [Throws=LnError]
+    void clear_wallet(ClearWalletInfo clear_wallet_info, BitcoinAddressData destination);
+};
+
+interface ChannelClose {
+    [Throws=LnError]
+    OnchainResolvingFees? determine_resolving_fees();
+
+    [Throws=SweepError]
+    SweepChannelCloseInfo prepare_sweep(BitcoinAddressData destination);
+
+    [Throws=LnError]
+    string sweep(SweepChannelCloseInfo sweep_info);
+
+    [Throws=SweepError]
+    string swap(u32 sats_per_vbyte, OpeningFeeParams? lsp_fee_params);
+};
+
 interface Activities {
     [Throws=LnError]
     ListActivitiesResponse list(u32 number_of_activities);
@@ -326,6 +384,53 @@ interface Activities {
     void set_personal_note(string payment_hash, string note);
 };
 
+interface LightningAddress {
+    [Throws=LnError]
+    string register();
+
+    [Throws=LnError]
+    string? get();
+};
+
+interface PhoneNumber {
+    [Throws=LnError]
+    string? get();
+
+    [Throws=LnError]
+    void register(string phone_number);
+
+    [Throws=LnError]
+    void verify(string phone_number, string otp);
+
+    [Throws=ParsePhoneNumberPrefixError]
+    void parse_prefix(string phone_number);
+
+    [Throws=ParsePhoneNumberError]
+    string parse_to_lightning_address(string phone_number);
+};
+
+interface Util {
+    [Throws=DecodeDataError]
+    DecodedData decode_data(string data);
+
+    [Throws=LnError]
+    string query_wallet_pubkey_id();
+
+    [Throws=LnError]
+    string derive_payment_uuid(string payment_hash);
+
+    [Throws=LnError]
+    NodeInfo get_node_info();
+
+    ExchangeRate? get_exchange_rate();
+
+    [Throws=LnError]
+    void log_debug_info();
+
+    [Throws=LnError]
+    BreezHealthCheckStatus query_health_status();
+};
+
 dictionary LightningNodeConfig {
     bytes seed;
     string default_fiat_currency;
@@ -699,6 +804,13 @@ dictionary SweepInfo {
     Amount amount;
 };
 
+dictionary SweepChannelCloseInfo {
+    string address;
+    u32 onchain_fee_rate;
+    Amount onchain_fee_amount;
+    Amount amount;
+};
+
 dictionary SwapAddressInfo {
     string address;
     Amount min_deposit;
@@ -714,6 +826,14 @@ dictionary ResolveFailedSwapInfo {
     u32 onchain_fee_rate;
 };
 
+dictionary SweepFailedSwapInfo {
+    string swap_address;
+    Amount recovered_amount;
+    Amount onchain_fee;
+    string to_address;
+    u32 onchain_fee_rate;
+};
+
 dictionary FailedSwapInfo {
     string address;
     Amount amount;
@@ -807,7 +927,7 @@ dictionary ClearWalletInfo {
 dictionary OnchainResolvingFees {
     SwapToLightningFees? swap_fees;
     Amount sweep_onchain_fee_estimate;
-    u32 sat_per_vbyte;
+    u32 sats_per_vbyte;
 };
 
 dictionary SwapToLightningFees {
@@ -945,7 +1065,6 @@ enum PayErrorCode {
 
 [Enum]
 interface UnsupportedDataType {
-    BitcoinAddress();
     LnUrlAuth();
     NodeId();
     Url();

Full Changelog: v0.70.0-beta...v0.71.0-beta

v0.70.0-beta

20 Nov 10:10
ed652c0
Compare
Choose a tag to compare

What's Changed

UDL Changes:

index 613aa11..a203cb4 100644
--- a/src/lipalightninglib.udl
+++ b/src/lipalightninglib.udl
@@ -4,7 +4,7 @@
 
 interface LightningNode {
     [Throws=LnError]
-    constructor(Config config, EventsCallback events_callback);
+    constructor(LightningNodeConfig config, EventsCallback events_callback);
 
     [Throws=LnError]
     NodeInfo get_node_info();
@@ -196,6 +196,114 @@ interface LightningNode {
     void set_feature_flag(FeatureFlag feature, boolean flag_enabled);
 
     Activities activities();
+
+    Lightning lightning();
+
+    Config config();
+
+    FiatTopup fiat_topup();
+
+    ActionsRequired actions_required();
+};
+
+interface Config {
+    [Throws=LnError]
+    void set_fiat_currency(string fiat_currency);
+
+    void set_timezone_config(TzConfig timezone_config);
+
+    [Throws=LnError]
+    void set_analytics_config(AnalyticsConfig config);
+
+    [Throws=LnError]
+    AnalyticsConfig get_analytics_config();
+
+    [Throws=LnError]
+    void register_notification_token(string notification_token, string language_iso_639_1, string country_iso_3166_1_alpha_2);
+
+    [Throws=LnError]
+    void set_feature_flag(FeatureFlag feature, boolean flag_enabled);
+
+    sequence<string> list_currencies();
+
+    void foreground();
+
+    void background();
+};
+
+interface Lightning {
+    Bolt11 bolt11();
+    Lnurl lnurl();
+
+    MaxRoutingFeeMode determine_max_routing_fee_mode(u64 amount_sat);
+
+    [Throws=LnError]
+    PaymentAffordability determine_payment_affordability(u64 amount_sat);
+
+    [Throws=LnError]
+    ReceiveAmountLimits determine_receive_amount_limits();
+
+    [Throws=LnError]
+    CalculateLspFeeResponse calculate_lsp_fee_for_amount(u64 amount_sat);
+
+    [Throws=LnError]
+    LspFee get_lsp_fee();
+};
+
+interface Bolt11 {
+    [Throws=LnError]
+    InvoiceDetails create(u64 amount_sat, OpeningFeeParams? lsp_fee_params, string description, InvoiceCreationMetadata metadata);
+
+    [Throws=PayError]
+    void pay(InvoiceDetails invoice_details, PaymentMetadata metadata);
+
+    [Throws=PayError]
+    void pay_open_amount(InvoiceDetails invoice_details, u64 amount_sat, PaymentMetadata metadata);
+};
+
+interface Lnurl {
+    [Throws=LnUrlPayError]
+    string pay(LnUrlPayRequestData lnurl_pay_request_data, u64 amount_sat, string? comment);
+
+    [Throws=LnUrlWithdrawError]
+    string withdraw(LnUrlWithdrawRequestData lnurl_withdraw_request_data, u64 amount_sat);
+};
+
+interface FiatTopup {
+    [Throws=LnError]
+    void accept_tc(i64 version, string fingerprint);
+
+    [Throws=LnError]
+    TermsAndConditionsStatus query_tc_status();
+
+    [Throws=LnError]
+    FiatTopupInfo register(string? email, string user_iban, string user_currency);
+
+    [Throws=LnError]
+    void reset();
+
+    [Throws=LnError]
+    FiatTopupInfo? get_info();
+
+    [Throws=LnError]
+    Amount calculate_payout_fee(OfferInfo offer);
+
+    [Throws=LnError]
+    string request_collection(OfferInfo offer);
+};
+
+interface ActionsRequired {
+    [Throws=LnError]
+    sequence<ActionRequiredItem> list();
+
+    [Throws=LnError]
+    void dismiss_topup(string id);
+
+    [Throws=LnError]
+    void hide_unrecoverable_channel_close_funds_item();
+
+    [Throws=LnError]
+    void hide_unrecoverable_failed_swap_item(FailedSwapInfo failed_swap_info);
 };
 
 interface Activities {
@@ -207,18 +315,18 @@ interface Activities {
 
     [Throws=LnError]
     Activity? get_by_reverse_swap(string reverse_swap_id);
-    
+
     [Throws=LnError]
     IncomingPaymentInfo get_incoming_payment(string hash);
 
     [Throws=LnError]
     OutgoingPaymentInfo get_outgoing_payment(string hash);
-    
+
     [Throws=LnError]
     void set_personal_note(string payment_hash, string note);
 };
 
-dictionary Config {
+dictionary LightningNodeConfig {
     bytes seed;
     string default_fiat_currency;
     string local_persistence_path;
@@ -310,6 +418,11 @@ dictionary PaymentAmountLimits {
     LiquidityLimit liquidity_limit;
 };
 
+dictionary ReceiveAmountLimits {
+    Amount max_receive;
+    LiquidityLimit liquidity_limit;
+};
+
 dictionary OpeningFeeParams {
         u64 min_msat;
         u32 proportional;
@@ -667,6 +780,12 @@ enum InvoiceAffordability {
     "Affordable",
 };
 
+enum PaymentAffordability {
+    "NotEnoughFunds",
+    "UnaffordableFees",
+    "Affordable",
+};
+
 dictionary PrepareOnchainPaymentResponse {
     string fees_hash;
     f64 fees_percentage;
@@ -743,7 +862,7 @@ namespace lipalightninglib {
     void parse_lightning_address([ByRef] string address);
 
     [Throws=NotificationHandlingError]
-    Notification handle_notification(Config config, string notification_payload, NotificationToggles notification_toggles, duration timeout);
+    Notification handle_notification(LightningNodeConfig config, string notification_payload, NotificationToggles notification_toggles, duration timeout);
 };
 
 dictionary Secret {

Full Changelog: v0.69.0-beta...v0.70.0-beta

v0.69.0-beta

14 Nov 14:01
ddd5a40
Compare
Choose a tag to compare

What's Changed

UDL Changes

modified   src/lipalightninglib.udl
@@ -53,6 +53,9 @@ interface LightningNode {
     [Throws=LnError]
     OutgoingPaymentInfo get_outgoing_payment(string hash);
 
+    [Throws=LnError]
+    Activity get_activity(string hash);
+
     [Throws=LnError]
     void set_payment_personal_note(string payment_hash, string note);
 
@@ -191,6 +194,28 @@ interface LightningNode {
 
     [Throws=LnError]
     void set_feature_flag(FeatureFlag feature, boolean flag_enabled);
+
+    Activities activities();
+};
+
+interface Activities {
+    [Throws=LnError]
+    ListActivitiesResponse list(u32 number_of_activities);
+
+    [Throws=LnError]
+    Activity get(string hash);
+
+    [Throws=LnError]
+    Activity? get_by_reverse_swap(string reverse_swap_id);
+    
+    [Throws=LnError]
+    IncomingPaymentInfo get_incoming_payment(string hash);
+
+    [Throws=LnError]
+    OutgoingPaymentInfo get_outgoing_payment(string hash);
+    
+    [Throws=LnError]
+    void set_personal_note(string payment_hash, string note);
 };
 
 dictionary Config {
@@ -256,6 +281,7 @@ callback interface EventsCallback {
     void payment_failed(string payment_hash);
     void channel_closed(string channel_id, string reason);
     void swap_received(string payment_hash);
+    void reverse_swap_sent(string reverse_swap_id);
     void breez_health_status_changed_to(BreezHealthCheckStatus status);
     void synced();
 };

Misc

Full Changelog: v0.68.0-beta...v0.69.0-beta

v0.68.0-beta

31 Oct 13:01
d9701fb
Compare
Choose a tag to compare

What's Changed

UDL Changes

index b8b022c..0213a30 100644
--- a/src/lipalightninglib.udl
+++ b/src/lipalightninglib.udl
@@ -585,7 +585,6 @@ dictionary SwapInfo {
     string bitcoin_address;
     TzTime created_at;
     Amount paid_amount;
-    string txid;
 };
 
 dictionary ReverseSwapInfo {

Full Changelog: v0.67.0-beta...v0.68.0-beta

v0.67.0-beta

30 Oct 11:21
69effe1
Compare
Choose a tag to compare

What's Changed

UDL Changes

index 1154f91..b8b022c 100644
--- a/src/lipalightninglib.udl
+++ b/src/lipalightninglib.udl
@@ -70,6 +70,7 @@ interface LightningNode {
 
     ExchangeRate? get_exchange_rate();
 
+    [Throws=LnError]
     void change_fiat_currency(string fiat_currency);
 
     void change_timezone_config(TzConfig timezone_config);
@@ -194,7 +195,7 @@ interface LightningNode {
 
 dictionary Config {
     bytes seed;
-    string fiat_currency;
+    string default_fiat_currency;
     string local_persistence_path;
     TzConfig timezone_config;
     Level? file_logging_level;

Full Changelog: v0.66.3-beta...v0.67.0-beta

v0.66.3-beta

21 Oct 15:32
0193655
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.66.2-beta...v0.66.3-beta

v0.66.2-beta

15 Oct 06:51
a549061
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.66.1-beta...v0.66.2-beta

v0.66.1-beta

11 Oct 13:15
577b4ce
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.66.0-beta...v0.66.1-beta

v0.66.0-beta

10 Oct 14:32
9303809
Compare
Choose a tag to compare

What's Changed

UDL Changes:

index c047fd5..1154f91 100644
--- a/src/lipalightninglib.udl
+++ b/src/lipalightninglib.udl
@@ -91,6 +91,9 @@ interface LightningNode {
 
     [Throws=LnError]
     void hide_channel_closes_funds_available_action_required_item();
+    
+    [Throws=LnError]
+    void hide_unresolved_failed_swap_action_required_item(FailedSwapInfo failed_swap_info);
 
     [Throws=LnError]
     sequence<OfferInfo> query_uncompleted_offers();
@@ -114,28 +117,34 @@ interface LightningNode {
     u32 query_onchain_fee_rate();
 
     [Throws=SweepError]
-    SweepInfo prepare_sweep(string address, u32 onchain_fee_rate);
+    SweepInfo prepare_sweep_funds_from_channel_closes(string address, u32 onchain_fee_rate);
 
     [Throws=LnError]
-    string sweep(SweepInfo sweep_info);
+    string sweep_funds_from_channel_closes(SweepInfo sweep_info);
 
     [Throws=SwapError]
     SwapAddressInfo generate_swap_address(OpeningFeeParams? lsp_fee_params);
 
     [Throws=LnError]
     sequence<FailedSwapInfo> get_unresolved_failed_swaps();
+    
+    [Throws=LnError]
+    OnchainResolvingFees? get_failed_swap_resolving_fees(FailedSwapInfo failed_swap_info);
 
     [Throws=LnError]
     ResolveFailedSwapInfo prepare_resolve_failed_swap(FailedSwapInfo failed_swap_info, string to_address, u32 onchain_fee_rate);
 
+    [Throws=LnError]
+    string swap_failed_swap_funds_to_lightning(FailedSwapInfo failed_swap_info, u32 sat_per_vbyte, OpeningFeeParams? lsp_fee_param);
+
     [Throws=LnError]
     string resolve_failed_swap(ResolveFailedSwapInfo resolve_failed_swap_info);
 
     [Throws=LnError]
-    ChannelCloseResolvingFees? get_channel_close_resolving_fees();
+    OnchainResolvingFees? get_channel_close_resolving_fees();
 
     [Throws=SweepError]
-    string swap_onchain_to_lightning(u32 sats_per_vbyte, OpeningFeeParams? lsp_fee_params);
+    string swap_channel_close_funds_to_lightning(u32 sats_per_vbyte, OpeningFeeParams? lsp_fee_params);
 
     [Throws=LnError]
     void hide_topup(string id);
@@ -575,6 +584,7 @@ dictionary SwapInfo {
     string bitcoin_address;
     TzTime created_at;
     Amount paid_amount;
+    string txid;
 };
 
 dictionary ReverseSwapInfo {
@@ -649,7 +659,7 @@ dictionary ClearWalletInfo {
     PrepareOnchainPaymentResponse prepare_response;
 };
 
-dictionary ChannelCloseResolvingFees {
+dictionary OnchainResolvingFees {
     SwapToLightningFees? swap_fees;
     Amount sweep_onchain_fee_estimate;
     u32 sat_per_vbyte;

Full Changelog: v0.65.2-beta...v0.66.0-beta