Skip to content

Commit

Permalink
Transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadovvBeast committed Jul 7, 2021
1 parent d4c6783 commit f057f92
Show file tree
Hide file tree
Showing 14 changed files with 2,649 additions and 165 deletions.
Binary file modified .vs/solaire/v16/.suo
Binary file not shown.
3 changes: 2 additions & 1 deletion About.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,16 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="refresh24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\refresh24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="praise_the_sun" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\praise_the_sun.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="refresh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\refresh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="copy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\copy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added Resources/copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/refresh24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
192 changes: 84 additions & 108 deletions Solaire.Designer.cs

Large diffs are not rendered by default.

76 changes: 64 additions & 12 deletions Solaire.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public partial class Solaire : Form
{
string address;
char cluster;
string path;
public Solaire()
{
InitializeComponent();
Expand All @@ -24,9 +25,12 @@ private void Init()
{
Cursor.Current = Cursors.WaitCursor;
lblSolVerValue.Text = Utils.RunCommand("solana --version").Split(' ')[1];
address = lblDefaultAddressValue.Text = Utils.RunCommand("solana address");
lblBalanceValue.Text = Utils.RunCommand("solana balance");
var configArr = Utils.RunCommand("solana config get").Split('\n');
if (path == null)
path = Utils.getConfigItemValue(configArr[3]);
address = lblAddressValue.Text = Utils.RunCommand("solana address --keypair " + path);
lblBalanceValue.Text = Utils.RunCommand("solana balance " + path);

var clusterName = lblClusterValue.Text = Utils.dClusterUrlToName[Utils.getConfigItemValue(configArr[1])];
cluster = clusterName.ToLower()[0];
if (cluster == 'm')
Expand All @@ -42,16 +46,6 @@ private void Solaire_Shown(object sender, EventArgs e)

private void btnLoadAddress_Click(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "Open the keypair file";
fdlg.InitialDirectory = @"c:\";
fdlg.Filter = "JSON files (*.json)|*.json|All files (*.*)|*.*";
fdlg.FilterIndex = 1;
fdlg.RestoreDirectory = true;
if (fdlg.ShowDialog() == DialogResult.OK)
{
MessageBox.Show(fdlg.FileName);
}
}

private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -90,5 +84,63 @@ private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
(new About()).ShowDialog();
}

private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "Open the keypair file";
//fdlg.InitialDirectory = @"c:\";
fdlg.Filter = "JSON files (*.json)|*.json|All files (*.*)|*.*";
fdlg.FilterIndex = 1;
fdlg.RestoreDirectory = true;
if (fdlg.ShowDialog() == DialogResult.OK)
{
path = fdlg.FileName;
Init();
}
}

private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog sfdlg = new SaveFileDialog();
sfdlg.Title = "Save keypair file";
sfdlg.Filter = "JSON files (*.json)|*.json|All files (*.*)|*.*";
sfdlg.FilterIndex = 1;
sfdlg.RestoreDirectory = true;
if (sfdlg.ShowDialog() == DialogResult.OK)
{
Cursor.Current = Cursors.WaitCursor;
var newArr = Utils.RunCommand("solana-keygen new --no-passphrase -o " + sfdlg.FileName).Split('\n');
address = Utils.getConfigItemValue(newArr[3]);
path = sfdlg.FileName;
MessageBox.Show("Please save this seed phrase:" + Environment.NewLine + newArr[6], "Seed phrase", MessageBoxButtons.OK, MessageBoxIcon.Information);
Init();
}

}

private void btnTransfer_Click(object sender, EventArgs e)
{
var dlgTransfer = new Transfer();
var dlgrTransfer = dlgTransfer.ShowDialog();
if (dlgrTransfer == DialogResult.OK)
{
var to_address = ((TextBox)dlgTransfer.Controls.Find("txtAddress", true)[0]).Text;
var amount = ((NumericUpDown)dlgTransfer.Controls.Find("nudAmount", true)[0]).Value;
var response = Utils.RunCommand("solana transfer --from " + path + " " + to_address + " " + amount + " --allow-unfunded-recipient --fee-payer " + path);
MessageBox.Show(response, "Signature", MessageBoxButtons.OK, MessageBoxIcon.Information);
Init();
}
}

private void btnRefresh_Click(object sender, EventArgs e)
{
Init();
}

private void btnCopyAddress_Click(object sender, EventArgs e)
{
Clipboard.SetText(address);
}
}
}
12 changes: 12 additions & 0 deletions Solaire.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Transfer.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Transfer.Designer.cs">
<DependentUpon>Transfer.cs</DependentUpon>
</Compile>
<Compile Include="Utils.cs" />
<EmbeddedResource Include="About.resx">
<DependentUpon>About.cs</DependentUpon>
Expand All @@ -98,6 +104,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Transfer.resx">
<DependentUpon>Transfer.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand All @@ -113,6 +122,9 @@
</ItemGroup>
<ItemGroup>
<Content Include="he-sun-dark-souls-solaire-symbol-png.ico" />
<None Include="Resources\copy.png" />
<None Include="Resources\refresh24.png" />
<None Include="Resources\refresh.png" />
<None Include="Resources\praise_the_sun.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
44 changes: 0 additions & 44 deletions Solaire.resx
Original file line number Diff line number Diff line change
Expand Up @@ -146,50 +146,6 @@
S+GOLQu6U6BFjPvqKOP1AYw88WOoZif9DgmfLVtxaj1RSLdwNvrkPCA3M54KqxrnvRia9MKcGrUrqFOt
5H7qKsqT1mGO9+Lqhc2ELdw+U/r0i+gVZ8hMiCDx3DHORwZyKnQ/hw/uYt9uCTskPvh6e7Fp41rWr/Fg
g6eHO+A/lyD8ARfG3mk9fv1YAAAAAElFTkSuQmCC
</value>
</data>
<data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIySURBVDhPrZLfS5NRGMfff6H7boIuuq2pMZyL1eAt11CW
DcOKsB9vpFmaLtNExco0av6CbIVLJ61Wk3BSkT/AFCkRZSpZmrmiJQ41xSaCwdfznL15XEUX0Reem5f3
8znnec4j/Zc8fxYGla91CS3eRTx0z6OpMYS7jmnU1X6B/VYA18snUVoyjsKCt8jLHcH5c36ouCQR2NUJ
1Nas4G9ZXlmFKbULh1Kf8lJxSfI+WeCCyopv6q+/h+DQ/DJ2WV5Ao1FgPegRAveDOS4oLfmq/h6dn/DH
4AJizD4UXJrCAUuzEDgbZrjgou2DiohshIcnQtgme5GTPYbkJKcQ1N8OckHW2REVi+RXuM8fxGaDG4oy
ALPZIQQ11Z+5QDk1oKJ/hjv7P2FTfCMOH3mFxMQ6IbhROYWOdrCnBI4dfwPr0V4+bRoY9UzXppMjcDdS
rC8hy3YhuFI2gTYf2A4Aza4f7N2/o/zaLB8qDYx6zszwr8P7k1thNFYIweXCMXgeAfedq2xxwjClZUeV
Jd2GtDNFETiJwfs8MBjKhMCWN8pgoLoqzE8miH1GjE7G4PsZjE7OQsm9ij2mFg7rdrug1xcJAa2l4w7W
r00Cgk/n38S7wBwC04u4UGxHrMHF4CbEJtyDLj5fCDIzhljfSxzeavRgyw4Zj9t64GvvQ0d3P3pfD2Kv
2QqNvgFxDN6urYdWmyMElJMnevh60obRktA701PRtGlg1DOdSkXwzrisaMG/RZLWAE60OMW5fNhvAAAA
AElFTkSuQmCC
</value>
</data>
<data name="printToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIpSURBVDhPtZL/T1JRGMb5p1itrVZbbRpqZbawnBENV1I0
jGlByTSyJTXJwq2oKZQb1KAv6JCYWSxvBrkkZUq4CeQEiRABFeLL072Xa0zRra31bO8v57zP5znnPYf1
X+TxhWF6O7VtGYcnwbSWijKPOLzYrPSvLPwLS3huGUMlT7o9wGD9grVUBj+icdid03S9tDmgNxNwTgVQ
J+rA8XNtWwM+uuZATMwxmQVRycuJFNyzIRitDlScugKzjSgFRGJJaIwEsrk8AsHIhnSL/Ssck37UNipQ
I5DjtuYV7uksRYhr2kebhx2eP6nrycFIEh5fBA/1Nvru8q5+PDaOovK0rABwfwugWzcErfkzHhjsePL6
E7q1VrTdNUDcrgGvSYlDZHN5XTNOnL8BVe8AJAoNDtZfLgDu9L1BPJmikzcrk81hlRwodZJwdBXziwnI
OrVoaOkiT8C8hKLHBPO7CbywOaE1jeC+bhAd6meQdvZC1KoG/5IS3MZ2HObLUHZSggvkWq3wOvbWiAqA
VpWeyStVfCUNf3AZ4zNhfHCFMEDMgye+hYr6FrDLzxQAUuVTpr0ocn74mchg5vsKRt1RcHp2Qv9+kZ78
UcE17KkWFgHNN/uQzgBkGKLJPBZiecyGchjzrmFwPIF++xJUbDbUQzEacIArLpopSRSP4CUN1Obf1Abz
uqob5KjiXwWH/GVl5HPt5zZh37GL2H1EiF1VZ7GDI6CNW5r/TSzWbwHYL0mKJ5czAAAAAElFTkSuQmCC
</value>
</data>
<data name="printPreviewToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGCSURBVDhPnZK9S0JRGMb9F1xb2gqaq6mhwCGDtvYIIyLI
cJOE1paoIYpMKUjFRDH87lpoakGlIZF9DA2hZJEQhJXl1xPn3HPV29WQfvBwOfA+P95zuDJ39A6/4wyl
YOOSMHvOcHGThuwvSKEVRvsR+pQqWD3R1pK98DUbl7Jm5hA8SfESd6S5xH5wycalrO4E0D8yWQuriLH6
E2xcSqlcoRJBxCpiTO5TNi4m/ZgDF4nDsOulsfujyGRzUsmWM8YqdcggKbveS3A88bEkslRye58RSzZt
IVarY/FFaPmlwp+fUaESYRNW5Vm3BPmpBpZNvppACDmTLbS6FbGAPFAj5OGI4PALOK/yZfIlAlk4j7n5
xdaCarWKj0KRXmE2+UklJEJZZ/RCPTPdWvBdLOP1rYD41QNcgRiVkKJQ1mjGsa2VNxeQb2OWDC7sh47p
ddQLeoyOTSFiVAAFvVhChsmv2k6Uvd3Icx1UolMNiDdpl4nhLiohW/xb0tMph2JwCJxjAz9A30JI8zYA
tAAAAABJRU5ErkJggg==
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
Expand Down
Loading

0 comments on commit f057f92

Please sign in to comment.