mirror of
https://github.com/Nathanwoodburn/FireWallet.git
synced 2025-12-06 08:33:00 +11:00
Compare commits
11 Commits
v3.0
...
seedphrase
| Author | SHA1 | Date | |
|---|---|---|---|
|
f371f3da49
|
|||
|
a024ce7afc
|
|||
|
88ee50f4a6
|
|||
|
23cbace1ea
|
|||
|
6894e9c079
|
|||
|
95d0498672
|
|||
|
88c6b5afe0
|
|||
|
f06bc5b711
|
|||
|
42536e47bb
|
|||
|
404a47ec79
|
|||
|
c3abd0b4de
|
@@ -638,17 +638,45 @@ namespace FireWallet
|
|||||||
openFileDialog.Title = "Open Batch";
|
openFileDialog.Title = "Open Batch";
|
||||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
StreamReader sr = new StreamReader(openFileDialog.FileName);
|
try
|
||||||
string line;
|
|
||||||
string[] domains = new string[0];
|
|
||||||
while ((line = sr.ReadLine()) != null)
|
|
||||||
{
|
{
|
||||||
string[] split = line.Split(',');
|
StreamReader sr = new StreamReader(openFileDialog.FileName);
|
||||||
try
|
string line;
|
||||||
|
string[] domains = new string[0];
|
||||||
|
while ((line = sr.ReadLine()) != null)
|
||||||
{
|
{
|
||||||
if (split.Length > 2)
|
string[] split = line.Split(',');
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (split[1] == "UPDATE")
|
if (split.Length > 2)
|
||||||
|
{
|
||||||
|
if (split[1] == "UPDATE")
|
||||||
|
{
|
||||||
|
// Select operation and import domains
|
||||||
|
string[] newDomains = new string[domains.Length + 1];
|
||||||
|
for (int i = 0; i < domains.Length; i++)
|
||||||
|
{
|
||||||
|
newDomains[i] = domains[i];
|
||||||
|
}
|
||||||
|
newDomains[domains.Length] = split[0];
|
||||||
|
domains = newDomains;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (split.Length == 2)
|
||||||
|
{
|
||||||
|
AddBatch(split[0], split[1]);
|
||||||
|
}
|
||||||
|
else if (split.Length == 3)
|
||||||
|
{
|
||||||
|
AddBatch(split[0], split[1], split[2]);
|
||||||
|
}
|
||||||
|
else if (split.Length == 4)
|
||||||
|
{
|
||||||
|
AddBatch(split[0], split[1], Convert.ToDecimal(split[2]), Convert.ToDecimal(split[3]));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Select operation and import domains
|
// Select operation and import domains
|
||||||
string[] newDomains = new string[domains.Length + 1];
|
string[] newDomains = new string[domains.Length + 1];
|
||||||
@@ -656,68 +684,49 @@ namespace FireWallet
|
|||||||
{
|
{
|
||||||
newDomains[i] = domains[i];
|
newDomains[i] = domains[i];
|
||||||
}
|
}
|
||||||
newDomains[domains.Length] = split[0];
|
newDomains[domains.Length] = line.Trim();
|
||||||
domains = newDomains;
|
domains = newDomains;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
if (split.Length == 2)
|
|
||||||
{
|
{
|
||||||
AddBatch(split[0], split[1]);
|
AddLog("Error importing batch: " + ex.Message);
|
||||||
}
|
NotifyForm notifyForm = new NotifyForm("Error importing batch");
|
||||||
else if (split.Length == 3)
|
notifyForm.ShowDialog();
|
||||||
{
|
notifyForm.Dispose();
|
||||||
AddBatch(split[0], split[1], split[2]);
|
|
||||||
}
|
|
||||||
else if (split.Length == 4)
|
|
||||||
{
|
|
||||||
AddBatch(split[0], split[1], Convert.ToDecimal(split[2]), Convert.ToDecimal(split[3]));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Select operation and import domains
|
|
||||||
string[] newDomains = new string[domains.Length + 1];
|
|
||||||
for (int i = 0; i < domains.Length; i++)
|
|
||||||
{
|
|
||||||
newDomains[i] = domains[i];
|
|
||||||
}
|
|
||||||
newDomains[domains.Length] = line.Trim();
|
|
||||||
domains = newDomains;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
if (domains.Length > 0)
|
||||||
{
|
{
|
||||||
AddLog("Error importing batch: " + ex.Message);
|
BatchImportForm batchImportForm = new BatchImportForm(domains);
|
||||||
NotifyForm notifyForm = new NotifyForm("Error importing batch");
|
batchImportForm.ShowDialog();
|
||||||
notifyForm.ShowDialog();
|
if (batchImportForm.batches != null)
|
||||||
notifyForm.Dispose();
|
{
|
||||||
|
foreach (Batch b in batchImportForm.batches)
|
||||||
|
{
|
||||||
|
if (b.method == "BID")
|
||||||
|
{
|
||||||
|
AddBatch(b.domain, b.method, b.bid, b.lockup);
|
||||||
|
}
|
||||||
|
else if (b.method == "TRANSFER")
|
||||||
|
{
|
||||||
|
AddBatch(b.domain, b.method, b.toAddress);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddBatch(b.domain, b.method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
sr.Dispose();
|
||||||
if (domains.Length > 0)
|
} catch (Exception ex)
|
||||||
{
|
{
|
||||||
BatchImportForm batchImportForm = new BatchImportForm(domains);
|
AddLog("Error importing batch: " + ex.Message);
|
||||||
batchImportForm.ShowDialog();
|
NotifyForm notifyForm = new NotifyForm("Error importing batch\nMake sure the file is in not in use");
|
||||||
if (batchImportForm.batches != null)
|
notifyForm.ShowDialog();
|
||||||
{
|
notifyForm.Dispose();
|
||||||
foreach (Batch b in batchImportForm.batches)
|
|
||||||
{
|
|
||||||
if (b.method == "BID")
|
|
||||||
{
|
|
||||||
AddBatch(b.domain, b.method, b.bid, b.lockup);
|
|
||||||
}
|
|
||||||
else if (b.method == "TRANSFER")
|
|
||||||
{
|
|
||||||
AddBatch(b.domain, b.method, b.toAddress);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AddBatch(b.domain, b.method);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sr.Dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<PackageIcon>HSDBatcher.png</PackageIcon>
|
<PackageIcon>HSDBatcher.png</PackageIcon>
|
||||||
<RepositoryUrl>https://github.com/Nathanwoodburn/FireWallet</RepositoryUrl>
|
<RepositoryUrl>https://github.com/Nathanwoodburn/FireWallet</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<Version>3.0</Version>
|
<Version>3.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
31
FireWallet/MainForm.Designer.cs
generated
31
FireWallet/MainForm.Designer.cs
generated
@@ -95,6 +95,7 @@ namespace FireWallet
|
|||||||
textBoxReceiveAddress = new TextBox();
|
textBoxReceiveAddress = new TextBox();
|
||||||
labelReceive1 = new Label();
|
labelReceive1 = new Label();
|
||||||
panelDomains = new Panel();
|
panelDomains = new Panel();
|
||||||
|
comboBoxDomainSort = new ComboBox();
|
||||||
buttonExportDomains = new Button();
|
buttonExportDomains = new Button();
|
||||||
groupBoxDomains = new GroupBox();
|
groupBoxDomains = new GroupBox();
|
||||||
panelDomainList = new Panel();
|
panelDomainList = new Panel();
|
||||||
@@ -122,6 +123,7 @@ namespace FireWallet
|
|||||||
textBoxExAddr = new TextBox();
|
textBoxExAddr = new TextBox();
|
||||||
labelSettings4 = new Label();
|
labelSettings4 = new Label();
|
||||||
textBoxExTX = new TextBox();
|
textBoxExTX = new TextBox();
|
||||||
|
labelDomainSort = new Label();
|
||||||
statusStripmain.SuspendLayout();
|
statusStripmain.SuspendLayout();
|
||||||
panelaccount.SuspendLayout();
|
panelaccount.SuspendLayout();
|
||||||
groupBoxaccount.SuspendLayout();
|
groupBoxaccount.SuspendLayout();
|
||||||
@@ -783,6 +785,8 @@ namespace FireWallet
|
|||||||
//
|
//
|
||||||
// panelDomains
|
// panelDomains
|
||||||
//
|
//
|
||||||
|
panelDomains.Controls.Add(labelDomainSort);
|
||||||
|
panelDomains.Controls.Add(comboBoxDomainSort);
|
||||||
panelDomains.Controls.Add(buttonRenewAll);
|
panelDomains.Controls.Add(buttonRenewAll);
|
||||||
panelDomains.Controls.Add(buttonExportDomains);
|
panelDomains.Controls.Add(buttonExportDomains);
|
||||||
panelDomains.Controls.Add(groupBoxDomains);
|
panelDomains.Controls.Add(groupBoxDomains);
|
||||||
@@ -794,6 +798,19 @@ namespace FireWallet
|
|||||||
panelDomains.TabIndex = 18;
|
panelDomains.TabIndex = 18;
|
||||||
panelDomains.Visible = false;
|
panelDomains.Visible = false;
|
||||||
//
|
//
|
||||||
|
// comboBoxDomainSort
|
||||||
|
//
|
||||||
|
comboBoxDomainSort.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
comboBoxDomainSort.FlatStyle = FlatStyle.Flat;
|
||||||
|
comboBoxDomainSort.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
comboBoxDomainSort.FormattingEnabled = true;
|
||||||
|
comboBoxDomainSort.Items.AddRange(new object[] { "Default", "Alphabetical", "Expiring", "Value" });
|
||||||
|
comboBoxDomainSort.Location = new Point(686, 12);
|
||||||
|
comboBoxDomainSort.Name = "comboBoxDomainSort";
|
||||||
|
comboBoxDomainSort.Size = new Size(121, 29);
|
||||||
|
comboBoxDomainSort.TabIndex = 11;
|
||||||
|
comboBoxDomainSort.DropDownClosed += comboBoxDomainSort_DropDownClosed;
|
||||||
|
//
|
||||||
// buttonExportDomains
|
// buttonExportDomains
|
||||||
//
|
//
|
||||||
buttonExportDomains.FlatStyle = FlatStyle.Flat;
|
buttonExportDomains.FlatStyle = FlatStyle.Flat;
|
||||||
@@ -1064,17 +1081,27 @@ namespace FireWallet
|
|||||||
textBoxExTX.Size = new Size(307, 29);
|
textBoxExTX.Size = new Size(307, 29);
|
||||||
textBoxExTX.TabIndex = 1;
|
textBoxExTX.TabIndex = 1;
|
||||||
//
|
//
|
||||||
|
// labelDomainSort
|
||||||
|
//
|
||||||
|
labelDomainSort.AutoSize = true;
|
||||||
|
labelDomainSort.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
labelDomainSort.Location = new Point(638, 15);
|
||||||
|
labelDomainSort.Name = "labelDomainSort";
|
||||||
|
labelDomainSort.Size = new Size(42, 21);
|
||||||
|
labelDomainSort.TabIndex = 12;
|
||||||
|
labelDomainSort.Text = "Sort:";
|
||||||
|
//
|
||||||
// MainForm
|
// MainForm
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1152, 575);
|
ClientSize = new Size(1152, 575);
|
||||||
|
Controls.Add(panelDomains);
|
||||||
Controls.Add(panelSend);
|
Controls.Add(panelSend);
|
||||||
Controls.Add(panelSettings);
|
Controls.Add(panelSettings);
|
||||||
Controls.Add(panelaccount);
|
Controls.Add(panelaccount);
|
||||||
Controls.Add(panelPortfolio);
|
Controls.Add(panelPortfolio);
|
||||||
Controls.Add(panelRecieve);
|
Controls.Add(panelRecieve);
|
||||||
Controls.Add(panelDomains);
|
|
||||||
Controls.Add(panelNav);
|
Controls.Add(panelNav);
|
||||||
Controls.Add(statusStripmain);
|
Controls.Add(statusStripmain);
|
||||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||||
@@ -1205,5 +1232,7 @@ namespace FireWallet
|
|||||||
private ToolStripMenuItem supportDiscordServerToolStripMenuItem;
|
private ToolStripMenuItem supportDiscordServerToolStripMenuItem;
|
||||||
private Label labelHIPArrow;
|
private Label labelHIPArrow;
|
||||||
private Label labelSendingHIPAddress;
|
private Label labelSendingHIPAddress;
|
||||||
|
private ComboBox comboBoxDomainSort;
|
||||||
|
private Label labelDomainSort;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ using DnsClient;
|
|||||||
using DnsClient.Protocol;
|
using DnsClient.Protocol;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
|
using System.Numerics;
|
||||||
|
|
||||||
namespace FireWallet
|
namespace FireWallet
|
||||||
{
|
{
|
||||||
@@ -221,6 +222,28 @@ namespace FireWallet
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(dir + "hsd"))
|
||||||
|
{
|
||||||
|
NotifyForm Notifyinstall = new NotifyForm("Installing hsd\nThis may take a few minutes\nDo not close FireWallet", false);
|
||||||
|
Notifyinstall.Show();
|
||||||
|
// Wait for the notification to show
|
||||||
|
await Task.Delay(1000);
|
||||||
|
|
||||||
|
string repositoryUrl = "https://github.com/handshake-org/hsd.git";
|
||||||
|
string destinationPath = dir + "hsd";
|
||||||
|
CloneRepository(repositoryUrl, destinationPath);
|
||||||
|
|
||||||
|
Notifyinstall.CloseNotification();
|
||||||
|
Notifyinstall.Dispose();
|
||||||
|
}
|
||||||
|
if (!Directory.Exists(dir + "hsd\\node_modules"))
|
||||||
|
{
|
||||||
|
AddLog("HSD install failed");
|
||||||
|
this.Close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -664,6 +687,7 @@ namespace FireWallet
|
|||||||
toolStripStatusLabelLedger.Text = "Cold Wallet";
|
toolStripStatusLabelLedger.Text = "Cold Wallet";
|
||||||
toolStripStatusLabelLedger.Visible = true;
|
toolStripStatusLabelLedger.Visible = true;
|
||||||
buttonRevealAll.Visible = false;
|
buttonRevealAll.Visible = false;
|
||||||
|
buttonSeed.Enabled = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -671,6 +695,7 @@ namespace FireWallet
|
|||||||
watchOnly = false;
|
watchOnly = false;
|
||||||
toolStripStatusLabelLedger.Visible = false;
|
toolStripStatusLabelLedger.Visible = false;
|
||||||
buttonRevealAll.Visible = true;
|
buttonRevealAll.Visible = true;
|
||||||
|
buttonSeed.Enabled = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -842,7 +867,6 @@ namespace FireWallet
|
|||||||
{
|
{
|
||||||
AddLog("Post Error: " + ex.Message);
|
AddLog("Post Error: " + ex.Message);
|
||||||
AddLog(await resp.Content.ReadAsStringAsync());
|
AddLog(await resp.Content.ReadAsStringAsync());
|
||||||
AddLog("Content: " + content);
|
|
||||||
return "Error";
|
return "Error";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1216,6 +1240,8 @@ namespace FireWallet
|
|||||||
groupBoxDomains.Width = panelDomains.Width - 20;
|
groupBoxDomains.Width = panelDomains.Width - 20;
|
||||||
groupBoxDomains.Left = 10;
|
groupBoxDomains.Left = 10;
|
||||||
groupBoxDomains.Height = panelDomains.Height - groupBoxDomains.Top - 10;
|
groupBoxDomains.Height = panelDomains.Height - groupBoxDomains.Top - 10;
|
||||||
|
comboBoxDomainSort.SelectedIndex = 0;
|
||||||
|
|
||||||
UpdateDomains();
|
UpdateDomains();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1414,27 +1440,6 @@ namespace FireWallet
|
|||||||
return hex.ToString();
|
return hex.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetHash(HashAlgorithm hashAlgorithm, byte[] input)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Convert the input string to a byte array and compute the hash.
|
|
||||||
byte[] data = hashAlgorithm.ComputeHash(input);
|
|
||||||
|
|
||||||
// Create a new Stringbuilder to collect the bytes
|
|
||||||
// and create a string.
|
|
||||||
var sBuilder = new StringBuilder();
|
|
||||||
|
|
||||||
// Loop through each byte of the hashed data
|
|
||||||
// and format each one as a hexadecimal string.
|
|
||||||
for (int i = 0; i < data.Length; i++)
|
|
||||||
{
|
|
||||||
sBuilder.Append(data[i].ToString("x2"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the hexadecimal string.
|
|
||||||
return sBuilder.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textBoxSendingAmount_Leave(object sender, EventArgs e)
|
private void textBoxSendingAmount_Leave(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
decimal amount = 0;
|
decimal amount = 0;
|
||||||
@@ -1647,7 +1652,7 @@ namespace FireWallet
|
|||||||
if (!outputInstalled.Contains("git version"))
|
if (!outputInstalled.Contains("git version"))
|
||||||
{
|
{
|
||||||
AddLog("Git is not installed");
|
AddLog("Git is not installed");
|
||||||
NotifyForm notifyForm = new NotifyForm("Git is not installed\nPlease install it to install HSD dependencies");
|
NotifyForm notifyForm = new NotifyForm("Git is not installed\nPlease install it to install HSD dependencies","Install", "https://git-scm.com/download/win");
|
||||||
notifyForm.ShowDialog();
|
notifyForm.ShowDialog();
|
||||||
notifyForm.Dispose();
|
notifyForm.Dispose();
|
||||||
this.Close();
|
this.Close();
|
||||||
@@ -1669,7 +1674,7 @@ namespace FireWallet
|
|||||||
if (!outputInstalled.Contains("v"))
|
if (!outputInstalled.Contains("v"))
|
||||||
{
|
{
|
||||||
AddLog("Node is not installed");
|
AddLog("Node is not installed");
|
||||||
NotifyForm notifyForm = new NotifyForm("Node is not installed\nPlease install it to install HSD dependencies");
|
NotifyForm notifyForm = new NotifyForm("Node is not installed\nPlease install it to install HSD dependencies","Install", "https://nodejs.org/en/download");
|
||||||
notifyForm.ShowDialog();
|
notifyForm.ShowDialog();
|
||||||
notifyForm.Dispose();
|
notifyForm.Dispose();
|
||||||
this.Close();
|
this.Close();
|
||||||
@@ -1695,7 +1700,7 @@ namespace FireWallet
|
|||||||
{
|
{
|
||||||
AddLog("NPM is not installed");
|
AddLog("NPM is not installed");
|
||||||
AddLog(outputInstalled);
|
AddLog(outputInstalled);
|
||||||
NotifyForm notifyForm = new NotifyForm("NPM is not installed\nPlease install it to install HSD dependencies");
|
NotifyForm notifyForm = new NotifyForm("NPM is not installed\nPlease install it to install HSD dependencies","Install", "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm");
|
||||||
notifyForm.ShowDialog();
|
notifyForm.ShowDialog();
|
||||||
notifyForm.Dispose();
|
notifyForm.Dispose();
|
||||||
this.Close();
|
this.Close();
|
||||||
@@ -1881,6 +1886,33 @@ namespace FireWallet
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
int renewable = 0;
|
int renewable = 0;
|
||||||
panelDomainList.Controls.Clear();
|
panelDomainList.Controls.Clear();
|
||||||
|
|
||||||
|
// Sort the domains
|
||||||
|
switch (comboBoxDomainSort.Text)
|
||||||
|
{
|
||||||
|
case "Default":
|
||||||
|
break;
|
||||||
|
case "Alphabetical":
|
||||||
|
names = new JArray(names.OrderBy(obj => (string)obj["name"]));
|
||||||
|
break;
|
||||||
|
case "Expiring":
|
||||||
|
names = new JArray(names.OrderBy(obj =>
|
||||||
|
{
|
||||||
|
JToken daysUntilExpireToken = obj["stats"]?["daysUntilExpire"];
|
||||||
|
return (int)(daysUntilExpireToken ?? int.MaxValue);
|
||||||
|
}));
|
||||||
|
break;
|
||||||
|
case "Value":
|
||||||
|
// Sort by most valuable first
|
||||||
|
names = new JArray(names.OrderByDescending(obj =>
|
||||||
|
{
|
||||||
|
JToken valueToken = obj?["value"];
|
||||||
|
return (int)(valueToken ?? 0);
|
||||||
|
}));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (JObject name in names)
|
foreach (JObject name in names)
|
||||||
{
|
{
|
||||||
Domains[i] = name["name"].ToString();
|
Domains[i] = name["name"].ToString();
|
||||||
@@ -2002,6 +2034,43 @@ namespace FireWallet
|
|||||||
domainSearch = Regex.Replace(textBoxDomainSearch.Text, "[^a-zA-Z0-9-_]", "");
|
domainSearch = Regex.Replace(textBoxDomainSearch.Text, "[^a-zA-Z0-9-_]", "");
|
||||||
textBoxDomainSearch.Text = domainSearch;
|
textBoxDomainSearch.Text = domainSearch;
|
||||||
}
|
}
|
||||||
|
private void export_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||||
|
saveFileDialog.Filter = "CSV file (*.csv)|*.csv";
|
||||||
|
saveFileDialog.Title = "Export";
|
||||||
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
StreamWriter sw = new StreamWriter(saveFileDialog.FileName);
|
||||||
|
foreach (string domain in DomainsRenewable)
|
||||||
|
{
|
||||||
|
if (domain == null) break;
|
||||||
|
sw.WriteLine(domain);
|
||||||
|
}
|
||||||
|
sw.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonRenewAll_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (DomainsRenewable == null)
|
||||||
|
{
|
||||||
|
NotifyForm notifyForm = new NotifyForm("No renewable domains found");
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
foreach (string domain in DomainsRenewable)
|
||||||
|
{
|
||||||
|
if (domain == null) break;
|
||||||
|
AddBatch(domain, "RENEW");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void comboBoxDomainSort_DropDownClosed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
UpdateDomains();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Batching
|
#region Batching
|
||||||
@@ -2108,6 +2177,8 @@ namespace FireWallet
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
AddLog("Decrypting seed...");
|
||||||
|
AddLog(resp.ToString());
|
||||||
string iv = resp["iv"].ToString();
|
string iv = resp["iv"].ToString();
|
||||||
string ciphertext = resp["ciphertext"].ToString();
|
string ciphertext = resp["ciphertext"].ToString();
|
||||||
string tmpn = resp["n"].ToString();
|
string tmpn = resp["n"].ToString();
|
||||||
@@ -2116,9 +2187,26 @@ namespace FireWallet
|
|||||||
|
|
||||||
int n = int.Parse(tmpn);
|
int n = int.Parse(tmpn);
|
||||||
int p = int.Parse(tmpp);
|
int p = int.Parse(tmpp);
|
||||||
|
int r = int.Parse(tmpr);
|
||||||
|
|
||||||
int iterations = n;
|
int iterations = n;
|
||||||
|
|
||||||
|
byte[] decripted = await Decrypt_Seed(algorithm, ciphertext, iv, n,r,p);
|
||||||
|
|
||||||
|
|
||||||
|
// This is returning garbled text
|
||||||
|
AddLog("Seed decrypted");
|
||||||
|
string phrase = Encoding.UTF8.GetString(decripted);
|
||||||
|
AddLog("Your seed phrase is:\n" + phrase);
|
||||||
|
|
||||||
|
phrase = Encoding.ASCII.GetString(decripted);
|
||||||
|
AddLog("Your seed phrase is:\n" + phrase);
|
||||||
|
|
||||||
|
phrase = Encoding.Unicode.GetString(decripted);
|
||||||
|
AddLog("Your seed phrase is:\n" + phrase);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -2133,7 +2221,71 @@ namespace FireWallet
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private async Task<byte[]> Decrypt_Seed(string algorithm, string ciphertext, string iv, int n,int r, int p)
|
||||||
|
{
|
||||||
|
byte[] salt = Encoding.ASCII.GetBytes("hsd");
|
||||||
|
using (AesManaged aes = new AesManaged())
|
||||||
|
{
|
||||||
|
aes.Key = DeriveKey(algorithm, password, salt, n, r, p);
|
||||||
|
aes.IV = HexStringToByteArray(iv);
|
||||||
|
aes.Mode = CipherMode.CBC;
|
||||||
|
aes.Padding = PaddingMode.None;
|
||||||
|
byte[] cipher = HexStringToByteArray(ciphertext);
|
||||||
|
|
||||||
|
if (cipher.Length % 16 != 0)
|
||||||
|
{
|
||||||
|
AddLog("Invalid cipher length");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
using (ICryptoTransform decryptor = aes.CreateDecryptor())
|
||||||
|
{
|
||||||
|
byte[] decrypted = decryptor.TransformFinalBlock(cipher, 0, cipher.Length);
|
||||||
|
return decrypted;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
static byte[] HexStringToByteArray(string hex)
|
||||||
|
{
|
||||||
|
int numberChars = hex.Length / 2;
|
||||||
|
byte[] bytes = new byte[numberChars];
|
||||||
|
for (int i = 0; i < numberChars; i++)
|
||||||
|
{
|
||||||
|
bytes[i] = Convert.ToByte(hex.Substring(i * 2, 2), 16);
|
||||||
|
}
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] DeriveKey(string algorithm, string passphrase, byte[] salt, int n, int r, int p)
|
||||||
|
{
|
||||||
|
byte[] passwordBytes = Encoding.UTF8.GetBytes(passphrase);
|
||||||
|
|
||||||
|
switch (algorithm)
|
||||||
|
{
|
||||||
|
case "pbkdf2":
|
||||||
|
return Pbkdf2DeriveKey(passwordBytes, salt, n, 32);
|
||||||
|
case "scrypt":
|
||||||
|
return ScryptDeriveKey(passwordBytes, salt, n, r, p, 32);
|
||||||
|
default:
|
||||||
|
throw new Exception($"Unknown algorithm: {algorithm}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static byte[] Pbkdf2DeriveKey(byte[] password, byte[] salt, int iterations, int derivedKeyLength)
|
||||||
|
{
|
||||||
|
using (Rfc2898DeriveBytes pbkdf2 = new Rfc2898DeriveBytes(password, salt, iterations))
|
||||||
|
{
|
||||||
|
return pbkdf2.GetBytes(derivedKeyLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static byte[] ScryptDeriveKey(byte[] password, byte[] salt, int costParameterN, int costParameterR, int costParameterP, int derivedKeyLength)
|
||||||
|
{
|
||||||
|
using (var rfc2898 = new Rfc2898DeriveBytes(password, salt, costParameterN, HashAlgorithmName.SHA256))
|
||||||
|
{
|
||||||
|
return rfc2898.GetBytes(derivedKeyLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
private async void Rescan_Click(object sender, EventArgs e)
|
private async void Rescan_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string content = "{\"height\": 0}";
|
string content = "{\"height\": 0}";
|
||||||
@@ -2149,39 +2301,7 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void export_Click(object sender, EventArgs e)
|
#region Help Menu
|
||||||
{
|
|
||||||
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
|
||||||
saveFileDialog.Filter = "CSV file (*.csv)|*.csv";
|
|
||||||
saveFileDialog.Title = "Export";
|
|
||||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
StreamWriter sw = new StreamWriter(saveFileDialog.FileName);
|
|
||||||
foreach (string domain in DomainsRenewable)
|
|
||||||
{
|
|
||||||
if (domain == null) break;
|
|
||||||
sw.WriteLine(domain);
|
|
||||||
}
|
|
||||||
sw.Dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonRenewAll_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (DomainsRenewable == null)
|
|
||||||
{
|
|
||||||
NotifyForm notifyForm = new NotifyForm("No renewable domains found");
|
|
||||||
notifyForm.ShowDialog();
|
|
||||||
notifyForm.Dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
foreach (string domain in DomainsRenewable)
|
|
||||||
{
|
|
||||||
if (domain == null) break;
|
|
||||||
AddBatch(domain, "RENEW");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void githubToolStripMenuItem_Click(object sender, EventArgs e)
|
private void githubToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// Open the GitHub page
|
// Open the GitHub page
|
||||||
@@ -2212,5 +2332,6 @@ namespace FireWallet
|
|||||||
};
|
};
|
||||||
Process.Start(psi);
|
Process.Start(psi);
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,15 +224,15 @@
|
|||||||
{
|
{
|
||||||
"Name" = "8:Microsoft Visual Studio"
|
"Name" = "8:Microsoft Visual Studio"
|
||||||
"ProductName" = "8:FireWallet"
|
"ProductName" = "8:FireWallet"
|
||||||
"ProductCode" = "8:{007B0A5E-57B9-4DB7-AABE-5A3631A89BEB}"
|
"ProductCode" = "8:{460D8F86-4FE9-4547-9B17-7E01ACBF9194}"
|
||||||
"PackageCode" = "8:{546D4209-3E58-4144-A9DC-E659A2482DD4}"
|
"PackageCode" = "8:{A6678F97-9CE8-4005-82AC-AB2D09A9DA27}"
|
||||||
"UpgradeCode" = "8:{0C86F725-6B01-4173-AA05-3F0EDF481362}"
|
"UpgradeCode" = "8:{0C86F725-6B01-4173-AA05-3F0EDF481362}"
|
||||||
"AspNetVersion" = "8:"
|
"AspNetVersion" = "8:"
|
||||||
"RestartWWWService" = "11:FALSE"
|
"RestartWWWService" = "11:FALSE"
|
||||||
"RemovePreviousVersions" = "11:TRUE"
|
"RemovePreviousVersions" = "11:TRUE"
|
||||||
"DetectNewerInstalledVersion" = "11:TRUE"
|
"DetectNewerInstalledVersion" = "11:TRUE"
|
||||||
"InstallAllUsers" = "11:FALSE"
|
"InstallAllUsers" = "11:FALSE"
|
||||||
"ProductVersion" = "8:3.0"
|
"ProductVersion" = "8:3.1"
|
||||||
"Manufacturer" = "8:Nathan.Woodburn/"
|
"Manufacturer" = "8:Nathan.Woodburn/"
|
||||||
"ARPHELPTELEPHONE" = "8:"
|
"ARPHELPTELEPHONE" = "8:"
|
||||||
"ARPHELPLINK" = "8:https://l.woodburn.au/discord"
|
"ARPHELPLINK" = "8:https://l.woodburn.au/discord"
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -2,6 +2,14 @@
|
|||||||
Experimental wallet for Handshake chain
|
Experimental wallet for Handshake chain
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
### Dependencies
|
||||||
|
You will need .net desktop installed. You can download it from [here](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-6.0.18-windows-x64-installer).
|
||||||
|
|
||||||
|
You will also need Node, NPM, and git installed if you want to use the internal HSD or Ledger wallets.
|
||||||
|
[Git](https://git-scm.com/downloads)
|
||||||
|
[Node](https://nodejs.org/en/download/)
|
||||||
|
[NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
|
||||||
|
|
||||||
### From Releases
|
### From Releases
|
||||||
You can install the latest release from [here](https://github.com/Nathanwoodburn/FireWallet/releases/).
|
You can install the latest release from [here](https://github.com/Nathanwoodburn/FireWallet/releases/).
|
||||||
|
|
||||||
@@ -60,6 +68,9 @@ You can change the number of transactions shown in the `portfolio-tx:` settings.
|
|||||||
<br><br>
|
<br><br>
|
||||||
## Sending HNS
|
## Sending HNS
|
||||||

|

|
||||||
|
This page lets you send HNS to Handshake addresses or domains using [HIP-02](https://github.com/handshake-org/HIPs/blob/master/HIP-0002.md).
|
||||||
|
To use HIP-02 you need to have HSD resolver (or any HNS compatible DNS resolver) listening on port 5350 (default HSD port).
|
||||||
|
To enter a domain to use HIP-02 you need to prefix the domain with `@` (eg. `@nathan.woodburn`).
|
||||||
|
|
||||||
## Receiving HNS or Domains
|
## Receiving HNS or Domains
|
||||||
The receive page shows your current HNS address.
|
The receive page shows your current HNS address.
|
||||||
@@ -104,6 +115,8 @@ The "CANCEL" transaction type is used to cancel an transfer.
|
|||||||
|
|
||||||
At the momemt "UPDATE" or coin only transactions are not supported.
|
At the momemt "UPDATE" or coin only transactions are not supported.
|
||||||
|
|
||||||
|
|
||||||
|
Please not that the import syntax for BIDs is BID,LOCKUP where LOCKUP is (BID+BLIND)
|
||||||

|

|
||||||
|
|
||||||
## Exporting
|
## Exporting
|
||||||
|
|||||||
Reference in New Issue
Block a user