//! Synor Desktop Wallet - Tauri Backend //! //! Provides native functionality for the desktop wallet: //! - Secure key storage using OS keychain //! - Direct RPC communication with Synor nodes //! - Transaction signing with Dilithium3 post-quantum signatures //! - File system access for wallet backups mod commands; mod crypto; mod error; mod wallet; use tauri::Manager; pub use error::{Error, Result}; /// Initialize the Tauri application with all plugins and commands #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() .plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_store::Builder::default().build()) .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_clipboard_manager::init()) .setup(|app| { // Initialize wallet state let wallet_state = wallet::WalletState::new(); app.manage(wallet_state); #[cfg(debug_assertions)] { // Open devtools in development if let Some(window) = app.get_webview_window("main") { window.open_devtools(); } } Ok(()) }) .invoke_handler(tauri::generate_handler![ // Wallet management commands::create_wallet, commands::import_wallet, commands::unlock_wallet, commands::lock_wallet, commands::get_wallet_info, commands::export_mnemonic, // Addresses & UTXOs commands::get_addresses, commands::generate_address, commands::get_balance, commands::get_utxos, // Transactions commands::create_transaction, commands::sign_transaction, commands::broadcast_transaction, commands::get_transaction_history, // Network commands::connect_node, commands::disconnect_node, commands::get_network_status, ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); }