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
This commit is contained in:
redshift
2026-05-24 10:23:29 +08:00
parent 789fd9db2b
commit e9775c10d4
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -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,
},
},
};
});
+1 -1
View File
@@ -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.