コード例 #1
0
ファイル: WexTradeApi.cs プロジェクト: multiprogramm/WexAPI
        /// <summary>
        /// This method is used for order cancelation.
        /// See https://github.com/wex-exchange/api-doc/blob/master/trade-api.md#CancelOrder
        /// </summary>
        /// <param name="order_id">order ID</param>
        public CancelOrderAnswer CancelOrder(int order_id)
        {
            var args = new Dictionary <string, string>()
            {
                { "method", "CancelOrder" },
                { "order_id", order_id.ToString() }
            };
            string query_answer = QueryExec(args);
            var    json_result  = ParseAnswer(query_answer);

            return(CancelOrderAnswer.ReadFromJObject(json_result));
        }
コード例 #2
0
ファイル: WexApi.cs プロジェクト: dennysvf/CryptoMarketApi
        public CancelOrderAnswer CancelOrder(int orderId)
        {
            var args = new NameValueDictionary
            {
                { "order_id", orderId.ToString(CultureInfo.InvariantCulture) }
            };
            var result = JObject.Parse(Query("CancelOrder", args));

            if (result.Value <int>("success") == 0)
            {
                throw new WexApiException(result.Value <string>("error"));
            }

            return(CancelOrderAnswer.ReadFromJObject(result["return"] as JObject));
        }