Releases: getlipa/lipa-lightning-lib
Releases · getlipa/lipa-lightning-lib
v0.72.0-beta
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
What's Changed
- Remove
UnsupportedDataType::BitcoinAddress
by @andrei-21 in #1269 - Implement
Onchain
module by @danielgranhao in #1268 - Run all integration tests by @gcomte in #1272
- Implement
LightningAddress
,PhoneNumber
andUtil
modules by @danielgranhao in #1270 - Bump ctor from 0.2.8 to 0.2.9 by @dependabot in #1274
- Handle onchain fee rate internally by @danielgranhao in #1271
- Use
BitcoinAddressData
for address parameters by @danielgranhao in #1275
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
What's Changed
- Monitoring test adjustments by @danielgranhao in #1260
- Bump uniffi from 0.28.2 to 0.28.3 by @dependabot in #1261
- Add missing activities list doc by @danielgranhao in #1262
- Bump rustyline from 14.0.0 to 15.0.0 by @dependabot in #1265
- Bump serde_json from 1.0.132 to 1.0.133 by @dependabot in #1264
- Implement
Lightning
module by @danielgranhao in #1259 - Implement
Config
module by @danielgranhao in #1263 - Implement
FiatTopup
andActionsRequired
modules by @danielgranhao in #1266 - Fix
activities().get()
deadlock by @danielgranhao in #1267
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
What's Changed
- Implement Activities by @danielgranhao in #1257
- Handle
ReverseSwapUpdated
event by @andrei-21 in #1258
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
- Bump thiserror from 1.0.65 to 1.0.67 by @dependabot in #1249
- Bump anyhow from 1.0.91 to 1.0.92 by @dependabot in #1246
- Bump tokio from 1.40.0 to 1.41.1 by @dependabot in #1253
- Bump anyhow from 1.0.92 to 1.0.93 by @dependabot in #1251
- Bump thiserror from 1.0.67 to 2.0.0 by @dependabot in #1252
- Bump thiserror from 2.0.0 to 2.0.3 by @dependabot in #1255
- Bump serial_test from 3.1.1 to 3.2.0 by @dependabot in #1254
- Bump serde from 1.0.214 to 1.0.215 by @dependabot in #1256
Full Changelog: v0.68.0-beta...v0.69.0-beta
v0.68.0-beta
What's Changed
- Remove swap txid by @danielgranhao in #1245
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
What's Changed
- Add abbreviated mock commands by @gcomte in #1234
- Bump thiserror from 1.0.64 to 1.0.65 by @dependabot in #1237
- Bump serde from 1.0.210 to 1.0.213 by @dependabot in #1236
- Bump anyhow from 1.0.90 to 1.0.91 by @dependabot in #1235
- Bump regex from 1.11.0 to 1.11.1 by @dependabot in #1238
- Bump reqwest from 0.11.20 to 0.12.9 by @dependabot in #1241
- Bump serde from 1.0.213 to 1.0.214 by @dependabot in #1240
- Change fiat currency config to a default by @danielgranhao in #1244
- Filter swaps that have some refund in progress by @danielgranhao in #1243
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
What's Changed
- Bump uuid from 1.10.0 to 1.11.0 by @dependabot in #1226
- Bump serde_json from 1.0.128 to 1.0.129 by @dependabot in #1227
- Bump anyhow from 1.0.89 to 1.0.90 by @dependabot in #1230
- Bump serde_json from 1.0.129 to 1.0.132 by @dependabot in #1229
- Print env var key when value is not present by @gcomte in #1228
- Introduce int and e2e tests by @gcomte in #1221
- Improve swap mock and fix unit conversion bug by @danielgranhao in #1231
Full Changelog: v0.66.2-beta...v0.66.3-beta
v0.66.2-beta
What's Changed
- Bump Breez SDK to 0.6.2 by @danielgranhao in #1224
Full Changelog: v0.66.1-beta...v0.66.2-beta
v0.66.1-beta
What's Changed
- Expose swap amount in mock by @danielgranhao in #1223
Full Changelog: v0.66.0-beta...v0.66.1-beta
v0.66.0-beta
What's Changed
- Fix exchange rate monitor test by @danielgranhao in #1212
- Improve mocking by @gcomte in #1214
- Mock different key pair per node instance by @gcomte in #1216
- Bump uniffi from 0.28.1 to 0.28.2 by @dependabot in #1218
- Bump bip39 from 2.0.0 to 2.1.0 by @dependabot in #1213
- Make tests work with mocked interfaces by @gcomte in #1219
- Implement failed swap handling improvements by @danielgranhao in #1215
- Expose swap txid by @danielgranhao in #1220
- Fix missing method in UDL file by @danielgranhao in #1222
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