diff --git a/core/src/app.rs b/core/src/app.rs index dcbba8a..677b3f8 100644 --- a/core/src/app.rs +++ b/core/src/app.rs @@ -3,11 +3,11 @@ use cfg_if::cfg_if; use kaspa_ng_core::runtime; use kaspa_ng_core::settings::Settings; use kaspa_wallet_core::api::WalletApi; +use std::iter::once; use std::sync::Arc; use workflow_i18n::*; use workflow_log::*; -// #[allow(unused)] pub const KASPA_NG_ICON_SVG: &[u8] = include_bytes!("../../resources/images/kaspa.svg"); pub const KASPA_NG_LOGO_SVG: &[u8] = include_bytes!("../../resources/images/kaspa-ng.svg"); pub const I18N_EMBEDDED: &str = include_str!("../../resources/i18n/i18n.json"); @@ -32,7 +32,6 @@ cfg_if! { MINIMUM_DAEMON_SOFT_FD_LIMIT }; use kaspad_lib::args::Args as NodeArgs; - use kaspad_lib::args::parse_args as parse_kaspad_args; use kaspa_utils::fd_budget; use kaspa_core::signals::Signals; use clap::ArgAction; @@ -60,16 +59,24 @@ cfg_if! { fn parse_args() -> Args { #[allow(unused)] use clap::{arg, command, Arg, Command}; + use std::env::{args,var}; - if std::env::args().any(|arg| arg == "--daemon") || std::env::var("KASPA_NG_DAEMON").is_ok() { - Args::Kaspad { args : Box::new(parse_kaspad_args()) } + if args().any(|arg| arg == "--daemon") || var("KASPA_NG_DAEMON").is_ok() { + let args = once("kaspad".to_string()).chain(args().skip(1).filter(|arg| arg != "--daemon"));//.collect::>(); + match NodeArgs::parse(args) { + Ok(args) => Args::Kaspad { args : Box::new(args) }, + Err(err) => { + println!("{err}"); + std::process::exit(1); + } + } } else { let cmd = Command::new("kaspa-ng") .about(format!("kaspa-ng v{VERSION}-{GIT_DESCRIBE} (rusty-kaspa v{})", kaspa_wallet_core::version())) .arg(arg!(--disable "Disable node services when starting")) - .arg(arg!(--daemon "Run as Rusty Kaspa p2p daemon")) + .arg(arg!(--daemon "Run as Rusty Kaspa p2p daemon (kaspad)")) .arg( Arg::new("reset-settings") .long("reset-settings") diff --git a/core/src/core.rs b/core/src/core.rs index 4e58e5b..de67c76 100644 --- a/core/src/core.rs +++ b/core/src/core.rs @@ -4,7 +4,7 @@ use crate::mobile::MobileMenu; use egui::load::Bytes; use egui_notify::Toasts; use kaspa_metrics_core::MetricsSnapshot; -use kaspa_wallet_core::api::TransactionDataGetResponse; +use kaspa_wallet_core::api::TransactionsDataGetResponse; use kaspa_wallet_core::events::Events as CoreWallet; use kaspa_wallet_core::storage::{Binding, Hint, PrvKeyDataInfo}; use std::borrow::Cow; @@ -25,7 +25,7 @@ pub struct Core { application_events_channel: ApplicationEventsChannel, deactivation: Option, module: Module, - stack: VecDeque, + pub stack: VecDeque, modules: HashMap, pub settings: Settings, pub toasts: Toasts, @@ -189,17 +189,6 @@ impl Core { this.wallet_update_list(); - #[cfg(not(target_arch = "wasm32"))] - spawn(async move { - use workflow_core::task::sleep; - - loop { - println!("Checking version..."); - let _ = check_version().await; - sleep(Duration::from_secs(60 * 60 * 6)).await; - } - }); - this } @@ -234,11 +223,24 @@ impl Core { } pub fn back(&mut self) { - if let Some(module) = self.stack.pop_back() { - self.module = module; + if self.state().is_open() { + if let Some(module) = self.stack.pop_back() { + self.module = module; + } + } else { + while let Some(module) = self.stack.pop_back() { + if !module.secure() { + self.module = module; + return; + } + } } } + pub fn purge_secure_stack(&mut self) { + self.stack.retain(|module| !module.secure()); + } + pub fn sender(&self) -> crate::runtime::channel::Sender { self.application_events_channel.sender.clone() } @@ -725,6 +727,7 @@ impl Core { self.prv_key_data_map = Some(prv_key_data_map); } } + CoreWallet::AccountDeactivation { ids: _ } => {} CoreWallet::AccountActivation { ids: _ } => {} CoreWallet::AccountCreate { account_descriptor } => { let account = Account::from(account_descriptor); @@ -762,6 +765,8 @@ impl Core { self.modules.clone().into_iter().for_each(|(_, module)| { module.reset(self); }); + + self.purge_secure_stack(); } CoreWallet::AccountSelection { id: _ } => {} CoreWallet::DAAScoreChange { current_daa_score } => { @@ -890,6 +895,7 @@ impl Core { .into_iter() .map(|prv_key_data_info| (*prv_key_data_info.id(), prv_key_data_info)) .collect::>(); + application_events_sender .send(Events::PrvKeyDataInfo { prv_key_data_info_map, @@ -900,6 +906,7 @@ impl Core { .iter() .map(|account| account.id()) .collect::>(); + let account_map: HashMap = account_list .clone() .into_iter() @@ -911,7 +918,7 @@ impl Core { .map(|account_id| { runtime .wallet() - .transaction_data_get_range(account_id, network_id, 0..128) + .transactions_data_get_range(account_id, network_id, 0..128) }) .collect::>(); @@ -922,7 +929,7 @@ impl Core { .collect::>>()?; transaction_data.into_iter().for_each(|data| { - let TransactionDataGetResponse { + let TransactionsDataGetResponse { account_id, transactions, start: _, diff --git a/core/src/egui/panel.rs b/core/src/egui/panel.rs index e3e0355..38ade7d 100644 --- a/core/src/egui/panel.rs +++ b/core/src/egui/panel.rs @@ -127,6 +127,7 @@ impl<'panel, Context> Panel<'panel, Context> { ui.horizontal(|ui| { match self.back { Some(back) if self.back_enabled => { + println!("Back is enabled"); let icon = CompositeIcon::new(egui_phosphor::bold::ARROW_BEND_UP_LEFT) .icon_size(icon_size.inner.x) .padding(Some(icon_padding)); diff --git a/core/src/error.rs b/core/src/error.rs index f0cdbaa..812ef1a 100644 --- a/core/src/error.rs +++ b/core/src/error.rs @@ -79,6 +79,9 @@ pub enum Error { #[error(transparent)] NetworkType(#[from] kaspa_consensus_core::network::NetworkTypeError), + + #[error("Account creation error")] + AccountCreationError, } impl Error { diff --git a/core/src/imports.rs b/core/src/imports.rs index c21b62f..773bf48 100644 --- a/core/src/imports.rs +++ b/core/src/imports.rs @@ -9,6 +9,7 @@ pub use kaspa_utils::{hashmap::GroupExtension, networking::ContextualNetAddress} pub use kaspa_wallet_core::api; pub use kaspa_wallet_core::api::WalletApi; pub use kaspa_wallet_core::events::SyncState; +pub use kaspa_wallet_core::prelude::Address; pub use kaspa_wallet_core::rpc::DynRpcApi; pub use kaspa_wallet_core::runtime::{Account as KaspaAccount, Wallet as KaspaWallet}; pub use kaspa_wallet_core::runtime::{AccountDescriptor, AccountId, Balance}; @@ -17,7 +18,6 @@ pub use kaspa_wallet_core::storage::{ IdT, PrvKeyDataId, TransactionId, TransactionRecord, WalletDescriptor, }; pub use kaspa_wallet_core::utils::*; -pub use kaspa_wallet_core::Address; pub use kaspa_wrpc_client::{KaspaRpcClient, WrpcEncoding}; pub use async_trait::async_trait; @@ -78,8 +78,8 @@ pub use crate::primitives::{ pub use crate::result::Result; pub use crate::runtime::{runtime, spawn, spawn_with_result, Payload, Runtime, Service}; pub use crate::settings::{ - KaspadNodeKind, NetworkInterfaceConfig, NetworkInterfaceKind, NodeSettings, PluginSettings, - PluginSettingsMap, RpcConfig, Settings, UserInterfaceSettings, + KaspadNodeKind, NetworkInterfaceConfig, NetworkInterfaceKind, NodeSettings, RpcConfig, + Settings, UserInterfaceSettings, }; pub use crate::state::State; pub use crate::status::Status; diff --git a/core/src/menu.rs b/core/src/menu.rs index de4b834..b0ef0ed 100644 --- a/core/src/menu.rs +++ b/core/src/menu.rs @@ -185,14 +185,27 @@ impl<'core> Menu<'core> { ui.close_menu(); } ui.separator(); - if ui.button("Wallet").clicked() { - if self.core.state().is_open() { + + #[allow(clippy::collapsible_else_if)] + if self.core.state().is_open() { + if ui.button("Wallet").clicked() { self.select::(); - } else { + ui.close_menu(); + } + } else { + if ui.button("Wallet").clicked() { self.select::(); + ui.close_menu(); } - ui.close_menu(); } + // if ui.button("Wallet").clicked() { + // if self.core.state().is_open() { + // self.select::(); + // } else { + // self.select::(); + // } + // ui.close_menu(); + // } ui.separator(); if ui.button("Metrics").clicked() { diff --git a/core/src/modules/account_create.rs b/core/src/modules/account_create.rs index 19d2911..c49b48d 100644 --- a/core/src/modules/account_create.rs +++ b/core/src/modules/account_create.rs @@ -3,9 +3,9 @@ use crate::imports::*; use kaspa_bip32::Mnemonic; use kaspa_wallet_core::api::AccountsCreateRequest; -use kaspa_wallet_core::runtime::{AccountCreateArgs, PrvKeyDataCreateArgs, WalletCreateArgs}; -use kaspa_wallet_core::storage::interface::AccessContext; -use kaspa_wallet_core::storage::{AccessContextT, AccountKind, PrvKeyDataInfo}; +use kaspa_wallet_core::runtime::wallet::AccountCreateArgsBip32; +use kaspa_wallet_core::runtime::{AccountCreateArgs, PrvKeyDataCreateArgs, WalletCreateArgs, PrvKeyDataArgs}; +use kaspa_wallet_core::storage::{AccountKind, PrvKeyDataInfo}; #[derive(Clone)] @@ -347,7 +347,7 @@ impl ModuleT for AccountCreate { // let prv_key_data_info = args.prv_key_data_info.clone().unwrap(); - let account_create_result = Payload::>::new("wallet_create_result"); + let account_create_result = Payload::>::new("account_create_result"); if !account_create_result.is_pending() { let wallet = self.runtime.wallet().clone(); @@ -355,22 +355,26 @@ impl ModuleT for AccountCreate { let account_name = args.account_name.trim(); let account_name = (!account_name.is_empty()).then_some(account_name.to_string()); - let account_kind = AccountKind::Bip32; + // let account_kind = AccountKind::Bip32; let wallet_secret = Secret::from(args.wallet_secret); let payment_secret = args.prv_key_data_info.as_ref().and_then(|secret| { secret.requires_bip39_passphrase().then_some(Secret::from(args.payment_secret)) }); - let prv_key_data_id = args.prv_key_data_info.as_ref().unwrap().id(); + let prv_key_data_id = *args.prv_key_data_info.as_ref().unwrap().id(); - let account_args = AccountCreateArgs { - account_name, - account_kind, - wallet_secret, - payment_secret, - }; + let prv_key_data_args = PrvKeyDataArgs { prv_key_data_id, payment_secret }; + let account_args = AccountCreateArgsBip32 { account_name, account_index: None }; + let account_create_args = AccountCreateArgs::Bip32 { prv_key_data_args, account_args }; + // { + // account_name, + // account_kind, + // wallet_secret, + // payment_secret, + // }; - Ok(wallet.accounts_create(*prv_key_data_id, account_args).await?) + let account_descriptor = wallet.accounts_create(wallet_secret, account_create_args).await?; + Ok(account_descriptor) }); } diff --git a/core/src/modules/account_manager/menus.rs b/core/src/modules/account_manager/menus.rs index e8798ee..10da447 100644 --- a/core/src/modules/account_manager/menus.rs +++ b/core/src/modules/account_manager/menus.rs @@ -26,8 +26,8 @@ impl WalletMenu { .auto_shrink([true; 2]) .show(ui, |ui| { - let wallet_list = core.wallet_list().clone(); - + let mut wallet_list = core.wallet_list().clone(); + wallet_list.sort(); wallet_list.into_iter().for_each(|wallet_descriptor| { let title = if let Some(title) = wallet_descriptor.title.clone() { diff --git a/core/src/modules/account_manager/mod.rs b/core/src/modules/account_manager/mod.rs index 92f6524..3d4c67b 100644 --- a/core/src/modules/account_manager/mod.rs +++ b/core/src/modules/account_manager/mod.rs @@ -215,6 +215,10 @@ impl ModuleT for AccountManager { self.state = AccountManagerState::Select; } + fn secure(&self) -> bool { + true + } + // fn reload(&mut self, core : &mut Core) { // if let AccountManagerState::Overview { account } = self.state.clone() { // let account_id = account.id(); @@ -280,6 +284,8 @@ impl AccountManager { match self.state.clone() { AccountManagerState::Select => { + core.apply_mobile_style(ui); + if !core.state().is_open() { core.select::(); } else if let Some(account_collection) = core.account_collection() { @@ -357,6 +363,17 @@ impl AccountManager { ui.separator(); AccountMenu::new().render(core,ui,self,rc, screen_rect_height * 0.8); ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + + if ui.add(Label::new(RichText::new(egui_phosphor::light::LOCK).size(18.)).sense(Sense::click())).clicked() { + let wallet = core.wallet().clone(); + spawn(async move { + wallet.wallet_close().await?; + Ok(()) + }); + } + + ui.separator(); + ToolsMenu::new().render(core,ui,self, rc, screen_rect_height * 0.8); ui.separator(); diff --git a/core/src/modules/mod.rs b/core/src/modules/mod.rs index 87e770e..e959312 100644 --- a/core/src/modules/mod.rs +++ b/core/src/modules/mod.rs @@ -49,6 +49,10 @@ pub trait ModuleT: Downcast { false } + fn secure(&self) -> bool { + false + } + fn style(&self) -> ModuleStyle { // ModuleStyle::Large ModuleStyle::Default @@ -152,6 +156,10 @@ impl Module { self.inner.module.borrow_mut().modal() } + pub fn secure(&self) -> bool { + self.inner.module.borrow_mut().secure() + } + pub fn type_id(&self) -> TypeId { self.inner.type_id } @@ -179,6 +187,12 @@ impl Module { } } +impl std::fmt::Debug for Module { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.inner.name) + } +} + impl From>> for Module where T: ModuleT + 'static, diff --git a/core/src/modules/private_key_create.rs b/core/src/modules/private_key_create.rs index 55a1e7b..b0b966c 100644 --- a/core/src/modules/private_key_create.rs +++ b/core/src/modules/private_key_create.rs @@ -3,8 +3,7 @@ use crate::imports::*; use kaspa_bip32::Mnemonic; use kaspa_wallet_core::runtime::{PrvKeyDataCreateArgs, WalletCreateArgs}; -use kaspa_wallet_core::storage::interface::AccessContext; -use kaspa_wallet_core::storage::{AccessContextT, AccountKind}; +use kaspa_wallet_core::storage::AccountKind; pub enum MnemonicSize { Words12, diff --git a/core/src/modules/wallet_create.rs b/core/src/modules/wallet_create.rs index c5f8993..76fb15e 100644 --- a/core/src/modules/wallet_create.rs +++ b/core/src/modules/wallet_create.rs @@ -1,9 +1,8 @@ use crate::imports::*; -use kaspa_wallet_core::api::WalletCreateResponse; -use kaspa_wallet_core::runtime::{AccountKind, AccountCreateArgs, PrvKeyDataCreateArgs, WalletCreateArgs}; +use kaspa_wallet_core::runtime::{AccountCreateArgs, PrvKeyDataCreateArgs, WalletCreateArgs}; use slug::slugify; -use kaspa_bip32::WordCount; +use kaspa_bip32::{WordCount, Mnemonic, Language}; use crate::utils::{secret_score, secret_score_to_text}; #[derive(Default, Debug, Clone, Copy, Eq, PartialEq)] @@ -731,30 +730,47 @@ impl ModuleT for WalletCreate { let wallet_secret = Secret::from(args.wallet_secret); let payment_secret = args.enable_payment_secret.then_some(Secret::from(args.payment_secret)); - let account_kind = AccountKind::Bip32; let wallet_args = WalletCreateArgs::new( args.wallet_name.is_not_empty().then_some(args.wallet_name), args.wallet_filename.is_not_empty().then_some(args.wallet_filename), args.enable_phishing_hint.then_some(args.phishing_hint.into()), - wallet_secret.clone(), + // wallet_secret.clone(), false ); + + wallet.clone().wallet_create(wallet_secret.clone(), wallet_args).await?; + + let mnemonic = Mnemonic::random(args.word_count, Language::default())?; + let mnemonic_phrase_string = mnemonic.phrase_string(); + // let account_kind = AccountKind::Bip32; + let prv_key_data_args = PrvKeyDataCreateArgs::new( None, - wallet_secret.clone(), payment_secret.clone(), + mnemonic_phrase_string.clone(), + // mnemonic.phrase_string(), + //payment_secret.clone(), // - TODO - WordCount::Words12.into(), + // WordCount::Words12.into(), ); - let account_args = AccountCreateArgs::new( - args.account_name.is_not_empty().then_some(args.account_name), - account_kind, - wallet_secret.clone(), + + let prv_key_data_id = wallet.clone().prv_key_data_create(wallet_secret.clone(), prv_key_data_args).await?; + + let account_create_args = AccountCreateArgs::new_bip32( + prv_key_data_id, payment_secret.clone(), + args.account_name.is_not_empty().then_some(args.account_name), + None, + // account_kind, + // wallet_secret.clone(), + // payment_secret.clone(), ); - let WalletCreateResponse { mnemonic, wallet_descriptor: _, account_descriptor, storage_descriptor: _ } = wallet.wallet_create(wallet_args, prv_key_data_args, account_args).await?; - Ok((Arc::new(mnemonic), account_descriptor)) + let account_descriptor = wallet.clone().accounts_create(wallet_secret, account_create_args).await?; + + // let WalletCreateResponse { mnemonic, wallet_descriptor: _, account_descriptor, storage_descriptor: _ } = + // wallet.wallet_create(wallet_secret, wallet_args, prv_key_data_args, account_args).await?; + Ok((Arc::new(mnemonic_phrase_string), account_descriptor)) }); } diff --git a/core/src/modules/wallet_open.rs b/core/src/modules/wallet_open.rs index 550c3a7..e46b87b 100644 --- a/core/src/modules/wallet_open.rs +++ b/core/src/modules/wallet_open.rs @@ -39,6 +39,10 @@ impl ModuleT for WalletOpen { ModuleStyle::Mobile } + fn secure(&self) -> bool { + true + } + fn render( &mut self, core: &mut Core, @@ -55,6 +59,7 @@ impl ModuleT for WalletOpen { State::Select => { let has_stack = core.has_stack(); + println!("stack: {:?}", core.stack); let core = Rc::new(RefCell::new(core)); Panel::new(self) @@ -64,7 +69,9 @@ impl ModuleT for WalletOpen { ui.label(text); }) .with_body(|this, ui| { - for wallet_descriptor in core.borrow_mut().wallet_list.clone().into_iter() { + let mut wallet_descriptor_list = core.borrow_mut().wallet_list.clone(); + wallet_descriptor_list.sort(); //sort_by(|a, b| a.title.cmp(&b.title)); + for wallet_descriptor in wallet_descriptor_list.into_iter() { if ui.add_sized(theme_style().large_button_size(), CompositeButton::image_and_text( Composite::icon(egui_phosphor::thin::FINGERPRINT_SIMPLE), wallet_descriptor.title.as_deref().unwrap_or("NO NAME"), diff --git a/core/src/primitives/account.rs b/core/src/primitives/account.rs index d644fdf..c6e2558 100644 --- a/core/src/primitives/account.rs +++ b/core/src/primitives/account.rs @@ -227,7 +227,8 @@ impl AccountSelectorButtonExtension for Ui { let icon = if selected { // Composite::icon(egui_phosphor::thin::CHECK) - Composite::icon(egui_phosphor::thin::ARROW_FAT_RIGHT) + // Composite::icon(egui_phosphor::thin::ARROW_FAT_RIGHT) + Composite::icon(egui_phosphor::thin::QUEUE) } else { Composite::icon(egui_phosphor::thin::LIST_DASHES) }; diff --git a/core/src/runtime/mod.rs b/core/src/runtime/mod.rs index 7768889..31f33ed 100644 --- a/core/src/runtime/mod.rs +++ b/core/src/runtime/mod.rs @@ -22,17 +22,18 @@ pub struct Inner { // services: Mutex>>, services: Mutex>>, repaint_service: Arc, + application_events: ApplicationEventsChannel, + egui_ctx: egui::Context, + is_running: Arc, + start_time: Instant, + system: Option, + kaspa: Arc, peer_monitor_service: Arc, metrics_service: Arc, block_dag_monitor_service: Arc, market_monitor_service: Arc, update_monitor_service: Arc, - application_events: ApplicationEventsChannel, - egui_ctx: egui::Context, - is_running: Arc, - start_time: Instant, - system: Option, } /// Runtime is a core component of the Kaspa NG application responsible for @@ -63,6 +64,7 @@ impl Runtime { application_events.clone(), settings, )); + let update_monitor_service = Arc::new(UpdateMonitorService::new( application_events.clone(), settings, @@ -75,6 +77,7 @@ impl Runtime { metrics_service.clone(), block_dag_monitor_service.clone(), market_monitor_service.clone(), + #[cfg(not(target_arch = "wasm32"))] update_monitor_service.clone(), ]); diff --git a/core/src/runtime/services/kaspa/mod.rs b/core/src/runtime/services/kaspa/mod.rs index 169e590..346cf72 100644 --- a/core/src/runtime/services/kaspa/mod.rs +++ b/core/src/runtime/services/kaspa/mod.rs @@ -4,8 +4,9 @@ use crate::imports::*; use crate::runtime::Service; pub use futures::{future::FutureExt, select, Future}; #[allow(unused_imports)] -use kaspa_wallet_core::rpc::{NotificationMode, Rpc, RpcCtl, WrpcEncoding}; -use kaspa_wallet_core::{ConnectOptions, ConnectStrategy}; +use kaspa_wallet_core::rpc::{ + ConnectOptions, ConnectStrategy, NotificationMode, Rpc, RpcCtl, WrpcEncoding, +}; cfg_if! { if #[cfg(not(target_arch = "wasm32"))] { diff --git a/core/src/runtime/services/update_monitor.rs b/core/src/runtime/services/update_monitor.rs index d6013af..d701a6e 100644 --- a/core/src/runtime/services/update_monitor.rs +++ b/core/src/runtime/services/update_monitor.rs @@ -28,41 +28,41 @@ impl UpdateMonitorService { } } - pub fn rpc_api(&self) -> Option> { - self.rpc_api.lock().unwrap().clone() - } - - pub fn enable(&self) { - self.service_events - .sender - .try_send(UpdateMonitorEvents::Enable) - .unwrap(); - } - - pub fn disable(&self) { - self.service_events - .sender - .try_send(UpdateMonitorEvents::Disable) - .unwrap(); - } + // pub fn rpc_api(&self) -> Option> { + // self.rpc_api.lock().unwrap().clone() + // } + + // pub fn enable(&self) { + // self.service_events + // .sender + // .try_send(UpdateMonitorEvents::Enable) + // .unwrap(); + // } + + // pub fn disable(&self) { + // self.service_events + // .sender + // .try_send(UpdateMonitorEvents::Disable) + // .unwrap(); + // } } #[async_trait] impl Service for UpdateMonitorService { fn name(&self) -> &'static str { - "peer-monitor" + "update-monitor" } - async fn attach_rpc(self: Arc, rpc_api: &Arc) -> Result<()> { - self.rpc_api.lock().unwrap().replace(rpc_api.clone()); - Ok(()) - } + // async fn attach_rpc(self: Arc, rpc_api: &Arc) -> Result<()> { + // self.rpc_api.lock().unwrap().replace(rpc_api.clone()); + // Ok(()) + // } - async fn detach_rpc(self: Arc) -> Result<()> { - self.rpc_api.lock().unwrap().take(); + // async fn detach_rpc(self: Arc) -> Result<()> { + // self.rpc_api.lock().unwrap().take(); - Ok(()) - } + // Ok(()) + // } async fn spawn(self: Arc) -> Result<()> { let this = self.clone(); @@ -78,6 +78,8 @@ impl Service for UpdateMonitorService { continue; } + #[cfg(not(target_arch = "wasm32"))] + let _ = check_version().await; }, msg = this.as_ref().service_events.receiver.recv().fuse() => { if let Ok(event) = msg { diff --git a/core/src/state.rs b/core/src/state.rs index 891938e..fbd64be 100644 --- a/core/src/state.rs +++ b/core/src/state.rs @@ -1,5 +1,5 @@ use kaspa_consensus_core::network::NetworkId; -use kaspa_wallet_core::SyncState; +use kaspa_wallet_core::events::SyncState; #[derive(Default)] pub struct State { diff --git a/core/src/sync.rs b/core/src/sync.rs index 873624e..987765e 100644 --- a/core/src/sync.rs +++ b/core/src/sync.rs @@ -1,5 +1,5 @@ use crate::imports::*; -use kaspa_wallet_core::SyncState; +use kaspa_wallet_core::events::SyncState; const SYNC_STAGES: usize = 5; diff --git a/resources/i18n/i18n.json b/resources/i18n/i18n.json index c07a641..d40e14c 100644 --- a/resources/i18n/i18n.json +++ b/resources/i18n/i18n.json @@ -19,8 +19,8 @@ "fi": "Finnish", "lt": "Lithuanian", "sv": "Swedish", - "es": "Español", "uk": "Ukrainian", + "es": "Español", "af": "Afrikaans", "et": "Esti", "en": "English", @@ -65,10 +65,10 @@ "pa": {}, "fa": {}, "fi": {}, + "es": {}, "lt": {}, "sv": {}, "uk": {}, - "es": {}, "af": {}, "et": {}, "en": { @@ -121,6 +121,7 @@ "Median T": "Median T", "DAA Offset": "DAA Offset", "Disables node connectivity (Offline Mode).": "Disables node connectivity (Offline Mode).", + "Total Tx/s": "Total Tx/s", "A binary at another location is spawned a child process (experimental, for development purposes only).": "A binary at another location is spawned a child process (experimental, for development purposes only).", "System": "System", "Virtual Memory": "Virtual Memory", @@ -160,16 +161,16 @@ "Good": "Good", "Secret is too weak": "Secret is too weak", "DAA": "DAA", - "Network": "Network", + "Signature Type": "Signature Type", "Time Offset:": "Time Offset:", "Net Rx/s": "Net Rx/s", - "Signature Type": "Signature Type", + "Network": "Network", "gRPC Tx": "gRPC Tx", "Dependencies": "Dependencies", "Active p2p Peers": "Active p2p Peers", "Disable Password Score Restrictions": "Disable Password Score Restrictions", - "Chain Blocks": "Chain Blocks", "GitHub Release Page for": "GitHub Release Page for", + "Chain Blocks": "Chain Blocks", "Check for Software Updates via GitHub": "Check for Software Updates via GitHub", "p2p Tx": "p2p Tx", "p2p Rx": "p2p Rx", @@ -191,6 +192,7 @@ "Processed Mass Counts": "Processed Mass Counts", "Allow custom arguments for the Rusty Kaspa daemon": "Allow custom arguments for the Rusty Kaspa daemon", "User Agent": "User Agent", + "Total Rx/s": "Total Rx/s", "bye!": "bye!", "The node is spawned as a child daemon process (recommended).": "The node is spawned as a child daemon process (recommended).", "Receive Address": "Receive Address",