add electrum config

This commit is contained in:
2026-09-03 13:30:58 +02:00
parent 7ee3bcb271
commit 9241474d48
6 changed files with 72 additions and 0 deletions
+12
View File
@@ -10,6 +10,8 @@ import {
PostgresConfig,
ShopSettingsConfig
} from '../types/Config';
import { ElectrumNetwork } from '../types/ElectrumNetwork';
import { ElectrumWalletConfig } from '../types/ElectrumWalletConfig';
import { MoneroNetwork } from '../types/MoneroNetwork';
import { MoneroWalletConfig } from '../types/MoneroWalletConfig';
import { ConfirmationTier } from '../types/ConfirmationTier';
@@ -210,6 +212,15 @@ export const getMoneroWalletConfig = (): MoneroWalletConfig => ({
rpcTimeoutMs: envInt('MONERO_WALLET_RPC_TIMEOUT_MS')
});
export const getElectrumWalletConfig = (): ElectrumWalletConfig => ({
network: env('ELECTRUM_NETWORK') as ElectrumNetwork,
server: env('ELECTRUM_SERVER'),
rpcUrl: `http://${env('ELECTRUM_DAEMON_HOST')}:${envInt('ELECTRUM_DAEMON_PORT')}`,
username: env('ELECTRUM_DAEMON_RPC_USER'),
password: env('ELECTRUM_DAEMON_RPC_PASSWORD'),
rpcTimeoutMs: envInt('ELECTRUM_DAEMON_RPC_TIMEOUT_MS')
});
export const getSimplexConfig = (): SimplexConfig => ({
wsUrl: env('SIMPLEX_WS_URL'),
botDisplayName: env('SIMPLEX_BOT_DISPLAY_NAME')
@@ -226,5 +237,6 @@ export default () => ({
order: getOrderConfig(),
invoice: getInvoiceConfig(),
moneroWallet: getMoneroWalletConfig(),
electrumWallet: getElectrumWalletConfig(),
simplex: getSimplexConfig()
});
+32
View File
@@ -5,6 +5,7 @@ import { ShopFiatCurrency } from '../types/ShopFiatCurrency';
import { IsBase64 } from '../validation/decorators/isBase64';
import { IsConfirmationTiers } from '../validation/decorators/isConfirmationTiers';
import { IsEnabledPaymentMethods } from '../validation/decorators/isEnabledPaymentMethods';
import { ElectrumNetwork } from '../types/ElectrumNetwork';
import { MoneroNetwork } from '../types/MoneroNetwork';
class EnvironmentVariables {
@@ -342,6 +343,37 @@ class EnvironmentVariables {
@Min(1000)
MONERO_WALLET_RPC_TIMEOUT_MS: number;
@IsNotEmpty()
@IsEnum(ElectrumNetwork)
ELECTRUM_NETWORK: ElectrumNetwork;
@IsNotEmpty()
@IsString()
ELECTRUM_SERVER: string;
@IsNotEmpty()
@IsString()
ELECTRUM_DAEMON_HOST: string;
@IsNotEmpty()
@IsNumber()
@Min(1)
@Max(65535)
ELECTRUM_DAEMON_PORT: number;
@IsNotEmpty()
@IsString()
ELECTRUM_DAEMON_RPC_USER: string;
@IsNotEmpty()
@IsString()
ELECTRUM_DAEMON_RPC_PASSWORD: string;
@IsNotEmpty()
@IsNumber()
@Min(1000)
ELECTRUM_DAEMON_RPC_TIMEOUT_MS: number;
@IsNotEmpty()
@IsString()
SIMPLEX_WS_URL: string;