diff --git a/src/Features/Blockcore.Features.ColdStaking/UI/NavItem.cs b/src/Features/Blockcore.Features.ColdStaking/UI/NavItem.cs index d4f96f14b..e17f87f1d 100644 --- a/src/Features/Blockcore.Features.ColdStaking/UI/NavItem.cs +++ b/src/Features/Blockcore.Features.ColdStaking/UI/NavItem.cs @@ -4,7 +4,7 @@ namespace Blockcore.Features.Wallet.UI { public class ColdStakingNavigationItem : INavigationItem { - public string Name => "ColdStaking"; + public string Name => "Cold Staking"; public string Navigation => "ColdStaking"; } diff --git a/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStake.razor b/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStake.razor index f815449cc..75d33774b 100644 --- a/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStake.razor +++ b/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStake.razor @@ -11,11 +11,33 @@ @if (!NodeDeployments.GetFlags().ScriptFlags.HasFlag(ScriptVerify.CheckColdStakeVerify)) { -

Coldstaking is not activated

+

Cold staking is not activated

return; } -

Coldstaking Wallets

+

Cold staking wallets

+ +

Enable cold staking on an existing wallet.

+ +
+
+
+ Wallet Name: +
+ +
+ +
+
+ Password: +
+ +
+ +
+ +
+

Information about the deployed wallets.

@@ -23,10 +45,10 @@ - - + + - + @@ -66,7 +88,7 @@ var hotAccountBalance = ColdStakingManager.GetBalances(walletName, hotStakingAccount.Name).Single(); - + @@ -103,26 +125,6 @@ }
Wallet / accountConfirmed blanaceWallet / AccountConfirmed balance Unconfirmed balanceActioneAction
@walletName /@hotStakingAccount.Name @walletName / @hotStakingAccount.Name @hotAccountBalance.AmountConfirmed @hotAccountBalance.AmountUnconfirmed @@ -94,7 +116,7 @@ @if (accountBalance.AmountConfirmed + accountBalance.AmountUnconfirmed > 0) { - + }
-
-
-
- Wallet Name: -
- -
- -
-
- Password: -
- -
- -
- -
-
- } @code @@ -146,8 +148,8 @@ private void CreateColdStakeAccount() { - if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; } - if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "No WalletName"; return; } + if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; } + if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "Please enter a wallet name"; return; } this.Alert = string.Empty; this.ColdStakingManager.GetOrCreateColdStakingAccount(this.WalletName, true, this.Password); diff --git a/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeSetup.razor b/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeSetup.razor index dccc6db8f..610435b3f 100644 --- a/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeSetup.razor +++ b/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeSetup.razor @@ -20,19 +20,31 @@ @{ var accountBalance = this.WalletManager.GetBalances(walletname, "account 0").Single(); -

Amount Confirmed: @accountBalance.AmountConfirmed

-

Amount Unconfirmed: @accountBalance.AmountUnconfirmed

-

Spendable Amount: @accountBalance.SpendableAmount

- + + + + + + + + + + + + + + + +
Amount ConfirmedAmount UnconfirmedSpendable Amount
@accountBalance.AmountConfirmed@accountBalance.AmountUnconfirmed@accountBalance.SpendableAmount

- ColdWalletAddress: + ColdWalletAddress:
- from wallet: @walletname + from wallet: @walletname
@@ -45,34 +57,34 @@
- HotWalletAddress: + HotWalletAddress:
- Amount: + Amount:
- @this.Network.CoinTicker.ToUpper() + @this.Network.CoinTicker.ToUpper()
- Fee: + Fee:
- Optional (default to low) + Optional (default to low)
- Password: + Password:
@@ -156,9 +168,9 @@ private async Task Setup() { - if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; } - if (string.IsNullOrEmpty(this.ColdWalletAddress)) { this.Alert = "No ColdWalletAddress"; return; } - if (string.IsNullOrEmpty(this.HotWalletAddress)) { this.Alert = "No HotWalletAddress"; return; } + if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; } + if (string.IsNullOrEmpty(this.ColdWalletAddress)) { this.Alert = "Your cold wallet address is missing"; return; } + if (string.IsNullOrEmpty(this.HotWalletAddress)) { this.Alert = "Your hot wallet address is missing"; return; } this.Alert = string.Empty; diff --git a/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeWithdraw.razor b/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeWithdraw.razor index 385724e17..d79c8d80c 100644 --- a/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeWithdraw.razor +++ b/src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeWithdraw.razor @@ -30,14 +30,14 @@
- Password: + Password:
- Address: + Address:
@@ -45,21 +45,21 @@
- Amount: + Amount:
- @this.Network.CoinTicker.ToUpper() + @this.Network.CoinTicker.ToUpper()
- Fee: + Fee:
- Optional (default to low) + Optional (default to low)
@@ -112,8 +112,8 @@ private async Task Withdraw() { - if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; } - if (string.IsNullOrEmpty(this.Address)) { this.Alert = "No Address"; return; } + if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; } + if (string.IsNullOrEmpty(this.Address)) { this.Alert = "Please enter a withdrawal address"; return; } this.Alert = string.Empty; try diff --git a/src/Features/Blockcore.Features.Miner/UI/Pages/Stake.razor b/src/Features/Blockcore.Features.Miner/UI/Pages/Stake.razor index b773e1c75..66e25c972 100644 --- a/src/Features/Blockcore.Features.Miner/UI/Pages/Stake.razor +++ b/src/Features/Blockcore.Features.Miner/UI/Pages/Stake.razor @@ -35,8 +35,8 @@ - - + + @@ -61,14 +61,14 @@ {
- Wallet Name: + Wallet Name:
- Password: + Password:
@@ -139,8 +139,8 @@ private void StartStaking() { - if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; } - if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "No password"; return; } + if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; } + if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "Please enter a wallet name"; return; } var wallet = this.WalletManager.GetWallet(this.WalletName); diff --git a/src/Features/Blockcore.Features.NodeHost/UI/Pages/PeersNodes.razor b/src/Features/Blockcore.Features.NodeHost/UI/Pages/AddNodes.razor similarity index 91% rename from src/Features/Blockcore.Features.NodeHost/UI/Pages/PeersNodes.razor rename to src/Features/Blockcore.Features.NodeHost/UI/Pages/AddNodes.razor index 7ed6708f3..b2ddc3595 100644 --- a/src/Features/Blockcore.Features.NodeHost/UI/Pages/PeersNodes.razor +++ b/src/Features/Blockcore.Features.NodeHost/UI/Pages/AddNodes.razor @@ -1,12 +1,12 @@ -@page "/peers-nodes" +@page "/add-nodes" @using Blockcore.Utilities.Extensions @inject Blockcore.Connection.IConnectionManager ConnectionManager -

Connected peers

+

Add new nodes

-

Information about connected peers.

+

Add the IP address of known network peers.

@{
diff --git a/src/Features/Blockcore.Features.NodeHost/UI/Pages/Logs.razor b/src/Features/Blockcore.Features.NodeHost/UI/Pages/Logs.razor index 9dd077305..042863632 100644 --- a/src/Features/Blockcore.Features.NodeHost/UI/Pages/Logs.razor +++ b/src/Features/Blockcore.Features.NodeHost/UI/Pages/Logs.razor @@ -5,7 +5,7 @@

Node logs

@{ - +
+@(((Blockcore.FullNode)this.FullNode).LastLogOutput.TrimStart(' '))
+
} \ No newline at end of file diff --git a/src/Features/Blockcore.Features.NodeHost/UI/Pages/Peers.razor b/src/Features/Blockcore.Features.NodeHost/UI/Pages/Peers.razor index e3b7b24b4..2fa770b77 100644 --- a/src/Features/Blockcore.Features.NodeHost/UI/Pages/Peers.razor +++ b/src/Features/Blockcore.Features.NodeHost/UI/Pages/Peers.razor @@ -9,7 +9,7 @@ @{
- +

Wallet/accountBlanaceWallet / AccountBalance
@@ -37,8 +37,8 @@ @code { - private void NavigateToPeernodes() + private void NavigateToAddNodes() { - NavigationManager.NavigateTo("peers-nodes"); + NavigationManager.NavigateTo("add-nodes"); } } \ No newline at end of file diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletAccount.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletAccount.razor index 7dc90f2cd..a5b8ef2fc 100644 --- a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletAccount.razor +++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletAccount.razor @@ -9,28 +9,32 @@ @inject IWalletManager WalletManager @inject Network Network - -
- -

Wallet Account

-

Information about @walletname / @accountname

- +

Wallet Account: @walletname / @accountname

@{ var accountBalance = this.WalletManager.GetBalances(walletname, accountname).Single();
- -

Amount Confirmed: @accountBalance.AmountConfirmed

-

Amount Unconfirmed: @accountBalance.AmountUnconfirmed

-

Spendable Amount: @accountBalance.SpendableAmount

- - + -

+
+ + + + + + + + + + + + + + +
Amount ConfirmedAmount UnconfirmedSpendable Amount
@accountBalance.AmountConfirmed@accountBalance.AmountUnconfirmed@accountBalance.SpendableAmount
+

Wallet History

@@ -40,10 +44,11 @@ - - - + + + + @@ -52,10 +57,11 @@ foreach (var transaction in history.TransactionsHistory) { - - - + + + + } } diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletCreate.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletCreate.razor index 8d627a465..c89bf59d0 100644 --- a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletCreate.razor +++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletCreate.razor @@ -1,4 +1,4 @@ -@page "/walletcrate" +@page "/walletcreate" @using Blockcore.Features.Wallet.Interfaces @using NBitcoin; @@ -9,50 +9,46 @@ @inject Blockcore.Utilities.IDateTimeProvider DateTimeProvider @inject IWalletSyncManager WalletSyncManager - -
-

Create a Wallet

- +

Create your wallet by generating a Mnemonic & adding an optional phrase. Then give your wallet a name & password.

@{ -
+ +
+ +
+ +
- Mnemonic + Mnemonic:
- +

Important: The Mnemonic is your wallet and must be kept safe and secure.

-
+
- Passphrase (optional): + Passphrase (optional):
- +
-

Important: The Passphrase is permanently linked to the wallet and must be kept safe and secure.

+

Important: The Passphrase is permanently linked to the wallet and must be kept safe and secure.

-
- -
-
+
- Wallet name: + Wallet name:
- +
-
+
- Wallet Password: + Wallet Password:
- +
-
@@ -61,13 +57,11 @@ } @code { - public string WalletName { get; set; } public string AccountName { get; set; } public string Mnemonic { get; set; } private string Password { get; set; } private string Passphrase { get; set; } - string Alert { get; set; } private void GenerateMnemonic() @@ -90,28 +84,11 @@ { NavigationManager.NavigateTo("wallets"); } - - private void RecoverWallet() - { - if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No Password"; return; } - if (string.IsNullOrEmpty(this.Mnemonic)) { this.Alert = "No Mnemonic"; return; } - if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "No WalletName"; return; } - - if (this.Passphrase == null) - this.Passphrase = string.Empty; - - this.Alert = string.Empty; - - var wallet = this.WalletManager.RecoverWallet(this.Password, this.WalletName, this.Mnemonic, this.DateTimeProvider.GetUtcNow(), passphrase: this.Passphrase); - - NavigationManager.NavigateTo("walletaccount/" + WalletName + "/account 0"); - } - private void CreateWallet() { - if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No Password"; return; } - if (string.IsNullOrEmpty(this.Mnemonic)) { this.Alert = "No Mnemonic"; return; } - if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "No WalletName"; return; } + if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; } + if (string.IsNullOrEmpty(this.Mnemonic)) { this.Alert = "Ensure that you have generated a new Mnemonic"; return; } + if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "Please enter a wallet name"; return; } if (this.Passphrase == null) this.Passphrase = string.Empty; diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletReceive.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletReceive.razor index 0a97e262b..d3d918f5c 100644 --- a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletReceive.razor +++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletReceive.razor @@ -7,11 +7,6 @@ @inject IWalletManager WalletManager @inject NavigationManager NavigationManager - -
-

Receive Coins

Generate receive address for @walletname / @accountname

diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletRecover.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletRecover.razor new file mode 100644 index 000000000..7992a7148 --- /dev/null +++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletRecover.razor @@ -0,0 +1,94 @@ +@page "/walletrecover" + +@using Blockcore.Features.Wallet.Interfaces +@using NBitcoin; +@using Blockcore.Features.Wallet.Api.Controllers + +@inject NavigationManager NavigationManager +@inject IWalletManager WalletManager +@inject Blockcore.Utilities.IDateTimeProvider DateTimeProvider +@inject IWalletSyncManager WalletSyncManager + +

Recover a Wallet

+

Recover your wallet by entering your Mnemonic & your passphrase. Then give your wallet a name & password.

+@{ +
+
+ Mnemonic +
+ +
+

Reminder: The Mnemonic is your wallet and must be kept safe and secure.

+ +
+
+ Passphrase (optional): +
+ +
+

Reminder: The Passphrase is permanently linked to the wallet and must be kept safe and secure.

+ +
+
+ Wallet name: +
+ +
+ +
+
+ Wallet Password: +
+ +
+ + + +
+
+
@Alert
+
+} + +@code { + + public string WalletName { get; set; } + public string AccountName { get; set; } + public string Mnemonic { get; set; } + private string Password { get; set; } + private string Passphrase { get; set; } + + string Alert { get; set; } + + private void NavigateToReceiveWallet(string walletName, string accountname) + { + NavigationManager.NavigateTo("walletreceive/" + walletName + "/" + accountname); + } + + private void NavigateToSendWallet(string walletName, string accountname) + { + NavigationManager.NavigateTo("walletsend/" + walletName + "/" + accountname); + } + + private void NavigateToWallets() + { + NavigationManager.NavigateTo("wallets"); + } + + private void RecoverWallet() + { + if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; } + if (string.IsNullOrEmpty(this.Mnemonic)) { this.Alert = "Ensure that you have entered your Mnemonic"; return; } + if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "Please enter a wallet name"; return; } + + if (this.Passphrase == null) + this.Passphrase = string.Empty; + + this.Alert = string.Empty; + + var wallet = this.WalletManager.RecoverWallet(this.Password, this.WalletName, this.Mnemonic, this.DateTimeProvider.GetUtcNow(), passphrase: this.Passphrase); + + NavigationManager.NavigateTo("walletaccount/" + WalletName + "/account 0"); + } + +} \ No newline at end of file diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletSend.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletSend.razor index c67b46660..2ce1d9d7b 100644 --- a/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletSend.razor +++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/WalletSend.razor @@ -14,14 +14,7 @@ @inject IWalletTransactionHandler WalletTransactionHandler @inject IBroadcasterManager BroadcasterManager - -
- -

Send Coins

- -

Send coins from account @walletname / @accountname

+

Send Coins: @walletname / @accountname

@{ @@ -29,40 +22,54 @@
-

Amount Confirmed: @accountBalance.AmountConfirmed

-

Amount Unconfirmed: @accountBalance.AmountUnconfirmed

-

Spendable Amount: @accountBalance.SpendableAmount

+
To AddressAmountConfirmed In Block TypeBlockAmountTo AddressTxID
@transaction.ToAddress@transaction.Amount@transaction.ConfirmedInBlock @transaction.Type@transaction.ConfirmedInBlock@transaction.Amount@transaction.ToAddress@transaction.Id
+ + + + + + + + + + + + + + +
Amount ConfirmedAmount UnconfirmedSpendable Amount
@accountBalance.AmountConfirmed@accountBalance.AmountUnconfirmed@accountBalance.SpendableAmount
+
- To Address: + To Address:
- Amount: + Amount:
- @this.Network.CoinTicker.ToUpper() + @this.Network.CoinTicker.ToUpper()
- Fee: + Fee:
- Optional (default to low) + Optional (default to low)
- Wallet Password: + Wallet Password:
@@ -82,7 +89,7 @@
- Raw Transaction + Raw Transaction
@@ -151,13 +158,13 @@ private async Task Broadcast() { - if (string.IsNullOrEmpty(this.TransactionHex)) { this.Alert = "No trx"; return; } + if (string.IsNullOrEmpty(this.TransactionHex)) { this.Alert = "No transaction details, please click send coins first"; return; } this.Alert = string.Empty; if (!this.ConnectionManager.ConnectedPeers.Any()) { - this.Alert = "No peers connected"; + this.Alert = "No peers connected. You need connections before a transaction can be brodcast to the network."; return; } @@ -169,7 +176,7 @@ if (transactionBroadCastEntry.TransactionBroadcastState == TransactionBroadcastState.FailedBroadcast) { - this.Alert = "Error occurred: " + transactionBroadCastEntry.ErrorMessage; + this.Alert = "An error occurred: " + transactionBroadCastEntry.ErrorMessage; return; } @@ -178,10 +185,10 @@ private void SendCoins() { - if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; } - if (string.IsNullOrEmpty(this.Address)) { this.Alert = "No address"; return; } - if (this.Amount == 0) { this.Alert = "No amount"; return; } - if (this.Fee == 0) { this.Alert = "No fee"; return; } + if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; } + if (string.IsNullOrEmpty(this.Address)) { this.Alert = "Please enter a valid address"; return; } + if (this.Amount == 0) { this.Alert = "Please enter the number of coins you want to send"; return; } + if (this.Fee == 0) { this.Alert = "Please ensure you enter a fee"; return; } this.Alert = string.Empty; diff --git a/src/Features/Blockcore.Features.Wallet/UI/Pages/Wallets.razor b/src/Features/Blockcore.Features.Wallet/UI/Pages/Wallets.razor index 44dafaf00..16f9099d0 100644 --- a/src/Features/Blockcore.Features.Wallet/UI/Pages/Wallets.razor +++ b/src/Features/Blockcore.Features.Wallet/UI/Pages/Wallets.razor @@ -17,21 +17,18 @@

Information about the deployed wallets.

@{ -

Wallet Tip: @this.WalletSyncManager.WalletTip.Height / @ChainIndexer.Height

- - - -
-
-
+ + + +

- - + + @@ -44,7 +41,7 @@ var accountBalance = this.WalletManager.GetBalances(walletName, account.Name).Single(); - + @@ -64,9 +61,12 @@ private void NavigateToWalletCreate() { - NavigationManager.NavigateTo("walletcrate"); + NavigationManager.NavigateTo("walletcreate"); + } + private void NavigateToWalletRecover() + { + NavigationManager.NavigateTo("walletrecover"); } - private void Resync() { this.WalletSyncManager.SyncFromHeight(1);
Wallet / accountConfirmed blanaceWallet / AccountConfirmed balance Unconfirmed balance
@walletName / @account.Name@walletName / @account.Name @accountBalance.AmountConfirmed @accountBalance.AmountUnconfirmed