/// <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 + "¤cy=" + currency.ToString(); else postData = "amount=" + amount + "&price=" + price + "¤cy=" + currency.ToString(); string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData); return MtGoxOrder.getObjects(responseStr); } catch (Exception ex) { return null; } }
/// <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); } }
/// <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 + "¤cy=" + currency.ToString(); } else { postData = "amount=" + amount + "&price=" + price + "¤cy=" + currency.ToString(); } string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData); return(MtGoxOrder.getObjects(responseStr)); } catch (Exception ex) { return(null); } }
/// <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); } }
/// <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; } }
/// <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; } }