示例#1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var user             = username.Text;
                var walletConnection = new WalletConnector(host.Text, int.Parse(port.Text), username.Text, password.Text);
                var result           = walletConnection.GenerateAddress("adam");
                MessageBox.Show(result);

                var result2 = walletConnection.ValidateAddress(result);
                MessageBox.Show(result2.ToString());

                var result3 = walletConnection.GetTransactions();
                MessageBox.Show(result3.Count().ToString());

                var result4 = walletConnection.GetTransactions("d5325c49c3c11a1907cf431f31b1295bf092406fd442d8a1119e43f4ea6b5cc6");
                MessageBox.Show(result4.Count().ToString());

                var result5 = walletConnection.GetBalance();
                MessageBox.Show(result5.ToString("F8"));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
示例#2
0
 private GetInfoData GetInfo(Currency currency, int timeout)
 {
     try
     {
         var connector = new WalletConnector(currency.WalletHost, currency.WalletPort, currency.WalletUser, currency.WalletPass, timeout);
         var info      = connector.GetInfo();
         var balance   = connector.GetBalance();
         info.Balance = balance;
         return(info);
     }
     catch (Exception ex)
     {
         Log.Exception("An exception occured querying wallet information. Currency: {0}", ex, currency.Symbol);
     }
     return(null);
 }