Пример #1
0
        public Home()
        {
            InitializeComponent();
            ac = new ApiConnect();

            ApiSettings saved = ac.readSettings();

            if (saved.OrganizationID != null)
            {
                ac.setup(saved);

                if (saved.Enviorment == 1)
                {
                    currency = "BTC";
                }
                ac.currency = currency;
                refreshBalance();
                refreshOrders(false);
                ac.getPools(true);

                timer = new System.Threading.Timer(
                    e => runBot(),
                    null,
                    TimeSpan.Zero,
                    TimeSpan.FromSeconds(60));
            }
        }
Пример #2
0
        public PoolsForm(ApiConnect ac)
        {
            InitializeComponent();
            this.Show();
            this.ac = ac;

            loadPools(true);
        }
Пример #3
0
        public OrderForm(ApiConnect ac)
        {
            InitializeComponent();
            this.Show();
            this.ac = ac;

            this.currencyLbl.Text = ac.currency;

            //pools dropdown
            this.comboPools.DisplayMember = "name";
            this.comboPools.ValueMember   = "id";

            foreach (JObject obj in ac.algorithms)
            {
                this.comboAlgorithm.Items.Add(obj["algorithm"]);
            }
            this.comboAlgorithm.SelectedIndex = 0;
        }
Пример #4
0
        public ApiForm(ApiConnect ac)
        {
            InitializeComponent();
            this.Show();
            this.ac = ac;

            //load current settings
            ApiSettings saved = this.ac.readSettings();

            this.textBox1.Text = saved.OrganizationID;
            this.textBox2.Text = saved.ApiID;
            this.textBox3.Text = saved.ApiSecret;

            if (saved.Enviorment == 0)
            {
                this.radioButton1.Checked = true;
            }
            else if (saved.Enviorment == 1)
            {
                this.radioButton2.Checked = true;
            }
        }
Пример #5
0
        public PoolForm(ApiConnect ac, int mode, JToken pool)
        {
            InitializeComponent();
            this.Show();
            this.ac = ac;

            if (mode == 1)
            {
                this.Text = "Add pool";
                this.buttonAdd.Visible = true;
            }
            else if (mode == 2)
            {
                this.Text = "Edit pool " + pool["id"];
                this.buttonEdit.Visible = true;
            }
            else if (mode == 3)
            {
                this.Text = "Delete pool" + pool["id"];
                this.buttonDelete.Visible = true;
            }

            foreach (JObject obj in ac.algorithms)
            {
                this.comboAlgorithm.Items.Add(obj["algorithm"]);
            }
            this.comboAlgorithm.SelectedIndex = 0;

            if (mode == 2 || mode == 3)
            {
                this.textName.Text = "" + pool["name"];
                this.comboAlgorithm.SelectedItem = pool["algorithm"];
                this.textUrl.Text      = "" + pool["stratumHostname"];
                this.textPort.Text     = "" + pool["stratumPort"];
                this.textUsername.Text = "" + pool["username"];
                this.textPassword.Text = "" + pool["password"];
                this.textId.Text       = "" + pool["id"];
            }
        }