Exemplo n.º 1
0
        /// <summary>
        /// 0/cancelOrder.php
        /// </summary>
        public List <MtGoxOrder> cancelOrder(string oid, MtGoxOrderType type)
        {
            try
            {
                string url = (this.baseURL) + "0/cancelOrder.php";
                string postData;
                int    t = 0;
                switch (type)
                {
                case MtGoxOrderType.Buy:
                    t = 2;
                    break;

                case MtGoxOrderType.Sell:
                    t = 1;
                    break;
                }
                postData = "oid=" + oid + "&type=" + t;
                string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
                return(MtGoxOrder.getObjects(responseStr));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 0/cancelOrder.php 
 /// </summary>
 public List<MtGoxOrder> cancelOrder(string oid, MtGoxOrderType type)
 {
     try
     {
         string url = (this.baseURL) + "0/cancelOrder.php";
         string postData;
         int t = 0;
         switch (type)
         {
             case MtGoxOrderType.Buy:
                 t = 2;
                 break;
             case MtGoxOrderType.Sell:
                 t = 1;
                 break;
         }
         postData = "oid=" + oid + "&type=" + t;
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return MtGoxOrder.getObjects(responseStr);
     }
     catch (Exception ex)
     {
         return null;
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 0/getOrders.php
        /// </summary>
        public List <MtGoxOrder> getOrders(MtGoxOrderType type, MtGoxOrderStatus status, int oid = 0)
        {
            try
            {
                string url      = (this.baseURL) + "0/getOrders.php";
                string postData = "";
                postData = "oid=" + oid;
                switch (type)
                {
                case MtGoxOrderType.Buy:
                    postData += "&type=1";
                    break;

                case MtGoxOrderType.Sell:
                    postData += "&type=2";
                    break;
                }
                switch (status)
                {
                case MtGoxOrderStatus.Active:
                    postData += "&status=1";
                    break;

                case MtGoxOrderStatus.NotSufficientFunds:
                    postData += "&status=2";
                    break;
                }
                string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
                return(MtGoxOrder.getObjects(responseStr));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 0/getOrders.php 
 /// </summary>
 public List<MtGoxOrder> getOrders(MtGoxOrderType type, MtGoxOrderStatus status, int oid = 0)
 {
     try
     {
         string url = (this.baseURL) + "0/getOrders.php";
         string postData = "";
         postData = "oid=" + oid;
         switch (type)
         {
             case MtGoxOrderType.Buy:
                 postData += "&type=1";
                 break;
             case MtGoxOrderType.Sell:
                 postData += "&type=2";
                 break;
         }
         switch (status)
         {
             case MtGoxOrderStatus.Active:
                 postData += "&status=1";
                 break;
             case MtGoxOrderStatus.NotSufficientFunds:
                 postData += "&status=2";
                 break;
         }
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return MtGoxOrder.getObjects(responseStr);
     }
     catch (Exception ex)
     {
         return null;
     }
 }