From cb4bd7d7c10cadcb43f82c09b13ffed744e541f7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 17 May 2026 04:37:15 +0530 Subject: Phase 5: Lightning auto-payout with LNURL-pay and NUT-05 melt - New lnurl_pay.c/h: LNURL-pay protocol (GET .well-known/lnurlp + callback) - New lightning_payout.c/h: threshold-based auto-payout with multi-recipient split - Extended nucula_wallet bridge with nucula_wallet_melt() (NUT-05) - Config: payout section with multi-mint, multi-recipient, fee_tolerance - Default: enabled, TollGate@coinos.io, min_payout=128, min_balance=64 - 18 new unit tests (all passing), 134 total --- main/tollgate_main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main/tollgate_main.c') diff --git a/main/tollgate_main.c b/main/tollgate_main.c index d4dcf0d..3f83923 100644 --- a/main/tollgate_main.c +++ b/main/tollgate_main.c @@ -20,6 +20,7 @@ #include "nucula_wallet.h" #include "wifistr.h" #include "tollgate_client.h" +#include "lightning_payout.h" #define MAX_STA_RETRY 5 static const char *TAG = "tollgate_main"; @@ -89,6 +90,8 @@ static void ip_event_handler(void *arg, esp_event_base_t event_base, const tollgate_config_t *cfg = tollgate_config_get(); nucula_wallet_init(cfg->mint_url); + lightning_payout_init(&cfg->payout); + char gw_ip_str[16]; snprintf(gw_ip_str, sizeof(gw_ip_str), IPSTR, IP2STR(&event->ip_info.gw)); tollgate_client_on_sta_connected(gw_ip_str); @@ -282,5 +285,6 @@ void app_main(void) vTaskDelay(pdMS_TO_TICKS(1000)); session_tick(); tollgate_client_tick(); + lightning_payout_tick(); } } -- cgit v1.2.3