@@ -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
-
{ NavigateToWalletAccount(walletname, accountname); }">
- Back to wallet account
-
-
-
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.
+@{
+
+
Reminder: The Mnemonic is your wallet and must be kept safe and secure.
+
+
+
Reminder: The Passphrase is permanently linked to the wallet and must be kept safe and secure.
+
+
+
+
+
+
Recover wallet
+
+
+
+}
+
+@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
-
{ NavigateToWalletAccount(walletname, accountname); }">
- Back to wallet account
-
-
-
-
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
+
+
+
+ Amount Confirmed
+ Amount Unconfirmed
+ Spendable Amount
+
+
+
+
+ @accountBalance.AmountConfirmed
+ @accountBalance.AmountUnconfirmed
+ @accountBalance.SpendableAmount
+
+
+
+
@@ -82,7 +89,7 @@
@@ -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
Create Wallet
-
Resync Wallets from genesis
-
Rebroadcast unconfirmed
-
-
-
-
+
Recover Wallet
+
Resync wallets from genesis
+
Re-broadcast unconfirmed
+
- Wallet / account
- Confirmed blanace
+ Wallet / Account
+ Confirmed balance
Unconfirmed balance
@@ -44,7 +41,7 @@
var accountBalance = this.WalletManager.GetBalances(walletName, account.Name).Single();
{ NavigateToWallet(walletName, account.Name); }" style="cursor:pointer">
- @walletName / @account.Name
+ @walletName / @account.Name
@accountBalance.AmountConfirmed
@accountBalance.AmountUnconfirmed
@@ -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);