Add currency settings, Settings service, and dialog to select fiat currency. Add support for non Official currencies like DOGE when using rates.

This commit is contained in:
2026-05-11 10:41:41 +00:00
parent ebe1d8acda
commit 6c01ac1c1b
28 changed files with 1102 additions and 48 deletions

View File

@@ -23,7 +23,7 @@
* 1 - Error (no output, fails silently for shell integration)
*/
import { existsSync, readdirSync, readFileSync } from "node:fs";
import { existsSync, readdirSync } from "node:fs";
import { join } from "node:path";
import { createHash } from "node:crypto";
@@ -34,6 +34,7 @@ import {
} from "../../utils/paths.js";
import { loadMnemonic } from "../mnemonic.js";
import { Storage } from "../../services/storage.js";
import { SettingsService } from "../../services/settings.js";
import { COMMAND_TREE } from "./completions.js";
// Lazy-loaded modules (only loaded when needed for dynamic completions)
@@ -103,12 +104,8 @@ function listSubcommands(command: string, prefix?: string): void {
*/
function getCurrentMnemonic(): string | null {
try {
const walletConfigPath = getWalletConfigPath();
if (!existsSync(walletConfigPath)) {
return null;
}
const mnemonicFile = readFileSync(walletConfigPath, "utf8").trim();
const settings = new SettingsService(getWalletConfigPath());
const mnemonicFile = settings.getDefaultMnemonic();
if (!mnemonicFile) {
return null;
}