Beispiel #1
0
        public async Task<Orders.OrderTransaction> StopOrder(string OrderID)
        {
            PreCall();
            List<KeyValuePair<string, string>> pairs = new List<KeyValuePair<string, string>>();
            pairs.Add(new KeyValuePair<string, string>("order_id", OrderID));
            FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs);

            string s = await BitxClient.PostAsync(string.Format("stoporder"), Content).Result.Content.ReadAsStringAsync();
            Orders.OrderTransaction tmpTicker = null;
            Task<Orders.OrderTransaction> tmp = new Task<Orders.OrderTransaction>(() => { tmpTicker = JSON.JsonDeserialize<Orders.jsonOrderTransaction>(s).ToOrderTransaction(); return tmpTicker; });
            Calls.Add(new Call("Balanaces", true));
            return tmpTicker;
        }
Beispiel #2
0
        public async Task<Orders.OrderTransaction> PostLimitOrder(string Pair, string Type, decimal Volume,decimal Price)
        {
            PreCall();
            List<KeyValuePair<string, string>> pairs = new List<KeyValuePair<string, string>>();
            pairs.Add(new KeyValuePair<string, string>("pair", Pair));
            pairs.Add(new KeyValuePair<string, string>("type", Type));
            pairs.Add(new KeyValuePair<string, string>("volume", Volume.ToString("0.00000000", System.Globalization.NumberFormatInfo.InvariantInfo)));
            pairs.Add(new KeyValuePair<string, string>("price", Price.ToString("0.00000000", System.Globalization.NumberFormatInfo.InvariantInfo)));
            FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs);

            string s = await BitxClient.PostAsync(string.Format("postorder"), Content).Result.Content.ReadAsStringAsync();
            Orders.OrderTransaction tmpTicker = null;
            Task<Orders.OrderTransaction> tmp = new Task<Orders.OrderTransaction>(() => { tmpTicker = JSON.JsonDeserialize<Orders.jsonOrderTransaction>(s).ToOrderTransaction(); return tmpTicker; });
            Calls.Add(new Call("Balanaces", true));
            return tmpTicker;
        }
Beispiel #3
0
 public static jsonOrderTransaction ToJsonOrderTransaction(OrderTransaction tx)
 {
     return(jsonOrderTransaction.FromOrderTransaction(tx));
 }
Beispiel #4
0
 public static jsonOrderTransaction FromOrderTransaction(OrderTransaction tx)
 {
     return(new jsonOrderTransaction {
         success = tx.Success, order_id = tx.OrderID
     });
 }