示例#1
0
        public static BTCePair FromBetterString(string s)
        {
            BTCePair ret = BTCePair.Unknown;

            Enum.TryParse <BTCePair>(s.ToLowerInvariant().Replace('/', '_'), out ret);
            return(ret);
        }
示例#2
0
        public static BTCePair FromString(string s)
        {
            BTCePair ret = BTCePair.Unknown;

            Enum.TryParse <BTCePair>(s.ToLowerInvariant(), out ret);
            return(ret);
        }
示例#3
0
        /// <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));
        }
示例#4
0
 public static string ToBetterString(BTCePair v)
 {
     return(Enum.GetName(typeof(BTCePair), v).ToLowerInvariant().ToUpper().Replace('_', '/'));
 }
示例#5
0
 public static string ToString(BTCePair v)
 {
     return(Enum.GetName(typeof(BTCePair), v).ToLowerInvariant());
 }