Ejemplo n.º 1
0
 /// <summary>
 /// 0/buyBTC.php 
 /// </summary>
 public List<MtGoxOrder> buyBTC(double amount, MtGoxCurrencySymbol currency, double price = 0.0)
 {
     try
     {
         string url = (this.baseURL) + "0/buyBTC.php";
         string postData;
         if (price == 0.0)
             postData = "amount=" + amount + "&currency=" + currency.ToString();
         else
             postData = "amount=" + amount + "&price=" + price + "&currency=" + currency.ToString();
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return MtGoxOrder.getObjects(responseStr);
     }
     catch (Exception ex)
     {
         return null;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 0/history_[CUR].csv
 /// </summary>
 public string history_CUR(MtGoxCurrencySymbol currency)
 {
     try
     {
         string url         = (this.baseURL) + "0/history_" + currency.ToString() + ".csv";
         string postData    = "";
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return(responseStr);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 0/buyBTC.php
 /// </summary>
 public List <MtGoxOrder> buyBTC(double amount, MtGoxCurrencySymbol currency, double price = 0.0)
 {
     try
     {
         string url = (this.baseURL) + "0/buyBTC.php";
         string postData;
         if (price == 0.0)
         {
             postData = "amount=" + amount + "&currency=" + currency.ToString();
         }
         else
         {
             postData = "amount=" + amount + "&price=" + price + "&currency=" + currency.ToString();
         }
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return(MtGoxOrder.getObjects(responseStr));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 0/data/getDepth.php
        /// </summary>
        public MtGoxDepthInfo getDepth(MtGoxCurrencySymbol currency)
        {
            try
            {
                string url         = (this.baseURL) + "0/data/getDepth.php?currency=" + currency.ToString();
                string postData    = "";
                string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);

                MtGoxDepthInfo returnValue = MtGoxDepthInfo.getObjects(responseStr);

                return(returnValue);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 0/history_[CUR].csv
 /// </summary>
 public string history_CUR(MtGoxCurrencySymbol currency)
 {
     try
     {
         string url = (this.baseURL) + "0/history_" + currency.ToString() + ".csv";
         string postData = "";
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return responseStr;
     }
     catch (Exception ex)
     {
         return null;
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 0/data/getDepth.php 
        /// </summary>
        public MtGoxDepthInfo getDepth(MtGoxCurrencySymbol currency)
        {
            try
            {
                string url = (this.baseURL) + "0/data/getDepth.php?currency=" + currency.ToString();
                string postData = "";
                string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);

                MtGoxDepthInfo returnValue = MtGoxDepthInfo.getObjects(responseStr);

                return returnValue;

            }
            catch (Exception ex)
            {
                return null;
            }
        }