From e9775c10d4229a41b2f5be64cacd8c5239d9ad8f Mon Sep 17 00:00:00 2001 From: redshift <213178690+1ftredsh@users.noreply.github.com> Date: Sun, 24 May 2026 10:23:29 +0800 Subject: [PATCH] Display cooldown in minutes instead of milliseconds - Add cooldownMinutes field to /nwc/status and /nwc/auto-refill responses - Change auto-refill log from ms to minutes display - Keep cooldownMs internally for calculations --- src/daemon/http/index.ts | 6 +++++- src/daemon/wallet/index.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/daemon/http/index.ts b/src/daemon/http/index.ts index ff1b2d0..1ed8a3e 100644 --- a/src/daemon/http/index.ts +++ b/src/daemon/http/index.ts @@ -446,6 +446,7 @@ export function createDaemonRequestHandler(deps: { threshold: autoRefill.threshold, amount: autoRefill.amount, cooldownMs: autoRefill.cooldownMs, + cooldownMinutes: autoRefill.cooldownMs / 60000, } : undefined, }, @@ -565,7 +566,10 @@ export function createDaemonRequestHandler(deps: { return { output: { message: `Auto-refill ${enabled ? "enabled" : "disabled"}.`, - autoRefill: config.nwc.autoRefill, + autoRefill: { + ...config.nwc.autoRefill, + cooldownMinutes: config.nwc.autoRefill.cooldownMs / 60000, + }, }, }; }); diff --git a/src/daemon/wallet/index.ts b/src/daemon/wallet/index.ts index a7a9711..4d2f96f 100644 --- a/src/daemon/wallet/index.ts +++ b/src/daemon/wallet/index.ts @@ -319,7 +319,7 @@ export async function createWalletAdapter( const getConfig = options.getAutoRefillConfig ?? (() => options.autoRefill); stopAutoRefill = startAutoRefillLoop(client, getWallet, getConfig); logger.log( - `[wallet] Auto-refill enabled: threshold=${autoRefillConfig.threshold} sats, amount=${autoRefillConfig.amount} sats, cooldown=${autoRefillConfig.cooldownMs}ms`, + `[wallet] Auto-refill enabled: threshold=${autoRefillConfig.threshold} sats, amount=${autoRefillConfig.amount} sats, cooldown=${autoRefillConfig.cooldownMs / 60000} minutes`, ); } else if (wallet && options.getAutoRefillConfig) { // Wallet exists but auto-refill is not currently enabled.