//get order books private void button11_Click(object sender, EventArgs e) { string address = this.textBox28.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); int pageSize = int.Parse(this.textBox29.Text); int page = int.Parse(this.textBox30.Text); string baseCurrency = "SWT"; string baseCounterParty = "jGa9J9TkqtBcUoHe2zqhVFFbgUVED6o9or"; string counterCurrency = "CNY"; string counterCounterParty = "jGa9J9TkqtBcUoHe2zqhVFFbgUVED6o9or"; Jingtum.API.OrderBookResponse response = null; if (this.radioButton1.Checked) { response = wallet.GetOrderBooks(baseCurrency, baseCounterParty, counterCurrency, counterCounterParty, pageSize, page); } else if (this.radioButton2.Checked) { response = wallet.GetOrderBookBids(baseCurrency, baseCounterParty, counterCurrency, counterCounterParty, pageSize, page); } else if (this.radioButton3.Checked) { response = wallet.GetOrderBookAsks(baseCurrency, baseCounterParty, counterCurrency, counterCounterParty, pageSize, page); } this.ShowPropertyValue <Jingtum.API.OrderBookResponse>(response); }
//balance private void button2_Click(object sender, EventArgs e) { String address = this.textBox1.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); List <Jingtum.API.Balance> balances = wallet.GetBalanceList(); this.ShowPropertyValueList <Jingtum.API.Balance>(balances); }
private void button7_Click(object sender, EventArgs e) { string address = this.textBox16.Text; string hash = this.textBox17.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); Jingtum.API.Transaction transaction = wallet.GetTransaction(hash); this.ShowPropertyValue <Jingtum.API.Transaction>(transaction); }
//get payment private void button3_Click(object sender, EventArgs e) { string address = this.textBox2.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); string hash = this.textBox3.Text; Jingtum.API.Payment payment = wallet.GetPayment(hash); this.ShowPropertyValue <Jingtum.API.Payment>(payment); }
//cancel order private void button13_Click(object sender, EventArgs e) { string address = this.textBox35.Text; string secret = this.textBox36.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address, secret); int order = int.Parse(this.textBox37.Text); this.ShowPropertyValue <Jingtum.API.SetOrderResponse>(wallet.CancelOrder(order)); }
//get order private void button9_Click(object sender, EventArgs e) { string address = this.textBox23.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); string hash = this.textBox24.Text; Jingtum.API.Order order = wallet.GetOrder(hash); this.ShowPropertyValue <Jingtum.API.Order>(order); }
//get payments private void button4_Click(object sender, EventArgs e) { string address = this.textBox4.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); List <Jingtum.API.Payment> payments = new List <Jingtum.API.Payment>(); payments = wallet.GetPaymentList(int.Parse(this.textBox5.Text), int.Parse(this.textBox6.Text)); this.ShowPropertyValueList <Jingtum.API.Payment>(payments); }
//get orders private void button10_Click(object sender, EventArgs e) { string address = this.textBox25.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); int pageSize = int.Parse(this.textBox26.Text); int page = int.Parse(this.textBox27.Text); List <Jingtum.API.Order> orders = wallet.GetOrderList(pageSize, page); this.ShowPropertyValue <List <Jingtum.API.Order> >(orders); }
//get choices private void button5_Click(object sender, EventArgs e) { string address = this.textBox7.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); string distinationAddress = this.textBox8.Text; int amount = int.Parse(this.textBox9.Text); string currency = this.textBox10.Text; string issue = "jGa9J9TkqtBcUoHe2zqhVFFbgUVED6o9or"; List <Jingtum.API.PaymentChoice> choices = wallet.GetPaymentChoices(distinationAddress, amount, currency, issue); this.ShowPropertyValue <List <Jingtum.API.PaymentChoice> >(choices); }
private void button8_Click(object sender, EventArgs e) { string address = this.textBox18.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address); int pageSize = int.Parse(this.textBox19.Text); int page = int.Parse(this.textBox20.Text); int ledger = this.textBox21.Text == string.Empty ? 0 : int.Parse(this.textBox21.Text); int seq = this.textBox22.Text == string.Empty ? 0 : int.Parse(this.textBox22.Text); List <Jingtum.API.Transaction> transactions = wallet.GetTransactions(pageSize, page, ledger, seq); this.ShowPropertyValue <List <Jingtum.API.Transaction> >(transactions); }
//set order private void button12_Click(object sender, EventArgs e) { string address = this.textBox31.Text; string secret = this.textBox32.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address, secret); Jingtum.API.Order order = new Jingtum.API.Order(); order.Type = this.radioButton6.Checked ? "sell" : "buy"; order.Amount = double.Parse(this.textBox33.Text); order.Price = double.Parse(this.textBox34.Text); order.Pair = (this.radioButton6.Checked ? "SWT/CNY" : "CNY/SWT") + ":jGa9J9TkqtBcUoHe2zqhVFFbgUVED6o9or"; this.ShowPropertyValue <Jingtum.API.SetOrderResponse>(wallet.SetOrder(order)); }
//set payment private void button6_Click(object sender, EventArgs e) { //Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(this.textBox12.Text, this.textBox13.Text); //Jingtum.API.Payment payment = new Jingtum.API.Payment(); //Jingtum.API.Amount amount = new Jingtum.API.Amount(); //amount.Value = int.Parse(this.textBox14.Text); //amount.Currency = this.textBox11.Text; //amount.Issuer = string.Empty; //payment.Amount = amount; //List<string> memos = new List<string>(); //memos.Add("Test: " + DateTime.Now.ToString("o")); //string distinationAddress = this.textBox15.Text; //Jingtum.API.SetPaymentResponse res = wallet.SetPayment(payment, distinationAddress, string.Empty, memos); //this.ShowPropertyValue<Jingtum.API.SetPaymentResponse>(res); string address = this.textBox12.Text; string secret = this.textBox13.Text; Jingtum.API.Wallet wallet = new Jingtum.API.Wallet(address, secret); Jingtum.API.Payment payment = new Jingtum.API.Payment(); Jingtum.API.Amount amount = new Jingtum.API.Amount(); amount.Value = int.Parse(this.textBox14.Text); amount.Currency = this.textBox11.Text; amount.Issuer = string.Empty; payment.Amount = amount; List <string> memos = new List <string>(); memos.Add("Test: " + DateTime.Now.ToString("o")); string distinationAddress = this.textBox15.Text; Jingtum.API.SetPaymentResponse res = wallet.SetPayment(payment, distinationAddress, string.Empty, memos); this.ShowPropertyValue <Jingtum.API.SetPaymentResponse>(res); }
//new private void button1_Click(object sender, EventArgs e) { Jingtum.API.Wallet newWallet = Jingtum.API.Wallet.New(); this.ShowPropertyValue <Jingtum.API.Wallet>(newWallet); }