mirror of
https://github.com/Routstr/routstrd.git
synced 2026-07-30 15:46:14 +00:00
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:
@@ -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,
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user