Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Sep 12, 2024
1 parent e7518a3 commit 66c5ac8
Show file tree
Hide file tree
Showing 12 changed files with 681 additions and 213 deletions.
98 changes: 49 additions & 49 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions core/resources/i18n/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3300,6 +3300,7 @@
"Network Difficulty": "Network Difficulty",
"Network Fees:": "Network Fees:",
"Network Interface": "Network Interface",
"Network Load:": "Network Load:",
"Network Peers": "Network Peers",
"Never share your mnemonic with anyone!": "Never share your mnemonic with anyone!",
"No peers": "No peers",
Expand Down Expand Up @@ -3348,6 +3349,7 @@
"Please note that this is an alpha release. Until this message is removed, please avoid using the wallet with mainnet funds.": "Please note that this is an alpha release. Until this message is removed, please avoid using the wallet with mainnet funds.",
"Please note, copying to clipboard carries a risk of exposing your mnemonic to malware.": "Please note, copying to clipboard carries a risk of exposing your mnemonic to malware.",
"Please select 'Apply' and restart the application.": "Please select 'Apply' and restart the application.",
"Please select account to scan": "Please select account to scan",
"Please select an account type": "Please select an account type",
"Please select the private key to export": "Please select the private key to export",
"Please select the private key type you would like to import in the new wallet": "Please select the private key type you would like to import in the new wallet",
Expand All @@ -3360,12 +3362,14 @@
"Please wait...": "Please wait...",
"Presets": "Presets",
"Price": "Price",
"Priority": "Priority",
"Private Key Mnemonic": "Private Key Mnemonic",
"Processed Bodies": "Processed Bodies",
"Processed Dependencies": "Processed Dependencies",
"Processed Headers": "Processed Headers",
"Processed Mass Counts": "Processed Mass Counts",
"Processed Transactions": "Processed Transactions",
"Processing...": "Processing...",
"Protocol:": "Protocol:",
"Public Node": "Public Node",
"Public Nodes": "Public Nodes",
Expand All @@ -3389,6 +3393,8 @@
"Resulting daemon arguments:": "Resulting daemon arguments:",
"Rust Wallet SDK": "Rust Wallet SDK",
"Rusty Kaspa on GitHub": "Rusty Kaspa on GitHub",
"Scanner": "Scanner",
"Scanning complete...": "Scanning complete...",
"Secret is too weak": "Secret is too weak",
"Secret score:": "Secret score:",
"Select Account": "Select Account",
Expand All @@ -3415,6 +3421,7 @@
"Stage": "Stage",
"Starting...": "Starting...",
"Statistics": "Statistics",
"Stop": "Stop",
"Stor Read": "Stor Read",
"Stor Write": "Stor Write",
"Storage": "Storage",
Expand Down Expand Up @@ -3451,6 +3458,7 @@
"Theme Color:": "Theme Color:",
"Theme Style": "Theme Style",
"Theme Style:": "Theme Style:",
"This option will transfer any discovered funds to the first change address of this account.": "This option will transfer any discovered funds to the first change address of this account.",
"This wallet will never ask you for this mnemonic phrase unless you manually initiate a private key recovery.": "This wallet will never ask you for this mnemonic phrase unless you manually initiate a private key recovery.",
"Threshold": "Threshold",
"Time Offset:": "Time Offset:",
Expand All @@ -3464,6 +3472,7 @@
"Transaction Fees": "Transaction Fees",
"Transactions": "Transactions",
"Transactions:": "Transactions:",
"Transfer funds during scan": "Transfer funds during scan",
"Type": "Type",
"UTXO Manager": "UTXO Manager",
"UTXOs": "UTXOs",
Expand Down
15 changes: 12 additions & 3 deletions core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use workflow_i18n::*;
use workflow_wasm::callback::CallbackMap;
pub const TRANSACTION_PAGE_SIZE: u64 = 20;
pub const MAINNET_EXPLORER: &str = "https://explorer.kaspa.org";
pub const TESTNET10_EXPLORER: &str = "https://explorer-testnet.kaspa.ws";
pub const TESTNET10_EXPLORER: &str = "https://explorer-tn10.kaspa.org";
pub const TESTNET11_EXPLORER: &str = "https://explorer-tn11.kaspa.org";

pub enum Exception {
Expand Down Expand Up @@ -59,7 +59,8 @@ pub struct Core {
pub network_pressure: NetworkPressure,
notifications: Notifications,
pub storage: Storage,
pub feerate : Option<Arc<RpcFeeEstimate>>,
// pub feerate : Option<Arc<RpcFeeEstimate>>,
pub feerate : Option<FeerateEstimate>,
}

impl Core {
Expand Down Expand Up @@ -733,7 +734,15 @@ impl Core {
.update_mempool_size(mempool_size, &self.settings.node.network);
}
Events::Feerate { feerate } => {
self.feerate = feerate;
if let Some(feerate) = feerate {
if let Some(average) = self.feerate.as_mut() {
average.insert(feerate.as_ref());
} else {
self.feerate = Some(FeerateEstimate::new(feerate.as_ref()));
}
} else {
self.feerate = None;
}
}
Events::Exit => {
cfg_if! {
Expand Down
2 changes: 1 addition & 1 deletion core/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub use kaspa_consensus_core::network::{NetworkId, NetworkType};
pub use kaspa_consensus_core::Hash as KaspaHash;
pub use kaspa_metrics_core::MetricsSnapshot;
pub use kaspa_rpc_core::api::rpc::RpcApi;
pub use kaspa_rpc_core::RpcFeeEstimate;
pub use kaspa_rpc_core::{RpcFeeEstimate,RpcFeerateBucket};
pub use kaspa_utils::hex::{FromHex, ToHex};
pub use kaspa_utils::{hashmap::GroupExtension, networking::ContextualNetAddress};
pub use kaspa_wallet_core::prelude::{
Expand Down
Loading

0 comments on commit 66c5ac8

Please sign in to comment.