add electrum config
This commit is contained in:
@@ -106,6 +106,18 @@ MONERO_MIN_INCOMING_ATOMIC=10000000 # 0.00001 XMR (~half a USD cent at that mome
|
||||
BITCOIN_CONFIRMATION_TIERS='[{"upToTotalFiat":"30","minConfirmations":0},{"upToTotalFiat":"100","minConfirmations":1},{"upToTotalFiat":"300","minConfirmations":3},{"minConfirmations":6}]'
|
||||
BITCOIN_MIN_INCOMING_ATOMIC=7 # 0.00000007 BTC (~half a USD cent at that moment)
|
||||
|
||||
ELECTRUM_VERSION=4.8.1
|
||||
ELECTRUM_NETWORK=testnet
|
||||
ELECTRUM_SERVER=electrum.blockstream.info:60002:s
|
||||
ELECTRUM_DAEMON_HOST=electrum-daemon
|
||||
ELECTRUM_DAEMON_PORT=7777
|
||||
ELECTRUM_DAEMON_RPC_USER=electrum
|
||||
ELECTRUM_DAEMON_RPC_PASSWORD=change-me
|
||||
ELECTRUM_DAEMON_RPC_TIMEOUT_MS=10000
|
||||
ELECTRUM_WALLET_DIR=./electrum-daemon/wallet
|
||||
ELECTRUM_WALLET_NAME=shop
|
||||
ELECTRUM_WALLET_PASSWORD=change-me
|
||||
|
||||
SIMPLEX_CHAT_VERSION=v6.5.6
|
||||
SIMPLEX_WS_URL=ws://simplex-cli:5225
|
||||
SIMPLEX_BOT_DISPLAY_NAME=NullCartBot
|
||||
|
||||
@@ -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()
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ConfirmationTier } from './ConfirmationTier';
|
||||
import { ElectrumWalletConfig } from './ElectrumWalletConfig';
|
||||
import { MoneroWalletConfig } from './MoneroWalletConfig';
|
||||
import { NodeEnv } from './NodeEnv';
|
||||
import { PaymentMethod } from '../modules/payment/types/PaymentMethod';
|
||||
@@ -122,5 +123,6 @@ export interface Config {
|
||||
order: OrderConfig;
|
||||
invoice: InvoiceConfig;
|
||||
moneroWallet: MoneroWalletConfig;
|
||||
electrumWallet: ElectrumWalletConfig;
|
||||
simplex: SimplexConfig;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export enum ElectrumNetwork {
|
||||
Mainnet = 'mainnet',
|
||||
Testnet = 'testnet'
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { ElectrumNetwork } from './ElectrumNetwork';
|
||||
|
||||
export interface ElectrumWalletConfig {
|
||||
network: ElectrumNetwork;
|
||||
server: string;
|
||||
rpcUrl: string;
|
||||
username: string;
|
||||
password: string;
|
||||
rpcTimeoutMs: number;
|
||||
}
|
||||
Reference in New Issue
Block a user