Skip to content

v0.70.0-beta

Compare
Choose a tag to compare
@danielgranhao danielgranhao released this 20 Nov 10:10
· 98 commits to main since this release
ed652c0

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