77 lines
3.5 KiB
TypeScript
77 lines
3.5 KiB
TypeScript
/**
|
||
* Admin-configurable platform settings loaded from key-value rows.
|
||
* Maps to the `system_settings` table (password policy, JWT expiry, and runtime ops).
|
||
*/
|
||
|
||
/** Typed projection of `system_settings` rows used across auth, security, and game engine. */
|
||
export interface SystemSettings {
|
||
password_min_length: number;
|
||
password_require_uppercase: boolean;
|
||
password_require_lowercase: boolean;
|
||
password_require_number: boolean;
|
||
password_require_special: boolean;
|
||
access_token_expiry: string;
|
||
refresh_token_expiry: string;
|
||
require_email_verification_for_login: boolean;
|
||
/** Kill-switch for on-chain withdrawal broadcasts. */
|
||
allow_withdrawals: boolean;
|
||
/** Per-network deposit/withdraw gates (USDT TRC20 / BEP20). */
|
||
network_usdt_trc20_deposit_enabled: boolean;
|
||
network_usdt_trc20_withdraw_enabled: boolean;
|
||
network_usdt_bep20_deposit_enabled: boolean;
|
||
network_usdt_bep20_withdraw_enabled: boolean;
|
||
/** Global API rate limit window (ms). Takes effect after server restart. */
|
||
rate_limit_window_ms: number;
|
||
/** Max requests per IP per rate_limit_window_ms. */
|
||
rate_limit_max: number;
|
||
/** Max login attempts per IP per 15-minute window. */
|
||
login_rate_limit_max: number;
|
||
daily_withdrawal_limit_usd: number;
|
||
large_withdrawal_threshold_usd: number;
|
||
candle_predict_engine_tick_ms: number;
|
||
candle_predict_backfill_max_per_tick: number;
|
||
candle_predict_backfill_interval_ms: number;
|
||
candle_predict_backfill_seed_max: number;
|
||
/** Days to keep engine-only audit rows such as prediction_round_settled (0 = never purge). */
|
||
engine_audit_log_retention_days: number;
|
||
/**
|
||
* Days to keep rows in `candle_predict_candles` (by `candle_open_ms`).
|
||
* `0` disables age-based purge.
|
||
*/
|
||
candle_predict_retention_days: number;
|
||
/**
|
||
* Max candles to keep per `interval_minutes` (newest first).
|
||
* `0` disables count-based purge.
|
||
*/
|
||
candle_predict_retention_keep_last: number;
|
||
/** Network fee deducted from user USDT balance per withdrawal (6-decimal micro units). */
|
||
withdrawal_network_fee_usdt_micro: number;
|
||
/**
|
||
* Minimum USDT that must remain on the sender's main balance after a peer transfer
|
||
* (6-decimal micro units). `0` disables the limit.
|
||
*/
|
||
transfer_min_remaining_usdt_micro: number;
|
||
/** When true, admin/super_admin routes require TOTP to be enabled. */
|
||
require_admin_2fa: boolean;
|
||
/** When true, withdrawals and transfers require 2FA to be enabled and a valid code. */
|
||
require_withdrawal_2fa: boolean;
|
||
/** Max active refresh-token sessions per user (0 = unlimited). */
|
||
max_concurrent_sessions: number;
|
||
/** Failed logins before temporary lockout (0 = disabled). */
|
||
login_max_failed_attempts: number;
|
||
/** Lockout duration in minutes after max failed attempts. */
|
||
login_lockout_minutes: number;
|
||
/** Require captcha after this many prior failed logins (math built-in, or Turnstile when configured). */
|
||
login_captcha_after_failures: number;
|
||
/** When true, Sybil block threshold auto-suspends beneficiary accounts. */
|
||
sybil_auto_suspend_accounts: boolean;
|
||
/** When true, high login risk scores auto-suspend non-staff accounts. */
|
||
login_risk_auto_suspend_accounts: boolean;
|
||
/** Minimum login risk score (0–100) to trigger auto-suspend when enabled. */
|
||
login_risk_auto_suspend_threshold: number;
|
||
/** Minutes after send during which the author may edit a support message (0 = disabled). */
|
||
support_message_edit_window_minutes: number;
|
||
/** Minutes after send during which the author may delete a support message (0 = disabled). */
|
||
support_message_delete_window_minutes: number;
|
||
}
|