public static BTCePair FromBetterString(string s) { BTCePair ret = BTCePair.Unknown; Enum.TryParse <BTCePair>(s.ToLowerInvariant().Replace('/', '_'), out ret); return(ret); }
public static BTCePair FromString(string s) { BTCePair ret = BTCePair.Unknown; Enum.TryParse <BTCePair>(s.ToLowerInvariant(), out ret); return(ret); }
/// <summary> /// Place single trade with passed parameters /// </summary> /// <param name="pair">Trade Pair (currency)</param> /// <param name="type">Trade Type</param> /// <param name="rate">Trade Rate</param> /// <param name="amount">Trade Amount</param> /// <returns>On successful operation will return populated TradeAnswer, on error will throw BTCeException with original BTCe API error message</returns> public TradeAnswer PlaceOrder(BTCePair pair, BTCeTradeType type, decimal rate, decimal amount) { if (!authenticated) { throw new BTCeAPIException("Not Authenticated"); } var resultStr = Query(new Dictionary <string, string>() { { "method", "Trade" }, { "pair", BtcePairHelper.ToString(pair) }, { "type", TradeTypeHelper.ToString(type) }, { "rate", DecimalToString(rate) }, { "amount", DecimalToString(amount) } }); return(TradeAnswer.ReadFromJSON(resultStr)); }
public static string ToBetterString(BTCePair v) { return(Enum.GetName(typeof(BTCePair), v).ToLowerInvariant().ToUpper().Replace('_', '/')); }
public static string ToString(BTCePair v) { return(Enum.GetName(typeof(BTCePair), v).ToLowerInvariant()); }