mirror of
https://github.com/Nathanwoodburn/FireWallet.git
synced 2025-12-06 08:33:00 +11:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
843f824b2f
|
|||
|
71a04edc02
|
|||
|
30c5690c24
|
|||
|
af9327a1fa
|
|||
|
07345d7f33
|
|||
|
d41c72faff
|
|||
|
a4a35ad62e
|
|||
|
9f0f7214e2
|
|||
|
742cd9bafd
|
BIN
FireWallet/FW.ico
Normal file
BIN
FireWallet/FW.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
@@ -6,17 +6,17 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<ApplicationIcon>FW2.ico</ApplicationIcon>
|
<ApplicationIcon>FW.ico</ApplicationIcon>
|
||||||
<Title>FireWallet</Title>
|
<Title>FireWallet</Title>
|
||||||
<PackageProjectUrl>https://l.woodburn.au</PackageProjectUrl>
|
<PackageProjectUrl>https://l.woodburn.au</PackageProjectUrl>
|
||||||
<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.3</Version>
|
<Version>3.4</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="FW2.ico" />
|
<Content Include="FW.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
63
FireWallet/MainForm.Designer.cs
generated
63
FireWallet/MainForm.Designer.cs
generated
@@ -58,7 +58,6 @@ namespace FireWallet
|
|||||||
labelaccountusername = new Label();
|
labelaccountusername = new Label();
|
||||||
buttonaccountnew = new Button();
|
buttonaccountnew = new Button();
|
||||||
panelNav = new Panel();
|
panelNav = new Panel();
|
||||||
buttonNavBids = new Button();
|
|
||||||
buttonNavSettings = new Button();
|
buttonNavSettings = new Button();
|
||||||
buttonBatch = new Button();
|
buttonBatch = new Button();
|
||||||
buttonNavDomains = new Button();
|
buttonNavDomains = new Button();
|
||||||
@@ -66,6 +65,7 @@ namespace FireWallet
|
|||||||
buttonNavSend = new Button();
|
buttonNavSend = new Button();
|
||||||
buttonNavPortfolio = new Button();
|
buttonNavPortfolio = new Button();
|
||||||
panelPortfolio = new Panel();
|
panelPortfolio = new Panel();
|
||||||
|
buttonRedeemAll = new Button();
|
||||||
buttonRevealAll = new Button();
|
buttonRevealAll = new Button();
|
||||||
groupBoxTransactions = new GroupBox();
|
groupBoxTransactions = new GroupBox();
|
||||||
groupBoxinfo = new GroupBox();
|
groupBoxinfo = new GroupBox();
|
||||||
@@ -127,7 +127,7 @@ namespace FireWallet
|
|||||||
textBoxExAddr = new TextBox();
|
textBoxExAddr = new TextBox();
|
||||||
labelSettings4 = new Label();
|
labelSettings4 = new Label();
|
||||||
textBoxExTX = new TextBox();
|
textBoxExTX = new TextBox();
|
||||||
panelBids = new Panel();
|
buttonSendAll = new Button();
|
||||||
statusStripmain.SuspendLayout();
|
statusStripmain.SuspendLayout();
|
||||||
panelaccount.SuspendLayout();
|
panelaccount.SuspendLayout();
|
||||||
groupBoxaccount.SuspendLayout();
|
groupBoxaccount.SuspendLayout();
|
||||||
@@ -355,7 +355,6 @@ namespace FireWallet
|
|||||||
//
|
//
|
||||||
// panelNav
|
// panelNav
|
||||||
//
|
//
|
||||||
panelNav.Controls.Add(buttonNavBids);
|
|
||||||
panelNav.Controls.Add(buttonNavSettings);
|
panelNav.Controls.Add(buttonNavSettings);
|
||||||
panelNav.Controls.Add(buttonBatch);
|
panelNav.Controls.Add(buttonBatch);
|
||||||
panelNav.Controls.Add(buttonNavDomains);
|
panelNav.Controls.Add(buttonNavDomains);
|
||||||
@@ -368,19 +367,6 @@ namespace FireWallet
|
|||||||
panelNav.Size = new Size(114, 553);
|
panelNav.Size = new Size(114, 553);
|
||||||
panelNav.TabIndex = 6;
|
panelNav.TabIndex = 6;
|
||||||
//
|
//
|
||||||
// buttonNavBids
|
|
||||||
//
|
|
||||||
buttonNavBids.FlatStyle = FlatStyle.Flat;
|
|
||||||
buttonNavBids.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
|
||||||
buttonNavBids.Location = new Point(12, 245);
|
|
||||||
buttonNavBids.Name = "buttonNavBids";
|
|
||||||
buttonNavBids.Size = new Size(89, 30);
|
|
||||||
buttonNavBids.TabIndex = 5;
|
|
||||||
buttonNavBids.TabStop = false;
|
|
||||||
buttonNavBids.Text = "Bids";
|
|
||||||
buttonNavBids.UseVisualStyleBackColor = true;
|
|
||||||
buttonNavBids.Click += buttonNavBids_Click;
|
|
||||||
//
|
|
||||||
// buttonNavSettings
|
// buttonNavSettings
|
||||||
//
|
//
|
||||||
buttonNavSettings.FlatStyle = FlatStyle.Flat;
|
buttonNavSettings.FlatStyle = FlatStyle.Flat;
|
||||||
@@ -398,7 +384,7 @@ namespace FireWallet
|
|||||||
//
|
//
|
||||||
buttonBatch.FlatStyle = FlatStyle.Flat;
|
buttonBatch.FlatStyle = FlatStyle.Flat;
|
||||||
buttonBatch.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
buttonBatch.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
buttonBatch.Location = new Point(12, 300);
|
buttonBatch.Location = new Point(12, 245);
|
||||||
buttonBatch.Name = "buttonBatch";
|
buttonBatch.Name = "buttonBatch";
|
||||||
buttonBatch.Size = new Size(89, 30);
|
buttonBatch.Size = new Size(89, 30);
|
||||||
buttonBatch.TabIndex = 3;
|
buttonBatch.TabIndex = 3;
|
||||||
@@ -411,7 +397,7 @@ namespace FireWallet
|
|||||||
//
|
//
|
||||||
buttonNavDomains.FlatStyle = FlatStyle.Flat;
|
buttonNavDomains.FlatStyle = FlatStyle.Flat;
|
||||||
buttonNavDomains.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
buttonNavDomains.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
buttonNavDomains.Location = new Point(12, 190);
|
buttonNavDomains.Location = new Point(12, 189);
|
||||||
buttonNavDomains.Name = "buttonNavDomains";
|
buttonNavDomains.Name = "buttonNavDomains";
|
||||||
buttonNavDomains.Size = new Size(89, 30);
|
buttonNavDomains.Size = new Size(89, 30);
|
||||||
buttonNavDomains.TabIndex = 2;
|
buttonNavDomains.TabIndex = 2;
|
||||||
@@ -424,7 +410,7 @@ namespace FireWallet
|
|||||||
//
|
//
|
||||||
buttonNavReceive.FlatStyle = FlatStyle.Flat;
|
buttonNavReceive.FlatStyle = FlatStyle.Flat;
|
||||||
buttonNavReceive.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
buttonNavReceive.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
buttonNavReceive.Location = new Point(12, 135);
|
buttonNavReceive.Location = new Point(12, 134);
|
||||||
buttonNavReceive.Name = "buttonNavReceive";
|
buttonNavReceive.Name = "buttonNavReceive";
|
||||||
buttonNavReceive.Size = new Size(89, 30);
|
buttonNavReceive.Size = new Size(89, 30);
|
||||||
buttonNavReceive.TabIndex = 1;
|
buttonNavReceive.TabIndex = 1;
|
||||||
@@ -461,23 +447,37 @@ namespace FireWallet
|
|||||||
//
|
//
|
||||||
// panelPortfolio
|
// panelPortfolio
|
||||||
//
|
//
|
||||||
|
panelPortfolio.Controls.Add(buttonSendAll);
|
||||||
|
panelPortfolio.Controls.Add(buttonRedeemAll);
|
||||||
panelPortfolio.Controls.Add(buttonRevealAll);
|
panelPortfolio.Controls.Add(buttonRevealAll);
|
||||||
panelPortfolio.Controls.Add(groupBoxTransactions);
|
panelPortfolio.Controls.Add(groupBoxTransactions);
|
||||||
panelPortfolio.Controls.Add(groupBoxinfo);
|
panelPortfolio.Controls.Add(groupBoxinfo);
|
||||||
panelPortfolio.Controls.Add(groupBoxbalance);
|
panelPortfolio.Controls.Add(groupBoxbalance);
|
||||||
panelPortfolio.Location = new Point(1036, 129);
|
panelPortfolio.Location = new Point(140, 35);
|
||||||
panelPortfolio.Name = "panelPortfolio";
|
panelPortfolio.Name = "panelPortfolio";
|
||||||
panelPortfolio.Size = new Size(956, 538);
|
panelPortfolio.Size = new Size(956, 538);
|
||||||
panelPortfolio.TabIndex = 7;
|
panelPortfolio.TabIndex = 7;
|
||||||
panelPortfolio.Visible = false;
|
panelPortfolio.Visible = false;
|
||||||
//
|
//
|
||||||
|
// buttonRedeemAll
|
||||||
|
//
|
||||||
|
buttonRedeemAll.FlatStyle = FlatStyle.Flat;
|
||||||
|
buttonRedeemAll.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
buttonRedeemAll.Location = new Point(649, 12);
|
||||||
|
buttonRedeemAll.Name = "buttonRedeemAll";
|
||||||
|
buttonRedeemAll.Size = new Size(106, 44);
|
||||||
|
buttonRedeemAll.TabIndex = 9;
|
||||||
|
buttonRedeemAll.Text = "Redeem All";
|
||||||
|
buttonRedeemAll.UseVisualStyleBackColor = true;
|
||||||
|
buttonRedeemAll.Click += buttonRedeemAll_Click;
|
||||||
|
//
|
||||||
// buttonRevealAll
|
// buttonRevealAll
|
||||||
//
|
//
|
||||||
buttonRevealAll.FlatStyle = FlatStyle.Flat;
|
buttonRevealAll.FlatStyle = FlatStyle.Flat;
|
||||||
buttonRevealAll.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
buttonRevealAll.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
buttonRevealAll.Location = new Point(537, 12);
|
buttonRevealAll.Location = new Point(537, 12);
|
||||||
buttonRevealAll.Name = "buttonRevealAll";
|
buttonRevealAll.Name = "buttonRevealAll";
|
||||||
buttonRevealAll.Size = new Size(89, 44);
|
buttonRevealAll.Size = new Size(106, 44);
|
||||||
buttonRevealAll.TabIndex = 9;
|
buttonRevealAll.TabIndex = 9;
|
||||||
buttonRevealAll.Text = "Reveal All";
|
buttonRevealAll.Text = "Reveal All";
|
||||||
buttonRevealAll.UseVisualStyleBackColor = true;
|
buttonRevealAll.UseVisualStyleBackColor = true;
|
||||||
@@ -1121,20 +1121,23 @@ namespace FireWallet
|
|||||||
textBoxExTX.Size = new Size(307, 29);
|
textBoxExTX.Size = new Size(307, 29);
|
||||||
textBoxExTX.TabIndex = 1;
|
textBoxExTX.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// panelBids
|
// buttonSendAll
|
||||||
//
|
//
|
||||||
panelBids.Location = new Point(143, 44);
|
buttonSendAll.FlatStyle = FlatStyle.Flat;
|
||||||
panelBids.Name = "panelBids";
|
buttonSendAll.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
panelBids.Size = new Size(868, 484);
|
buttonSendAll.Location = new Point(761, 12);
|
||||||
panelBids.TabIndex = 20;
|
buttonSendAll.Name = "buttonSendAll";
|
||||||
panelBids.Visible = false;
|
buttonSendAll.Size = new Size(106, 44);
|
||||||
|
buttonSendAll.TabIndex = 9;
|
||||||
|
buttonSendAll.Text = "Send All TXs";
|
||||||
|
buttonSendAll.UseVisualStyleBackColor = true;
|
||||||
|
buttonSendAll.Click += buttonSendAll_Click;
|
||||||
//
|
//
|
||||||
// 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(panelBids);
|
|
||||||
Controls.Add(panelDomains);
|
Controls.Add(panelDomains);
|
||||||
Controls.Add(panelSend);
|
Controls.Add(panelSend);
|
||||||
Controls.Add(panelSettings);
|
Controls.Add(panelSettings);
|
||||||
@@ -1276,7 +1279,7 @@ namespace FireWallet
|
|||||||
private Label labelDomainSort;
|
private Label labelDomainSort;
|
||||||
private ToolStripSeparator toolStripSeparator1;
|
private ToolStripSeparator toolStripSeparator1;
|
||||||
private ToolStripMenuItem otherProjectsToolStripMenuItem;
|
private ToolStripMenuItem otherProjectsToolStripMenuItem;
|
||||||
private Button buttonNavBids;
|
private Button buttonRedeemAll;
|
||||||
private Panel panelBids;
|
private Button buttonSendAll;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ namespace FireWallet
|
|||||||
toolStripDropDownButtonHelp.DropDown.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
toolStripDropDownButtonHelp.DropDown.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
||||||
|
|
||||||
// Load node
|
// Load node
|
||||||
if (await LoadNode() != true) this.Close();
|
if (await LoadNode(ss) != true) this.Close();
|
||||||
|
|
||||||
// If node load caused app to close, exit load function
|
// If node load caused app to close, exit load function
|
||||||
if (this.Disposing || this.IsDisposed) return;
|
if (this.Disposing || this.IsDisposed) return;
|
||||||
@@ -142,13 +142,20 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
|
|
||||||
|
while (!ss.IsClosed)
|
||||||
|
{
|
||||||
|
Thread.Sleep(100);
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
AddLog("Loaded");
|
AddLog("Loaded");
|
||||||
|
|
||||||
// Pull form to front
|
|
||||||
Opacity = 1;
|
// Pull form to front
|
||||||
this.WindowState = FormWindowState.Minimized;
|
this.WindowState = FormWindowState.Minimized;
|
||||||
this.Show();
|
this.Show();
|
||||||
|
this.Opacity = 1;
|
||||||
this.WindowState = FormWindowState.Normal;
|
this.WindowState = FormWindowState.Normal;
|
||||||
textBoxaccountpassword.Focus();
|
textBoxaccountpassword.Focus();
|
||||||
}
|
}
|
||||||
@@ -174,15 +181,17 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Settings
|
#region Settings
|
||||||
private async Task<bool> LoadNode()
|
private async Task<bool> LoadNode(SplashScreen? ss)
|
||||||
{
|
{
|
||||||
HSD = false;
|
HSD = false;
|
||||||
if (!File.Exists(dir + "node.txt"))
|
if (!File.Exists(dir + "node.txt"))
|
||||||
{
|
{
|
||||||
|
ss.Hide();
|
||||||
NodeForm cf = new NodeForm();
|
NodeForm cf = new NodeForm();
|
||||||
timerNodeStatus.Stop();
|
timerNodeStatus.Stop();
|
||||||
cf.ShowDialog();
|
cf.ShowDialog();
|
||||||
timerNodeStatus.Start();
|
timerNodeStatus.Start();
|
||||||
|
ss.Show();
|
||||||
}
|
}
|
||||||
if (!File.Exists(dir + "node.txt"))
|
if (!File.Exists(dir + "node.txt"))
|
||||||
{
|
{
|
||||||
@@ -224,6 +233,13 @@ namespace FireWallet
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NodeSettings.ContainsKey("Timeout"))
|
||||||
|
{
|
||||||
|
int timeout = Convert.ToInt32(NodeSettings["Timeout"]);
|
||||||
|
httpClient.Timeout = TimeSpan.FromSeconds(timeout);
|
||||||
|
}
|
||||||
|
else httpClient.Timeout = TimeSpan.FromSeconds(10);
|
||||||
|
|
||||||
if (NodeSettings.ContainsKey("HSD"))
|
if (NodeSettings.ContainsKey("HSD"))
|
||||||
{
|
{
|
||||||
if (NodeSettings["HSD"].ToLower() == "true")
|
if (NodeSettings["HSD"].ToLower() == "true")
|
||||||
@@ -302,6 +318,8 @@ namespace FireWallet
|
|||||||
if (hideScreen)
|
if (hideScreen)
|
||||||
{
|
{
|
||||||
HSDProcess.StartInfo.RedirectStandardError = true;
|
HSDProcess.StartInfo.RedirectStandardError = true;
|
||||||
|
// Send errors to log
|
||||||
|
HSDProcess.ErrorDataReceived += (sender, e) => AddLog("HSD Error: " + e.Data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -752,17 +770,17 @@ namespace FireWallet
|
|||||||
toolStripStatusLabelLedger.Text = "Cold Wallet";
|
toolStripStatusLabelLedger.Text = "Cold Wallet";
|
||||||
toolStripStatusLabelLedger.Visible = true;
|
toolStripStatusLabelLedger.Visible = true;
|
||||||
buttonRevealAll.Visible = false;
|
buttonRevealAll.Visible = false;
|
||||||
|
buttonRedeemAll.Visible = false;
|
||||||
|
buttonSendAll.Visible = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WatchOnly = false;
|
WatchOnly = false;
|
||||||
toolStripStatusLabelLedger.Visible = false;
|
toolStripStatusLabelLedger.Visible = false;
|
||||||
buttonRevealAll.Visible = true;
|
buttonRevealAll.Visible = true;
|
||||||
|
buttonRedeemAll.Visible = true;
|
||||||
|
buttonSendAll.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (WatchOnly)
|
if (WatchOnly)
|
||||||
{
|
{
|
||||||
buttonAddressVerify.Visible = true;
|
buttonAddressVerify.Visible = true;
|
||||||
@@ -845,6 +863,120 @@ namespace FireWallet
|
|||||||
toolStripStatusLabelaccount.Text = "Account: Not Logged In";
|
toolStripStatusLabelaccount.Text = "Account: Not Logged In";
|
||||||
textBoxaccountpassword.Focus();
|
textBoxaccountpassword.Focus();
|
||||||
}
|
}
|
||||||
|
private async void buttonRevealAll_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
buttonRevealAll.Enabled = false;
|
||||||
|
string content = "{\"method\": \"sendreveal\"}";
|
||||||
|
string response = await APIPost("", true, content);
|
||||||
|
AddLog(response);
|
||||||
|
if (response == "Error")
|
||||||
|
{
|
||||||
|
AddLog("Error sending reveal");
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Error sending reveal");
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
buttonRevealAll.Enabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
JObject resp = JObject.Parse(response);
|
||||||
|
if (resp["error"].ToString() != "")
|
||||||
|
{
|
||||||
|
AddLog("Error sending reveal");
|
||||||
|
AddLog(resp["error"].ToString());
|
||||||
|
JObject error = JObject.Parse(resp["error"].ToString());
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Error sending reveal\n" + error["message"].ToString());
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
buttonRevealAll.Enabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (resp.ContainsKey("result"))
|
||||||
|
{
|
||||||
|
JObject result = JObject.Parse(resp["result"].ToString());
|
||||||
|
string hash = result["hash"].ToString();
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Reveal sent\n" + hash, "Explorer", UserSettings["explorer-tx"] + hash);
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
}
|
||||||
|
buttonRevealAll.Enabled = true;
|
||||||
|
}
|
||||||
|
private async void buttonRedeemAll_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
buttonRedeemAll.Enabled = false;
|
||||||
|
string content = "{\"method\": \"sendbatch\", \"params\":[[[\"REDEEM\"]]]}";
|
||||||
|
AddLog(content);
|
||||||
|
string response = await APIPost("", true, content);
|
||||||
|
if (response == "Error")
|
||||||
|
{
|
||||||
|
AddLog("Error sending batch");
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Error sending batch");
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
buttonRedeemAll.Enabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
JObject resp = JObject.Parse(response);
|
||||||
|
if (resp["error"].ToString() != "")
|
||||||
|
{
|
||||||
|
AddLog("Error sending batch");
|
||||||
|
AddLog(resp["error"].ToString());
|
||||||
|
JObject error = JObject.Parse(resp["error"].ToString());
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Error sending batch\n" + error["message"].ToString());
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
buttonRedeemAll.Enabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (resp.ContainsKey("result"))
|
||||||
|
{
|
||||||
|
JObject result = JObject.Parse(resp["result"].ToString());
|
||||||
|
string hash = result["hash"].ToString();
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Batch sent\n" + hash, "Explorer", UserSettings["explorer-tx"] + hash);
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
}
|
||||||
|
buttonRedeemAll.Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void buttonSendAll_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
buttonSendAll.Enabled = false;
|
||||||
|
string content = "{\"method\": \"sendbatch\", \"params\":[[[\"REVEAL\"],[\"REDEEM\"],[\"RENEW\"]]]}";
|
||||||
|
AddLog(content);
|
||||||
|
string response = await APIPost("", true, content);
|
||||||
|
if (response == "Error")
|
||||||
|
{
|
||||||
|
AddLog("Error sending batch");
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Error sending batch");
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
buttonSendAll.Enabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
JObject resp = JObject.Parse(response);
|
||||||
|
if (resp["error"].ToString() != "")
|
||||||
|
{
|
||||||
|
AddLog("Error sending batch");
|
||||||
|
AddLog(resp["error"].ToString());
|
||||||
|
JObject error = JObject.Parse(resp["error"].ToString());
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Error sending batch\n" + error["message"].ToString());
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
buttonSendAll.Enabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (resp.ContainsKey("result"))
|
||||||
|
{
|
||||||
|
JObject result = JObject.Parse(resp["result"].ToString());
|
||||||
|
string hash = result["hash"].ToString();
|
||||||
|
NotifyForm notifyForm = new NotifyForm("Batch sent\n" + hash, "Explorer", UserSettings["explorer-tx"] + hash);
|
||||||
|
notifyForm.ShowDialog();
|
||||||
|
notifyForm.Dispose();
|
||||||
|
}
|
||||||
|
buttonSendAll.Enabled = true;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region API
|
#region API
|
||||||
HttpClient httpClient = new HttpClient();
|
HttpClient httpClient = new HttpClient();
|
||||||
@@ -918,23 +1050,30 @@ namespace FireWallet
|
|||||||
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Post, "http://" + ip + ":" + port + "/" + path);
|
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Post, "http://" + ip + ":" + port + "/" + path);
|
||||||
req.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("x:" + key)));
|
req.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("x:" + key)));
|
||||||
req.Content = new StringContent(content);
|
req.Content = new StringContent(content);
|
||||||
|
|
||||||
// Send request
|
// Send request
|
||||||
HttpResponseMessage resp = await httpClient.SendAsync(req);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
resp.EnsureSuccessStatusCode();
|
HttpResponseMessage resp = await httpClient.SendAsync(req);
|
||||||
|
if (!resp.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
AddLog("Post Error: " + resp.StatusCode);
|
||||||
|
AddLog(await resp.Content.ReadAsStringAsync());
|
||||||
|
return "Error";
|
||||||
|
}
|
||||||
|
return await resp.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
AddLog("Post Error: " + ex.Message);
|
AddLog("Post Error: " + ex.Message);
|
||||||
AddLog(await resp.Content.ReadAsStringAsync());
|
if (ex.Message.Contains("The request was canceled due to the configured HttpClient.Timeout"))
|
||||||
AddLog("Content: " + content);
|
{
|
||||||
|
await RestartNode();
|
||||||
|
}
|
||||||
return "Error";
|
return "Error";
|
||||||
}
|
}
|
||||||
|
|
||||||
return await resp.Content.ReadAsStringAsync();
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get from HSD API
|
/// Get from HSD API
|
||||||
@@ -964,7 +1103,12 @@ namespace FireWallet
|
|||||||
request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("x:" + key)));
|
request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("x:" + key)));
|
||||||
// Send request and log response
|
// Send request and log response
|
||||||
HttpResponseMessage response = await httpClient.SendAsync(request);
|
HttpResponseMessage response = await httpClient.SendAsync(request);
|
||||||
response.EnsureSuccessStatusCode();
|
if (!response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
AddLog("Get Error: " + response.StatusCode);
|
||||||
|
AddLog(await response.Content.ReadAsStringAsync());
|
||||||
|
return "Error";
|
||||||
|
}
|
||||||
return await response.Content.ReadAsStringAsync();
|
return await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -972,9 +1116,148 @@ namespace FireWallet
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
AddLog("Get Error: " + ex.Message);
|
AddLog("Get Error: " + ex.Message);
|
||||||
|
if (ex.Message.Contains("The request was canceled due to the configured HttpClient.Timeout"))
|
||||||
|
{
|
||||||
|
await RestartNode();
|
||||||
|
}
|
||||||
return "Error";
|
return "Error";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private async Task<bool> RestartNode()
|
||||||
|
{
|
||||||
|
if (!HSD)
|
||||||
|
{
|
||||||
|
NotifyForm nf = new NotifyForm("NODE Not responding");
|
||||||
|
nf.ShowDialog();
|
||||||
|
nf.Dispose();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.Enabled = false;
|
||||||
|
this.Visible = false;
|
||||||
|
// Show splash
|
||||||
|
SplashScreen ss = new SplashScreen(false);
|
||||||
|
bool splash = false;
|
||||||
|
if (UserSettings.ContainsKey("hide-splash"))
|
||||||
|
{
|
||||||
|
if (UserSettings["hide-splash"] == "false")
|
||||||
|
{
|
||||||
|
// Show splash screen
|
||||||
|
ss.Show();
|
||||||
|
splash = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Show splash screen
|
||||||
|
ss.Show();
|
||||||
|
splash = true;
|
||||||
|
}
|
||||||
|
// Kill node
|
||||||
|
if (HSDProcess != null)
|
||||||
|
{
|
||||||
|
HSDProcess.Kill();
|
||||||
|
AddLog("Killed HSD");
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
HSDProcess.Dispose();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
AddLog("Dispose failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else AddLog("HSD was not running");
|
||||||
|
|
||||||
|
HSDProcess = new Process();
|
||||||
|
bool hideScreen = true;
|
||||||
|
if (NodeSettings.ContainsKey("HideScreen"))
|
||||||
|
{
|
||||||
|
if (NodeSettings["HideScreen"].ToLower() == "false")
|
||||||
|
{
|
||||||
|
hideScreen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
HSDProcess.StartInfo.CreateNoWindow = hideScreen;
|
||||||
|
if (hideScreen)
|
||||||
|
{
|
||||||
|
HSDProcess.StartInfo.RedirectStandardError = true;
|
||||||
|
HSDProcess.ErrorDataReceived += (sender, e) => AddLog("HSD Error: " + e.Data);
|
||||||
|
}
|
||||||
|
else HSDProcess.StartInfo.RedirectStandardError = false;
|
||||||
|
|
||||||
|
HSDProcess.StartInfo.RedirectStandardInput = true;
|
||||||
|
HSDProcess.StartInfo.RedirectStandardOutput = false;
|
||||||
|
HSDProcess.StartInfo.UseShellExecute = false;
|
||||||
|
HSDProcess.StartInfo.FileName = "node.exe";
|
||||||
|
|
||||||
|
if (NodeSettings.ContainsKey("HSD-command"))
|
||||||
|
{
|
||||||
|
AddLog("Using custom HSD command");
|
||||||
|
string command = NodeSettings["HSD-command"];
|
||||||
|
command = command.Replace("{default-dir}", dir + "hsd\\bin\\hsd");
|
||||||
|
|
||||||
|
string bobPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Bob\\hsd_data";
|
||||||
|
if (Directory.Exists(bobPath))
|
||||||
|
{
|
||||||
|
command = command.Replace("{Bob}", bobPath);
|
||||||
|
}
|
||||||
|
else if (command.Contains("{Bob}"))
|
||||||
|
{
|
||||||
|
AddLog("Bob not found, using default HSD command");
|
||||||
|
command = dir + "hsd\\bin\\hsd --agent=FireWallet --index-tx --index-address --api-key " + NodeSettings["Key"];
|
||||||
|
}
|
||||||
|
|
||||||
|
command = command.Replace("{key}", NodeSettings["Key"]);
|
||||||
|
HSDProcess.StartInfo.Arguments = command;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddLog("Using default HSD command");
|
||||||
|
HSDProcess.StartInfo.Arguments = dir + "hsd\\bin\\hsd --agent=FireWallet --index-tx --index-address --api-key " + NodeSettings["Key"];
|
||||||
|
string bobPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Bob\\hsd_data";
|
||||||
|
if (Directory.Exists(bobPath))
|
||||||
|
{
|
||||||
|
HSDProcess.StartInfo.Arguments = HSDProcess.StartInfo.Arguments + " --prefix " + bobPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HSDProcess.Start();
|
||||||
|
// Wait for HSD to start
|
||||||
|
await Task.Delay(2000);
|
||||||
|
|
||||||
|
// Check if HSD is running
|
||||||
|
if (HSDProcess.HasExited)
|
||||||
|
{
|
||||||
|
AddLog("HSD Failed to start");
|
||||||
|
AddLog(HSDProcess.StandardError.ReadToEnd());
|
||||||
|
NotifyForm Notifyinstall = new NotifyForm("HSD Failed to start\nPlease check the logs");
|
||||||
|
Notifyinstall.ShowDialog();
|
||||||
|
Notifyinstall.Dispose();
|
||||||
|
|
||||||
|
// Wait for the notification to show
|
||||||
|
await Task.Delay(1000);
|
||||||
|
this.Close();
|
||||||
|
|
||||||
|
await Task.Delay(1000);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
AddLog("HSD Failed to start");
|
||||||
|
AddLog(ex.Message);
|
||||||
|
this.Close();
|
||||||
|
await Task.Delay(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (splash) ss.CloseSplash();
|
||||||
|
this.Enabled = true;
|
||||||
|
this.Visible = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
private async Task<string> GetAddress()
|
private async Task<string> GetAddress()
|
||||||
{
|
{
|
||||||
string content = "{\"account\":\"default\"}";
|
string content = "{\"account\":\"default\"}";
|
||||||
@@ -985,8 +1268,12 @@ namespace FireWallet
|
|||||||
AddLog("GetAddress Error");
|
AddLog("GetAddress Error");
|
||||||
return "Error";
|
return "Error";
|
||||||
}
|
}
|
||||||
JObject resp = JObject.Parse(APIresponse);
|
try
|
||||||
return resp["address"].ToString();
|
{
|
||||||
|
JObject resp = JObject.Parse(APIresponse);
|
||||||
|
return resp["address"].ToString();
|
||||||
|
}
|
||||||
|
catch { return "Error"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void GetTXHistory()
|
private async void GetTXHistory()
|
||||||
@@ -1174,6 +1461,7 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
private async Task<string> GetFee()
|
private async Task<string> GetFee()
|
||||||
{
|
{
|
||||||
|
// This doesn't work
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string response = await APIPost("", false, "{\"method\": \"estimatefee\",\"params\": [ 3 ]}");
|
string response = await APIPost("", false, "{\"method\": \"estimatefee\",\"params\": [ 3 ]}");
|
||||||
@@ -1314,7 +1602,6 @@ namespace FireWallet
|
|||||||
panelRecieve.Hide();
|
panelRecieve.Hide();
|
||||||
panelDomains.Hide();
|
panelDomains.Hide();
|
||||||
panelSettings.Hide();
|
panelSettings.Hide();
|
||||||
panelBids.Hide();
|
|
||||||
buttonNavPortfolio.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
buttonNavPortfolio.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
||||||
buttonNavPortfolio.ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
|
buttonNavPortfolio.ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
|
||||||
buttonNavSend.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
buttonNavSend.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
||||||
@@ -1325,8 +1612,6 @@ namespace FireWallet
|
|||||||
buttonNavDomains.ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
|
buttonNavDomains.ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
|
||||||
buttonNavSettings.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
buttonNavSettings.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
||||||
buttonNavSettings.ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
|
buttonNavSettings.ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
|
||||||
buttonNavBids.BackColor = ColorTranslator.FromHtml(Theme["background"]);
|
|
||||||
buttonNavBids.ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
|
|
||||||
}
|
}
|
||||||
private void buttonNavSettings_Click(object sender, EventArgs e)
|
private void buttonNavSettings_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -1349,19 +1634,6 @@ namespace FireWallet
|
|||||||
numericUpDownTXCount.Value = int.Parse(UserSettings["portfolio-tx"]);
|
numericUpDownTXCount.Value = int.Parse(UserSettings["portfolio-tx"]);
|
||||||
labelSettingsSaved.Hide();
|
labelSettingsSaved.Hide();
|
||||||
}
|
}
|
||||||
private void buttonNavBids_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
hidePages();
|
|
||||||
if (Theme.ContainsKey("selected-bg") && Theme.ContainsKey("selected-fg"))
|
|
||||||
{
|
|
||||||
buttonNavBids.BackColor = ColorTranslator.FromHtml(Theme["selected-bg"]);
|
|
||||||
buttonNavBids.ForeColor = ColorTranslator.FromHtml(Theme["selected-fg"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
panelBids.Show();
|
|
||||||
panelBids.Dock = DockStyle.Fill;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Send
|
#region Send
|
||||||
|
|
||||||
@@ -1991,140 +2263,113 @@ namespace FireWallet
|
|||||||
private async void UpdateDomains()
|
private async void UpdateDomains()
|
||||||
{
|
{
|
||||||
string response = await APIGet("wallet/" + Account + "/name?own=true", true);
|
string response = await APIGet("wallet/" + Account + "/name?own=true", true);
|
||||||
JArray names = JArray.Parse(response);
|
|
||||||
Domains = new string[names.Count];
|
|
||||||
DomainsRenewable = new string[names.Count];
|
|
||||||
int i = 0;
|
|
||||||
int renewable = 0;
|
|
||||||
panelDomainList.Controls.Clear();
|
|
||||||
|
|
||||||
// Sort the domains
|
try
|
||||||
switch (comboBoxDomainSort.Text)
|
|
||||||
{
|
{
|
||||||
case "Default":
|
JArray names = JArray.Parse(response);
|
||||||
break;
|
Domains = new string[names.Count];
|
||||||
case "Alphabetical":
|
DomainsRenewable = new string[names.Count];
|
||||||
names = new JArray(names.OrderBy(obj => (string)obj["name"]));
|
int i = 0;
|
||||||
break;
|
int renewable = 0;
|
||||||
case "Expiring":
|
panelDomainList.Controls.Clear();
|
||||||
names = new JArray(names.OrderBy(obj =>
|
|
||||||
|
// 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)
|
||||||
|
{
|
||||||
|
Domains[i] = name["name"].ToString();
|
||||||
|
Panel domainTMP = new Panel();
|
||||||
|
domainTMP.Width = panelDomainList.Width - 20 - SystemInformation.VerticalScrollBarWidth;
|
||||||
|
domainTMP.Height = 30;
|
||||||
|
domainTMP.Top = 30 * (i);
|
||||||
|
domainTMP.Left = 10;
|
||||||
|
domainTMP.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
|
||||||
|
Label domainName = new Label();
|
||||||
|
domainName.Text = Domains[i];
|
||||||
|
domainName.Top = 5;
|
||||||
|
domainName.Left = 5;
|
||||||
|
domainName.AutoSize = true;
|
||||||
|
|
||||||
|
|
||||||
|
domainTMP.Controls.Add(domainName);
|
||||||
|
|
||||||
|
if (!name.ContainsKey("stats"))
|
||||||
{
|
{
|
||||||
JToken daysUntilExpireToken = obj["stats"]?["daysUntilExpire"];
|
AddLog("Domain " + Domains[i] + " does not have stats");
|
||||||
return (int)(daysUntilExpireToken ?? int.MaxValue);
|
continue;
|
||||||
}));
|
}
|
||||||
break;
|
Label expiry = new Label();
|
||||||
case "Value":
|
JObject stats = JObject.Parse(name["stats"].ToString());
|
||||||
// Sort by most valuable first
|
if (stats.ContainsKey("daysUntilExpire"))
|
||||||
names = new JArray(names.OrderByDescending(obj =>
|
|
||||||
{
|
{
|
||||||
JToken valueToken = obj?["value"];
|
expiry.Text = "Expires: " + stats["daysUntilExpire"].ToString() + " days";
|
||||||
return (int)(valueToken ?? 0);
|
expiry.Top = 5;
|
||||||
}));
|
expiry.AutoSize = true;
|
||||||
break;
|
expiry.Left = domainTMP.Width - expiry.Width - 100;
|
||||||
}
|
domainTMP.Controls.Add(expiry);
|
||||||
|
|
||||||
|
// Add to domains renewable
|
||||||
|
DomainsRenewable[renewable] = Domains[i];
|
||||||
|
renewable++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
expiry.Text = "Expires: Not Registered yet";
|
||||||
|
expiry.Top = 5;
|
||||||
|
expiry.AutoSize = true;
|
||||||
|
expiry.Left = domainTMP.Width - expiry.Width - 100;
|
||||||
|
domainTMP.Controls.Add(expiry);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (JObject name in names)
|
// On Click open domain
|
||||||
{
|
domainTMP.Click += new EventHandler((sender, e) =>
|
||||||
Domains[i] = name["name"].ToString();
|
|
||||||
Panel domainTMP = new Panel();
|
|
||||||
domainTMP.Width = panelDomainList.Width - 20 - SystemInformation.VerticalScrollBarWidth;
|
|
||||||
domainTMP.Height = 30;
|
|
||||||
domainTMP.Top = 30 * (i);
|
|
||||||
domainTMP.Left = 10;
|
|
||||||
domainTMP.BorderStyle = BorderStyle.FixedSingle;
|
|
||||||
|
|
||||||
Label domainName = new Label();
|
|
||||||
domainName.Text = Domains[i];
|
|
||||||
domainName.Top = 5;
|
|
||||||
domainName.Left = 5;
|
|
||||||
domainName.AutoSize = true;
|
|
||||||
|
|
||||||
|
|
||||||
domainTMP.Controls.Add(domainName);
|
|
||||||
|
|
||||||
if (!name.ContainsKey("stats"))
|
|
||||||
{
|
|
||||||
AddLog("Domain " + Domains[i] + " does not have stats");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
Label expiry = new Label();
|
|
||||||
JObject stats = JObject.Parse(name["stats"].ToString());
|
|
||||||
if (stats.ContainsKey("daysUntilExpire"))
|
|
||||||
{
|
|
||||||
expiry.Text = "Expires: " + stats["daysUntilExpire"].ToString() + " days";
|
|
||||||
expiry.Top = 5;
|
|
||||||
expiry.AutoSize = true;
|
|
||||||
expiry.Left = domainTMP.Width - expiry.Width - 100;
|
|
||||||
domainTMP.Controls.Add(expiry);
|
|
||||||
|
|
||||||
// Add to domains renewable
|
|
||||||
DomainsRenewable[renewable] = Domains[i];
|
|
||||||
renewable++;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
expiry.Text = "Expires: Not Registered yet";
|
|
||||||
expiry.Top = 5;
|
|
||||||
expiry.AutoSize = true;
|
|
||||||
expiry.Left = domainTMP.Width - expiry.Width - 100;
|
|
||||||
domainTMP.Controls.Add(expiry);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// On Click open domain
|
|
||||||
domainTMP.Click += new EventHandler((sender, e) =>
|
|
||||||
{
|
|
||||||
DomainForm domainForm = new DomainForm(this, name["name"].ToString(), UserSettings["explorer-tx"], UserSettings["explorer-domain"]);
|
|
||||||
domainForm.Show();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
foreach (Control c in domainTMP.Controls)
|
|
||||||
{
|
|
||||||
c.Click += new EventHandler((sender, e) =>
|
|
||||||
{
|
{
|
||||||
DomainForm domainForm = new DomainForm(this, name["name"].ToString(), UserSettings["explorer-tx"], UserSettings["explorer-domain"]);
|
DomainForm domainForm = new DomainForm(this, name["name"].ToString(), UserSettings["explorer-tx"], UserSettings["explorer-domain"]);
|
||||||
domainForm.Show();
|
domainForm.Show();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
panelDomainList.Controls.Add(domainTMP);
|
|
||||||
i++;
|
foreach (Control c in domainTMP.Controls)
|
||||||
|
{
|
||||||
|
c.Click += new EventHandler((sender, e) =>
|
||||||
|
{
|
||||||
|
DomainForm domainForm = new DomainForm(this, name["name"].ToString(), UserSettings["explorer-tx"], UserSettings["explorer-domain"]);
|
||||||
|
domainForm.Show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
panelDomainList.Controls.Add(domainTMP);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
private async void buttonRevealAll_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string content = "{\"method\": \"sendreveal\"}";
|
|
||||||
string response = await APIPost("", true, content);
|
|
||||||
AddLog(response);
|
|
||||||
if (response == "Error")
|
|
||||||
{
|
{
|
||||||
AddLog("Error sending reveal");
|
AddLog("Error getting domains");
|
||||||
NotifyForm notifyForm = new NotifyForm("Error sending reveal");
|
AddLog(ex.Message);
|
||||||
notifyForm.ShowDialog();
|
|
||||||
notifyForm.Dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
JObject resp = JObject.Parse(response);
|
|
||||||
if (resp["error"].ToString() != "")
|
|
||||||
{
|
|
||||||
AddLog("Error sending reveal");
|
|
||||||
AddLog(resp["error"].ToString());
|
|
||||||
JObject error = JObject.Parse(resp["error"].ToString());
|
|
||||||
NotifyForm notifyForm = new NotifyForm("Error sending reveal\n" + error["message"].ToString());
|
|
||||||
notifyForm.ShowDialog();
|
|
||||||
notifyForm.Dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (resp.ContainsKey("result"))
|
|
||||||
{
|
|
||||||
JObject result = JObject.Parse(resp["result"].ToString());
|
|
||||||
string hash = result["hash"].ToString();
|
|
||||||
NotifyForm notifyForm = new NotifyForm("Reveal sent\n" + hash, "Explorer", UserSettings["explorer-tx"] + hash);
|
|
||||||
notifyForm.ShowDialog();
|
|
||||||
notifyForm.Dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void textBoxDomainSearch_KeyDown(object sender, KeyEventArgs e)
|
private void textBoxDomainSearch_KeyDown(object sender, KeyEventArgs e)
|
||||||
@@ -2369,5 +2614,7 @@ namespace FireWallet
|
|||||||
Process.Start(psi);
|
Process.Start(psi);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
10
FireWallet/Properties/Resources.Designer.cs
generated
10
FireWallet/Properties/Resources.Designer.cs
generated
@@ -59,5 +59,15 @@ namespace FireWallet.Properties {
|
|||||||
resourceCulture = value;
|
resourceCulture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap FWSplash {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("FWSplash", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,4 +117,8 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="FWSplash" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\FWSplash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
BIN
FireWallet/Resources/FWSplash.png
Normal file
BIN
FireWallet/Resources/FWSplash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
50
FireWallet/SplashScreen.Designer.cs
generated
50
FireWallet/SplashScreen.Designer.cs
generated
@@ -28,11 +28,18 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
|
components = new System.ComponentModel.Container();
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SplashScreen));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SplashScreen));
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
pictureBox1 = new PictureBox();
|
pictureBox1 = new PictureBox();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
|
panelNew = new Panel();
|
||||||
|
pictureBoxNew = new PictureBox();
|
||||||
|
timerIn = new System.Windows.Forms.Timer(components);
|
||||||
|
timerOut = new System.Windows.Forms.Timer(components);
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
||||||
|
panelNew.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pictureBoxNew).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
@@ -67,12 +74,45 @@
|
|||||||
label2.Text = "Nathan.Woodburn/";
|
label2.Text = "Nathan.Woodburn/";
|
||||||
label2.Click += label2_Click;
|
label2.Click += label2_Click;
|
||||||
//
|
//
|
||||||
|
// panelNew
|
||||||
|
//
|
||||||
|
panelNew.Controls.Add(pictureBoxNew);
|
||||||
|
panelNew.Dock = DockStyle.Fill;
|
||||||
|
panelNew.Location = new Point(0, 0);
|
||||||
|
panelNew.Name = "panelNew";
|
||||||
|
panelNew.Size = new Size(450, 450);
|
||||||
|
panelNew.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// pictureBoxNew
|
||||||
|
//
|
||||||
|
pictureBoxNew.BackColor = Color.Black;
|
||||||
|
pictureBoxNew.Dock = DockStyle.Fill;
|
||||||
|
pictureBoxNew.Image = Properties.Resources.FWSplash;
|
||||||
|
pictureBoxNew.InitialImage = null;
|
||||||
|
pictureBoxNew.Location = new Point(0, 0);
|
||||||
|
pictureBoxNew.Name = "pictureBoxNew";
|
||||||
|
pictureBoxNew.Size = new Size(450, 450);
|
||||||
|
pictureBoxNew.SizeMode = PictureBoxSizeMode.Zoom;
|
||||||
|
pictureBoxNew.TabIndex = 0;
|
||||||
|
pictureBoxNew.TabStop = false;
|
||||||
|
pictureBoxNew.Visible = false;
|
||||||
|
//
|
||||||
|
// timerIn
|
||||||
|
//
|
||||||
|
timerIn.Enabled = true;
|
||||||
|
timerIn.Tick += timerIn_Tick;
|
||||||
|
//
|
||||||
|
// timerOut
|
||||||
|
//
|
||||||
|
timerOut.Tick += timerOut_Tick;
|
||||||
|
//
|
||||||
// SplashScreen
|
// SplashScreen
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
BackColor = Color.Black;
|
BackColor = Color.Black;
|
||||||
ClientSize = new Size(444, 435);
|
ClientSize = new Size(450, 450);
|
||||||
|
Controls.Add(panelNew);
|
||||||
Controls.Add(label2);
|
Controls.Add(label2);
|
||||||
Controls.Add(pictureBox1);
|
Controls.Add(pictureBox1);
|
||||||
Controls.Add(label1);
|
Controls.Add(label1);
|
||||||
@@ -83,8 +123,12 @@
|
|||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
Text = "FireWallet";
|
Text = "FireWallet";
|
||||||
|
TopMost = true;
|
||||||
FormClosing += SplashScreen_FormClosing;
|
FormClosing += SplashScreen_FormClosing;
|
||||||
|
Load += SplashScreen_Load;
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
||||||
|
panelNew.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)pictureBoxNew).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
@@ -93,5 +137,9 @@
|
|||||||
private Label label1;
|
private Label label1;
|
||||||
private PictureBox pictureBox1;
|
private PictureBox pictureBox1;
|
||||||
private Label label2;
|
private Label label2;
|
||||||
|
private Panel panelNew;
|
||||||
|
private PictureBox pictureBoxNew;
|
||||||
|
private System.Windows.Forms.Timer timerIn;
|
||||||
|
private System.Windows.Forms.Timer timerOut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Collections.Generic;
|
using System.Drawing.Imaging;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace FireWallet
|
namespace FireWallet
|
||||||
{
|
{
|
||||||
@@ -17,8 +10,10 @@ namespace FireWallet
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
close = false;
|
close = false;
|
||||||
|
IsClosed = false;
|
||||||
}
|
}
|
||||||
bool close;
|
bool close;
|
||||||
|
float opacity = 0.0f;
|
||||||
private void SplashScreen_FormClosing(object sender, FormClosingEventArgs e)
|
private void SplashScreen_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
if (!close)
|
if (!close)
|
||||||
@@ -26,12 +21,15 @@ namespace FireWallet
|
|||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public bool IsClosed { get; set; }
|
||||||
public void CloseSplash()
|
public void CloseSplash()
|
||||||
{
|
{
|
||||||
close = true;
|
close = true;
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Fade out
|
||||||
|
timerIn.Stop();
|
||||||
|
timerOut.Start();
|
||||||
|
}
|
||||||
private void label2_Click(object sender, EventArgs e)
|
private void label2_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ProcessStartInfo psi = new ProcessStartInfo
|
ProcessStartInfo psi = new ProcessStartInfo
|
||||||
@@ -41,5 +39,56 @@ namespace FireWallet
|
|||||||
};
|
};
|
||||||
Process.Start(psi);
|
Process.Start(psi);
|
||||||
}
|
}
|
||||||
|
Bitmap splash = new Bitmap(Properties.Resources.FWSplash);
|
||||||
|
private void SplashScreen_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
pictureBoxNew.Visible = true;
|
||||||
|
this.TransparencyKey = Color.FromArgb(0, 0, 0);
|
||||||
|
pictureBoxNew.Invalidate();
|
||||||
|
}
|
||||||
|
public Image SetImageOpacity(Image image, float opacity)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Bitmap bmp = new Bitmap(image.Width, image.Height);
|
||||||
|
using (Graphics gfx = Graphics.FromImage(bmp))
|
||||||
|
{
|
||||||
|
ColorMatrix matrix = new ColorMatrix();
|
||||||
|
matrix.Matrix33 = opacity;
|
||||||
|
ImageAttributes attributes = new ImageAttributes();
|
||||||
|
attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
|
||||||
|
gfx.DrawImage(image, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes);
|
||||||
|
}
|
||||||
|
return bmp;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void timerIn_Tick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (opacity >= 1)
|
||||||
|
{
|
||||||
|
timerIn.Stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
opacity += 0.05f;
|
||||||
|
pictureBoxNew.Image = SetImageOpacity(splash, opacity);
|
||||||
|
pictureBoxNew.Invalidate();
|
||||||
|
}
|
||||||
|
private void timerOut_Tick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (opacity <= 0)
|
||||||
|
{
|
||||||
|
timerOut.Stop();
|
||||||
|
IsClosed = true;
|
||||||
|
this.Close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
opacity -= 0.05f;
|
||||||
|
pictureBoxNew.Image = SetImageOpacity(splash, opacity);
|
||||||
|
pictureBoxNew.Invalidate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -898,6 +898,12 @@
|
|||||||
AAAAAAAAAAAAAADQwWbM+D8RAPjBClJL0gAAAABJRU5ErkJggg==
|
AAAAAAAAAAAAAADQwWbM+D8RAPjBClJL0gAAAABJRU5ErkJggg==
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
|
<metadata name="timerIn.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="timerOut.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>104, 17</value>
|
||||||
|
</metadata>
|
||||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
AAABAAEAAAAAAAEAIAB2pAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAOEAAADAAgGAAAAfG+p9QAAIABJ
|
AAABAAEAAAAAAAEAIAB2pAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAOEAAADAAgGAAAAfG+p9QAAIABJ
|
||||||
|
|||||||
BIN
FireWallet/favicon.ico
Normal file
BIN
FireWallet/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
@@ -224,15 +224,15 @@
|
|||||||
{
|
{
|
||||||
"Name" = "8:Microsoft Visual Studio"
|
"Name" = "8:Microsoft Visual Studio"
|
||||||
"ProductName" = "8:FireWallet"
|
"ProductName" = "8:FireWallet"
|
||||||
"ProductCode" = "8:{C118B90C-B5A0-4015-B03A-FB226DC02F54}"
|
"ProductCode" = "8:{E636567F-DDA4-4C6E-89B0-38DC64FD5528}"
|
||||||
"PackageCode" = "8:{FF49B317-BBC1-40D9-9AFF-315E3AEED79C}"
|
"PackageCode" = "8:{AEAF1ABA-01E0-4A71-A8CC-0D6DDA44E907}"
|
||||||
"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.3"
|
"ProductVersion" = "8:3.4"
|
||||||
"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"
|
||||||
|
|||||||
@@ -159,6 +159,12 @@ The `{default-dir}` will be replaced with the HSD directory `%appdata%\FireWalle
|
|||||||
The `{key}` will be replaced with the API key from the node.txt file.
|
The `{key}` will be replaced with the API key from the node.txt file.
|
||||||
The `{Bob}` will be replaced with the Bob wallet HSD data directory `%appdata%\Bob\hsd_data\` this is used to sync FireWallet with Bob's accounts and also stops you needing to sync the chain twice.
|
The `{Bob}` will be replaced with the Bob wallet HSD data directory `%appdata%\Bob\hsd_data\` this is used to sync FireWallet with Bob's accounts and also stops you needing to sync the chain twice.
|
||||||
|
|
||||||
|
Other settings are here. These are the default and if they are not in the file they revert to these values.
|
||||||
|
```yaml
|
||||||
|
HideScreen: True # Hide the HSD terminal screen (Set to False for higher reliability)
|
||||||
|
Timeout: 10 # The time in seconds to wait for any API request
|
||||||
|
```
|
||||||
|
|
||||||
## theme.txt
|
## theme.txt
|
||||||
This file stores the theme settings.
|
This file stores the theme settings.
|
||||||
The theme is the color scheme of the application.
|
The theme is the color scheme of the application.
|
||||||
|
|||||||
Reference in New Issue
Block a user