152 lines
4.9 KiB
TypeScript
152 lines
4.9 KiB
TypeScript
/**
|
|
* Application configuration loaded from environment variables.
|
|
* Centralizes defaults for server, database, JWT, encryption, blockchain, and safety settings.
|
|
*/
|
|
/** Resolved runtime configuration derived from process.env with safe defaults. */
|
|
export declare const config: {
|
|
env: string;
|
|
port: number;
|
|
apiPrefix: string;
|
|
database: {
|
|
url: string;
|
|
};
|
|
jwt: {
|
|
secret: string;
|
|
accessExpiry: string;
|
|
refreshExpiry: string;
|
|
};
|
|
encryption: {
|
|
key: string;
|
|
};
|
|
blockchain: {
|
|
tron: {
|
|
nodeUrl: string;
|
|
apiKey: string;
|
|
confirmations: number;
|
|
/** Optional override for USDT TRC20 contract (e.g. testnet token). When set, used instead of DB wallet_types.contract_address. */
|
|
usdtTrc20Contract: string | null;
|
|
};
|
|
polygon: {
|
|
rpcUrl: string;
|
|
usdcContract: string;
|
|
confirmations: number;
|
|
/** Max blocks per eth_getLogs call; Amoy public RPC rejects ~500-block ranges */
|
|
getLogsBlockRange: number;
|
|
};
|
|
};
|
|
rateLimit: {
|
|
windowMs: number;
|
|
max: number;
|
|
loginMax: number;
|
|
};
|
|
withdrawal: {
|
|
dailyLimitUsd: number;
|
|
largeThresholdUsd: number;
|
|
/** Kill-switch: prevents broadcasting real chain txs unless explicitly enabled */
|
|
allowWithdrawals: boolean;
|
|
/** Default network fee in USDT micro-units (6 decimals); admin can override in Settings. */
|
|
networkFeeUsdtMicro: number;
|
|
};
|
|
security: {
|
|
integrityCheckIntervalMs: number;
|
|
/** When set, overrides DB setting `require_admin_2fa` (use `false` for local Docker dev). */
|
|
requireAdmin2faEnv: string | null;
|
|
/** Skips JWT token_version check (enabled automatically in NODE_ENV=test). */
|
|
skipAccessTokenVersionCheck: boolean;
|
|
};
|
|
treasury: {
|
|
/** Moves on-chain deposits from user addresses to cold storage */
|
|
sweepEnabled: boolean;
|
|
sweepPollIntervalMs: number;
|
|
/** Minimum token amount (raw units) to sweep */
|
|
sweepMinAmountRaw: string;
|
|
/** TRX sent from hot wallet to fund TRC20 sweeps (sun) */
|
|
tronGasTopUpSun: string;
|
|
/** MATIC sent from hot wallet to fund USDC sweeps (wei) */
|
|
polygonGasTopUpWei: string;
|
|
};
|
|
app: {
|
|
/** Public web app URL used in verification links (e.g. http://localhost:5173) */
|
|
publicUrl: string;
|
|
verifyEmailPath: string;
|
|
resetPasswordPath: string;
|
|
/** Comma-separated allowed CORS origins in production */
|
|
corsOrigins: string[];
|
|
};
|
|
countries: {
|
|
/** Optional REST Countries v5 API key. When unset, sync uses the ISO 3166 public catalog. */
|
|
restCountriesApiKey: string;
|
|
};
|
|
deposit: {
|
|
/** Platform asset for deposits and predictions (USDT TRC20). */
|
|
walletTypeCode: string;
|
|
};
|
|
candlePredict: {
|
|
engineTickMs: number;
|
|
backfillMaxPerTick: number;
|
|
backfillIntervalMs: number;
|
|
backfillSeedMax: number;
|
|
};
|
|
email: {
|
|
/** smtp = send via SMTP; console = log link to stdout (dev) */
|
|
transport: "smtp" | "console";
|
|
host: string;
|
|
port: number;
|
|
secure: boolean;
|
|
user: string;
|
|
pass: string;
|
|
from: string;
|
|
verificationExpiryHours: number;
|
|
verificationSendMax: number;
|
|
passwordResetExpiryHours: number;
|
|
passwordResetSendMax: number;
|
|
};
|
|
slack: {
|
|
/** Legacy fallback when channel-specific webhooks are not set */
|
|
webhookUrl: string;
|
|
/** #security — withdrawals, auth, platform security alerts */
|
|
securityWebhookUrl: string;
|
|
/** #referral-fraud — cap blocks, clawbacks, Sybil review */
|
|
referralWebhookUrl: string;
|
|
};
|
|
redis: {
|
|
url: string;
|
|
/** Auto-enabled when REDIS_URL is set unless REDIS_ENABLED=false */
|
|
enabled: boolean;
|
|
/** Phase B: read round state from Redis before PostgreSQL */
|
|
roundCacheEnabled: boolean;
|
|
/** Phase B+: enqueue single bets to Redis Stream (requires worker-bets) */
|
|
betAsyncEnabled: boolean;
|
|
};
|
|
ws: {
|
|
enabled: boolean;
|
|
port: number;
|
|
path: string;
|
|
supportPath: string;
|
|
securityPath: string;
|
|
};
|
|
/** When false, API process skips starting game engines (use app-engine instead) */
|
|
engineEnabled: boolean;
|
|
setup: {
|
|
/**
|
|
* One-time secret for creating the first administrator on a fresh deployment.
|
|
* Set INITIAL_SETUP_TOKEN in production (min. 32 random characters).
|
|
*/
|
|
token: string;
|
|
};
|
|
turnstile: {
|
|
siteKey: string;
|
|
secretKey: string;
|
|
};
|
|
sentry: {
|
|
dsn: string;
|
|
tracesSampleRate: number;
|
|
};
|
|
clamav: {
|
|
enabled: boolean;
|
|
host: string;
|
|
port: number;
|
|
timeoutMs: number;
|
|
};
|
|
};
|
|
//# sourceMappingURL=index.d.ts.map
|