private void buttonParseTransactions_Click(object sender, EventArgs e) { TransactionParser parser = GetTransactionParser(); if (parser != null) { string currencyPair = textBoxCurrencyPair.Text; if (currencyPair == null) { MessageBox.Show("Please provide the desired currency pair you'd like to parse the transactions for."); return; } Dictionary <string, string> parameters = new Dictionary <string, string> { { "time", comboBoxParseWithinTime.Text.ToLower() } }; List <PublicTransaction> transactions = parser.UpdatedPublicTransactions(currencyPair.ToLower(), parameters); transactions.ForEach(t => { PublicTransactionType type = (PublicTransactionType)t.type; ListViewItem item = new ListViewItem(t.tid.ToString()); item.SubItems.Add(TimestampToDateTime(t.date).ToString()); item.SubItems.Add(t.amount.ToString()); item.SubItems.Add(t.price.ToString()); item.SubItems.Add(type.ToString()); tableTransactions.Items.Add(item); } ); } }
private TransactionParser GetTransactionParser() { if (transactionParser == null) { this.transactionParser = new TransactionParser(null, null, null); } return(transactionParser); }
private TransactionParser GetTransactionParser() { if (transactionParser == null) { string apiKey = textBoxApiKey.Text; string apiSecret = textBoxApiSecret.Text; string customerId = textBoxCustomerId.Text; if (apiKey == null || apiSecret == null || customerId == null) { MessageBox.Show("Please provide your authentication details"); return(null); } this.transactionParser = new TransactionParser(apiKey, apiSecret, customerId); } return(transactionParser); }
private void buttonParseTransactions_Click(object sender, EventArgs e) { TransactionParser parser = GetTransactionParser(); if (parser != null) { List <Transaction> transactions = parser.UpdatedPrivateTransactions(); transactions.ForEach(t => { TransactionType type = (TransactionType)t.type; ListViewItem item = new ListViewItem(t.id.ToString()); item.SubItems.Add(t.datetime.ToString()); item.SubItems.Add(t.btc.ToString()); item.SubItems.Add(type.ToString()); item.SubItems.Add(t.fee.ToString()); tableTransactions.Items.Add(item); } ); } }