1 Commits

Author SHA1 Message Date
f371f3da49 main: Attempted to add seed phrase decryption 2023-06-16 15:36:58 +10:00
15 changed files with 439 additions and 507 deletions

View File

@@ -1,10 +1,12 @@
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Text;
using System.Windows.Forms.VisualStyles;
using Microsoft.VisualBasic;
using Newtonsoft.Json.Linq;
using ContentAlignment = System.Drawing.ContentAlignment;
using Point = System.Drawing.Point;
namespace FireWallet
@@ -463,7 +465,7 @@ namespace FireWallet
HttpClient httpClient = new HttpClient();
private async void buttonSend_Click(object sender, EventArgs e)
{
if (!mainForm.WatchOnly)
if (!mainForm.watchOnly)
{
string batchTX = "[" + string.Join(", ", batches.Select(batch => batch.ToString())) + "]";
string content = "{\"method\": \"sendbatch\",\"params\":[ " + batchTX + "]}";
@@ -506,7 +508,7 @@ namespace FireWallet
JObject result = JObject.Parse(jObject["result"].ToString());
string hash = result["hash"].ToString();
AddLog("Batch sent with hash: " + hash);
NotifyForm notifyForm2 = new NotifyForm("Batch sent\nThis might take a while to mine.", "Explorer", mainForm.UserSettings["explorer-tx"] + hash);
NotifyForm notifyForm2 = new NotifyForm("Batch sent\nThis might take a while to mine.", "Explorer", mainForm.userSettings["explorer-tx"] + hash);
notifyForm2.ShowDialog();
notifyForm2.Dispose();
this.Close();
@@ -550,7 +552,7 @@ namespace FireWallet
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.FileName = "node.exe";
proc.StartInfo.WorkingDirectory = dir + "hsd-ledger/bin/";
string args = "hsd-ledger/bin/hsd-ledger sendraw \"\"" + response.Replace("\"","\\\"") + "\"\" [" + domainslist + "] --api-key " + mainForm.NodeSettings["Key"] + " -w " + mainForm.Account;
string args = "hsd-ledger/bin/hsd-ledger sendraw \"\"" + response.Replace("\"","\\\"") + "\"\" [" + domainslist + "] --api-key " + mainForm.nodeSettings["Key"] + " -w " + mainForm.account;
proc.StartInfo.Arguments = dir + args;
var outputBuilder = new StringBuilder();
@@ -576,7 +578,7 @@ namespace FireWallet
if (output.Contains("Submitted TXID"))
{
string hash = output.Substring(output.IndexOf("Submitted TXID") + 16, 64);
string link = mainForm.UserSettings["explorer-tx"] + hash;
string link = mainForm.userSettings["explorer-tx"] + hash;
NotifyForm notifySuccess = new NotifyForm("Transaction Sent\nThis transaction could take up to 20 minutes to mine",
"Explorer", link);
notifySuccess.ShowDialog();
@@ -618,7 +620,7 @@ namespace FireWallet
}
else if (b.method == "UPDATE")
{
sw.WriteLine(b.domain + "," + b.method + ",[" + string.Join(";", b.update.Select(record => record.ToString())) + "]");
sw.WriteLine(b.domain + "," + b.method + ",[" + string.Join(", ", b.update.Select(record => record.ToString())) + "]");
}
else
{
@@ -650,54 +652,14 @@ namespace FireWallet
{
if (split[1] == "UPDATE")
{
// Join the rest of the line
string[] updateArray = new string[split.Length - 2];
for (int i = 0; i < updateArray.Length; i++)
// Select operation and import domains
string[] newDomains = new string[domains.Length + 1];
for (int i = 0; i < domains.Length; i++)
{
updateArray[i] = split[i + 2];
newDomains[i] = domains[i];
}
string updateString = string.Join(",", updateArray);
updateString.TrimStart('[');
updateString.TrimEnd(']');
string[] updateSplit = updateString.Split(';');
DNS[] UpdateRecords = new DNS[updateSplit.Length];
int r = 0;
foreach (string update in updateSplit)
{
string[] updateRecord = update.Split(',');
string type = updateRecord[0];
type = type.Split(':')[1].Replace("\"","").Trim();
switch (type)
{
case "NS":
string ns = updateRecord[1].Split(':')[1].Replace("\"","").Replace("}","").Trim();
UpdateRecords[r] = new DNS(type, ns);
break;
case "DS":
int keyTag = int.Parse(updateRecord[1].Split(':')[1]);
int algorithm = int.Parse(updateRecord[2].Split(':')[1]);
int digestType = int.Parse(updateRecord[3].Split(':')[1]);
string digest = updateRecord[4].Split(':')[1].Replace("\"", "").Replace("}", "");
UpdateRecords[r] = new DNS(type, keyTag, algorithm, digestType, digest);
break;
case "TXT":
string txt = updateRecord[1].Split(':')[1].Replace("\"", "").Replace("}", "");
txt = txt.Replace("[", "");
txt = txt.Replace("]", "");
UpdateRecords[r] = new DNS(type, new string[] { txt.Trim() });
break;
case "GLUE4":
case "GLUE6":
string nsGlue = updateRecord[1].Split(':')[1].Replace("\"", "").Trim();
string address = updateRecord[2].Split(':')[1].Replace("\"", "").Replace("}", "").Trim();
UpdateRecords[r] = new DNS(type, nsGlue, address);
break;
}
r++;
}
AddBatch(split[0], split[1], UpdateRecords);
newDomains[domains.Length] = split[0];
domains = newDomains;
continue;
}
}
@@ -777,10 +739,10 @@ namespace FireWallet
/// <returns></returns>
private async Task<string> APIPost(string path, bool wallet, string content)
{
string key = mainForm.NodeSettings["Key"];
string ip = mainForm.NodeSettings["IP"];
string key = mainForm.nodeSettings["Key"];
string ip = mainForm.nodeSettings["IP"];
string port = "1203";
if (mainForm.HSDNetwork == 1)
if (mainForm.network == 1)
{
port = "1303";
}

View File

@@ -27,7 +27,7 @@ namespace FireWallet
InitializeComponent();
this.domain = domain;
this.mainForm = mainForm;
nodeSettings = mainForm.NodeSettings;
nodeSettings = mainForm.nodeSettings;
cancel = true;
this.Text = domain + "/ DNS | FireWallet";
@@ -439,7 +439,7 @@ namespace FireWallet
string key = nodeSettings["Key"];
string ip = nodeSettings["IP"];
string port = "1203";
if (mainForm.HSDNetwork == 1)
if (mainForm.network == 1)
{
port = "1303";
}
@@ -478,7 +478,7 @@ namespace FireWallet
string ip = nodeSettings["IP"];
string port = "1203";
if (mainForm.HSDNetwork == 1)
if (mainForm.network == 1)
{
port = "1303";
}

View File

@@ -32,7 +32,7 @@ namespace FireWallet
this.explorerTX = explorerTX;
this.explorerName = explorerName;
this.mainForm = mainForm;
this.theme = mainForm.Theme;
this.theme = mainForm.theme;
// Apply theme
this.BackColor = ColorTranslator.FromHtml(theme["background"]);
@@ -47,7 +47,7 @@ namespace FireWallet
mainForm.ThemeControl(c);
}
applyTransparency(mainForm.Theme);
applyTransparency(mainForm.theme);
}
#region Theme
private void applyTransparency(Dictionary<string, string> theme)
@@ -157,7 +157,7 @@ namespace FireWallet
network = Convert.ToInt32(nodeSettings["Network"]);
GetName();
if (mainForm.WatchOnly)
if (mainForm.watchOnly)
{
buttonActionMain.Enabled = false; // Only allow sending in batches for ledger
}

View File

@@ -12,7 +12,7 @@
<PackageIcon>HSDBatcher.png</PackageIcon>
<RepositoryUrl>https://github.com/Nathanwoodburn/FireWallet</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>3.3</Version>
<Version>3.1</Version>
</PropertyGroup>
<ItemGroup>

View File

@@ -45,8 +45,6 @@ namespace FireWallet
githubToolStripMenuItem = new ToolStripMenuItem();
websiteToolStripMenuItem = new ToolStripMenuItem();
supportDiscordServerToolStripMenuItem = new ToolStripMenuItem();
toolStripSeparator1 = new ToolStripSeparator();
otherProjectsToolStripMenuItem = new ToolStripMenuItem();
timerNodeStatus = new System.Windows.Forms.Timer(components);
panelaccount = new Panel();
groupBoxaccount = new GroupBox();
@@ -97,7 +95,6 @@ namespace FireWallet
textBoxReceiveAddress = new TextBox();
labelReceive1 = new Label();
panelDomains = new Panel();
labelDomainSort = new Label();
comboBoxDomainSort = new ComboBox();
buttonExportDomains = new Button();
groupBoxDomains = new GroupBox();
@@ -126,6 +123,7 @@ namespace FireWallet
textBoxExAddr = new TextBox();
labelSettings4 = new Label();
textBoxExTX = new TextBox();
labelDomainSort = new Label();
statusStripmain.SuspendLayout();
panelaccount.SuspendLayout();
groupBoxaccount.SuspendLayout();
@@ -203,7 +201,7 @@ namespace FireWallet
// toolStripDropDownButtonHelp
//
toolStripDropDownButtonHelp.DisplayStyle = ToolStripItemDisplayStyle.Text;
toolStripDropDownButtonHelp.DropDownItems.AddRange(new ToolStripItem[] { githubToolStripMenuItem, websiteToolStripMenuItem, supportDiscordServerToolStripMenuItem, toolStripSeparator1, otherProjectsToolStripMenuItem });
toolStripDropDownButtonHelp.DropDownItems.AddRange(new ToolStripItem[] { githubToolStripMenuItem, websiteToolStripMenuItem, supportDiscordServerToolStripMenuItem });
toolStripDropDownButtonHelp.Image = (Image)resources.GetObject("toolStripDropDownButtonHelp.Image");
toolStripDropDownButtonHelp.ImageTransparentColor = Color.Magenta;
toolStripDropDownButtonHelp.Margin = new Padding(20, 2, 0, 0);
@@ -233,18 +231,6 @@ namespace FireWallet
supportDiscordServerToolStripMenuItem.Text = "Support Discord Server";
supportDiscordServerToolStripMenuItem.Click += supportDiscordServerToolStripMenuItem_Click;
//
// toolStripSeparator1
//
toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new Size(191, 6);
//
// otherProjectsToolStripMenuItem
//
otherProjectsToolStripMenuItem.Name = "otherProjectsToolStripMenuItem";
otherProjectsToolStripMenuItem.Size = new Size(194, 22);
otherProjectsToolStripMenuItem.Text = "Other Projects";
otherProjectsToolStripMenuItem.Click += otherProjectsToolStripMenuItem_Click;
//
// timerNodeStatus
//
timerNodeStatus.Enabled = true;
@@ -449,7 +435,7 @@ namespace FireWallet
panelPortfolio.Controls.Add(groupBoxTransactions);
panelPortfolio.Controls.Add(groupBoxinfo);
panelPortfolio.Controls.Add(groupBoxbalance);
panelPortfolio.Location = new Point(140, 35);
panelPortfolio.Location = new Point(1065, 80);
panelPortfolio.Name = "panelPortfolio";
panelPortfolio.Size = new Size(956, 538);
panelPortfolio.TabIndex = 7;
@@ -588,7 +574,7 @@ namespace FireWallet
panelSend.Controls.Add(labelSendingTo);
panelSend.Controls.Add(labelSendPrompt);
panelSend.Controls.Add(labelHIPArrow);
panelSend.Location = new Point(1041, 235);
panelSend.Location = new Point(138, 33);
panelSend.Name = "panelSend";
panelSend.Size = new Size(974, 521);
panelSend.TabIndex = 2;
@@ -806,22 +792,12 @@ namespace FireWallet
panelDomains.Controls.Add(groupBoxDomains);
panelDomains.Controls.Add(labelDomainSearch);
panelDomains.Controls.Add(textBoxDomainSearch);
panelDomains.Location = new Point(1122, 35);
panelDomains.Location = new Point(120, 48);
panelDomains.Name = "panelDomains";
panelDomains.Size = new Size(920, 536);
panelDomains.TabIndex = 18;
panelDomains.Visible = false;
//
// 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:";
//
// comboBoxDomainSort
//
comboBoxDomainSort.DropDownStyle = ComboBoxStyle.DropDownList;
@@ -1105,6 +1081,16 @@ namespace FireWallet
textBoxExTX.Size = new Size(307, 29);
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
//
AutoScaleDimensions = new SizeF(7F, 15F);
@@ -1124,7 +1110,6 @@ namespace FireWallet
Text = "FireWallet";
FormClosing += MainForm_Closing;
Load += MainForm_Load;
ResizeEnd += MainForm_ResizeEnd;
Resize += Form1_Resize;
statusStripmain.ResumeLayout(false);
statusStripmain.PerformLayout();
@@ -1249,7 +1234,5 @@ namespace FireWallet
private Label labelSendingHIPAddress;
private ComboBox comboBoxDomainSort;
private Label labelDomainSort;
private ToolStripSeparator toolStripSeparator1;
private ToolStripMenuItem otherProjectsToolStripMenuItem;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,7 @@ namespace FireWallet
private void NewAccountForm_Load(object sender, EventArgs e)
{
page = 0;
Dictionary<string, string> theme = mainForm.Theme;
Dictionary<string, string> theme = mainForm.theme;
this.BackColor = ColorTranslator.FromHtml(theme["background"]);
this.ForeColor = ColorTranslator.FromHtml(theme["foreground"]);
foreach (Control c in Controls)
@@ -208,7 +208,7 @@ namespace FireWallet
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.FileName = "node.exe";
proc.StartInfo.Arguments = mainForm.dir + "hsd-ledger/bin/hsd-ledger createwallet " + textBoxNewPass1.Text + " --api-key " + mainForm.NodeSettings["Key"];
proc.StartInfo.Arguments = mainForm.dir + "hsd-ledger/bin/hsd-ledger createwallet " + textBoxNewPass1.Text + " --api-key " + mainForm.nodeSettings["Key"];
var outputBuilder = new StringBuilder();
// Event handler for capturing output data
@@ -243,10 +243,10 @@ namespace FireWallet
HttpClient httpClient = new HttpClient();
private async Task<string> APIPut(string path, bool wallet, string content)
{
string key = mainForm.NodeSettings["Key"];
string ip = mainForm.NodeSettings["IP"];
string key = mainForm.nodeSettings["Key"];
string ip = mainForm.nodeSettings["IP"];
string port = "1203";
if (mainForm.HSDNetwork == 1)
if (mainForm.network == 1)
{
port = "1303";
}

View File

@@ -28,13 +28,21 @@
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SplashScreen));
timerSplashDelay = new System.Windows.Forms.Timer(components);
label1 = new Label();
pictureBox1 = new PictureBox();
label2 = new Label();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
SuspendLayout();
//
// timerSplashDelay
//
timerSplashDelay.Enabled = true;
timerSplashDelay.Interval = 3000;
timerSplashDelay.Tick += timerSplashDelay_Tick;
//
// label1
//
label1.AutoSize = true;
@@ -83,6 +91,7 @@
ShowInTaskbar = false;
StartPosition = FormStartPosition.CenterScreen;
Text = "FireWallet";
TopMost = true;
FormClosing += SplashScreen_FormClosing;
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
ResumeLayout(false);
@@ -90,6 +99,8 @@
}
#endregion
private System.Windows.Forms.Timer timerSplashDelay;
private Label label1;
private PictureBox pictureBox1;
private Label label2;

View File

@@ -13,25 +13,23 @@ namespace FireWallet
{
public partial class SplashScreen : Form
{
public SplashScreen(bool timer)
public SplashScreen()
{
InitializeComponent();
close = false;
}
bool close;
private void SplashScreen_FormClosing(object sender, FormClosingEventArgs e)
{
if (!close)
{
e.Cancel = true;
}
}
public void CloseSplash()
private void timerSplashDelay_Tick(object sender, EventArgs e)
{
close = true;
this.Close();
}
private void SplashScreen_FormClosing(object sender, FormClosingEventArgs e)
{
}
private void label2_Click(object sender, EventArgs e)
{
ProcessStartInfo psi = new ProcessStartInfo

View File

@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timerSplashDelay.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@@ -22,8 +22,8 @@ namespace FireWallet
{
InitializeComponent();
// Theme
this.BackColor = ColorTranslator.FromHtml(mainForm.Theme["background"]);
this.ForeColor = ColorTranslator.FromHtml(mainForm.Theme["foreground"]);
this.BackColor = ColorTranslator.FromHtml(mainForm.theme["background"]);
this.ForeColor = ColorTranslator.FromHtml(mainForm.theme["foreground"]);
foreach (Control c in Controls)
{
mainForm.ThemeControl(c);
@@ -35,7 +35,7 @@ namespace FireWallet
private async void TXForm_Load(object sender, EventArgs e)
{
tx = JObject.Parse(await mainForm.APIGet("wallet/"+mainForm.Account+"/tx/" + txid,true));
tx = JObject.Parse(await mainForm.APIGet("wallet/"+mainForm.account+"/tx/" + txid,true));
this.Text = "TX: " + tx["hash"].ToString();
labelHash.Text = "Hash: " + tx["hash"].ToString();
@@ -142,7 +142,7 @@ namespace FireWallet
private void Explorer_Click(object sender, EventArgs e)
{
// Open the transaction in a browser
string url = mainForm.UserSettings["explorer-tx"] + tx["hash"].ToString();
string url = mainForm.userSettings["explorer-tx"] + tx["hash"].ToString();
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = url,

View File

@@ -25,18 +25,18 @@ namespace FireWallet
Domain = domain;
this.Text = "Transfer " + Domain + " | FireWallet";
label1.Text = "Transfer " + Domain;
if (MainForm.Theme.ContainsKey("error"))
if (MainForm.theme.ContainsKey("error"))
{
labelError.ForeColor = ColorTranslator.FromHtml(MainForm.Theme["error"]);
labelError.ForeColor = ColorTranslator.FromHtml(MainForm.theme["error"]);
}
if (MainForm.WatchOnly)
if (MainForm.watchOnly)
{
buttonTransfer.Enabled = false; // watch only wallet only batch
}
// Theme
this.BackColor = ColorTranslator.FromHtml(MainForm.Theme["background"]);
this.ForeColor = ColorTranslator.FromHtml(MainForm.Theme["foreground"]);
this.BackColor = ColorTranslator.FromHtml(MainForm.theme["background"]);
this.ForeColor = ColorTranslator.FromHtml(MainForm.theme["foreground"]);
foreach (Control c in Controls)
{
MainForm.ThemeControl(c);
@@ -73,7 +73,7 @@ namespace FireWallet
}
JObject result = JObject.Parse(APIresp["result"].ToString());
string hash = result["hash"].ToString();
string link = MainForm.UserSettings["explorer-tx"] + hash;
string link = MainForm.userSettings["explorer-tx"] + hash;
NotifyForm notifySuccess = new NotifyForm("Transaction Sent\nThis transaction could take up to 20 minutes to mine",
"Explorer", link);
notifySuccess.ShowDialog();

View File

@@ -224,15 +224,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:FireWallet"
"ProductCode" = "8:{C118B90C-B5A0-4015-B03A-FB226DC02F54}"
"PackageCode" = "8:{FF49B317-BBC1-40D9-9AFF-315E3AEED79C}"
"ProductCode" = "8:{460D8F86-4FE9-4547-9B17-7E01ACBF9194}"
"PackageCode" = "8:{A6678F97-9CE8-4005-82AC-AB2D09A9DA27}"
"UpgradeCode" = "8:{0C86F725-6B01-4173-AA05-3F0EDF481362}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:3.3"
"ProductVersion" = "8:3.1"
"Manufacturer" = "8:Nathan.Woodburn/"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:https://l.woodburn.au/discord"

View File

@@ -113,6 +113,9 @@ You can add transactions to the batch from the domain window or the DNS editor.
You can also import a list of domains to the batch window.
The "CANCEL" transaction type is used to cancel an transfer.
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)
![Batch Import](assets/batch_import.png)
@@ -138,12 +141,6 @@ They are stored in `%appdata%\FireWallet\` (`C:\Users\{username}\AppData\Roaming
## settings.txt
This file stores the user settings for the application.
If you want to change the default HIP-02 resolver you can add these settings
```yaml
hip-02-ip: 127.0.0.1
hip-02-port: 5350
```
## node.txt
This file stores the node (HSD/Bob connection) settings.

View File

@@ -6,4 +6,4 @@ woodburn4,BID,1,3
woodburn5,BID,1,3
woodburn6,BID,1,4
woodburn8,TRANSFER,hs1qlmlgnx0g3ynk4ylxkkdh9c9nernclnfq4lw6s9
exampledomainnathan90,UPDATE,[{"type": "NS","ns": "ns1.woodburn."};{"type": "NS","ns": "ns2.woodburn."};{"type": "DS","keyTag": 30273,"algorithm": 13,"digestType": 2,"digest":"9a3a8fb3d625d2a2073d740f10da6056ebed0e97f550aa7f3891ed450c7e60c9"};{"type": "GLUE4","ns": "ns1.exampledomainnathan90.","address": "1.2.3.4"};{"type": "TXT","txt": ["Test TXT record"]}]
exampledomainnathan118,UPDATE,[{"type": "DS","keyTag": 20167,"algorithm": 13,"digestType": 2,"digest":"4a2ab3224727a4754a6c3d77621a5b04241a3d9c7ae7e5fa17f73121b9ff0e06"}, {"type": "NS","ns": "ns1.woodburn."}, {"type": "NS","ns": "ns2.woodburn."}, {"type": "TXT","txt": ["TEST"]}]