Skip to content

Commit

Permalink
Fixed dependencies
Browse files Browse the repository at this point in the history
Fixed deps
  • Loading branch information
Nathanwoodburn committed Jan 12, 2023
1 parent eae5156 commit e386a61
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions BidderGUI/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ private async void timer1_Tick(object sender, EventArgs e)
if (domainslistBox.Items.Count > 0)
{
string domain = domainslistBox.Items[0].ToString();
domainslistBox.Items.Remove(domain);
logtextBox.Text = logtextBox.Text + "Sending "+ modecomboBox.Text + " for: " + domain + Environment.NewLine;

if (modecomboBox.Text == "OPEN")
Expand All @@ -103,31 +102,34 @@ private async void timer1_Tick(object sender, EventArgs e)
request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("x:" + apitextBox.Text)));
string curltext = "{\"passphrase\":\"" + passtextBox.Text + "\",\"name\":\"" + domain + "\",\"broadcast\":true,\"sign\":true}";
request.Content = new StringContent(curltext);
sendapicall(request);
sendapicall(request,domain);

}
else if (modecomboBox.Text == "BID")
{
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "http://127.0.0.1:12039/wallet/" + wallettextBox.Text + "/bid");
request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("x:" + apitextBox.Text)));
string curltext = "{\"passphrase\":\"" + passtextBox.Text + "\",\"name\":\"" + domain + "\",\"broadcast\":true,\"sign\":true,\"bid\":" + bidnumericUpDown.Value * 1000000 + ",\"lockup\":" + blindnumericUpDown.Value * 1000000 + "}";
request.Content = new StringContent(curltext);
sendapicall(request);
sendapicall(request, domain);

}
else if (modecomboBox.Text == "REVEAL")
{
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "http://127.0.0.1:12039/wallet/" + wallettextBox.Text + "/reveal");
request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("x:" + apitextBox.Text)));
string curltext = "{\"passphrase\":\"" + passtextBox.Text + "\",\"name\":\"" + domain + "\",\"broadcast\":true,\"sign\":true}";
request.Content = new StringContent(curltext);
sendapicall(request);
sendapicall(request, domain);

}
else if (modecomboBox.Text == "REDEEM")
{
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "http://127.0.0.1:12039/wallet/" + wallettextBox.Text + "/redeem");
request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("x:" + apitextBox.Text)));
string curltext = "{\"passphrase\":\"" + passtextBox.Text + "\",\"name\":\"" + domain + "\",\"broadcast\":true,\"sign\":true}";
request.Content = new StringContent(curltext);
sendapicall(request);
sendapicall(request, domain);
}
else
{
Expand All @@ -149,7 +151,7 @@ private async void timer1_Tick(object sender, EventArgs e)
}

}
async void sendapicall(HttpRequestMessage request)
async void sendapicall(HttpRequestMessage request,string domain)
{
try
{
Expand All @@ -158,6 +160,7 @@ async void sendapicall(HttpRequestMessage request)
string responseBody = await response.Content.ReadAsStringAsync();

logtextBox.Text = logtextBox.Text + responseBody + Environment.NewLine;
domainslistBox.Items.Remove(domain);
}
catch (Exception error)
{
Expand Down

0 comments on commit e386a61

Please sign in to comment.