public bool GetTicker(string ticker)
        {
            TickerData = new DxInstrumentsValue();
            var request = CreateHttpWebRequest("POST", MainURI);

            request.ContentType = "application/json";
            //request.Headers.Add("Authorization", this.Token);

            var data       = new Dictionary <string, object>();
            var parameter  = new List <Dictionary <string, string> >();
            var parameters = new Dictionary <string, string>();

            parameters.Add("symbol", ticker);
            parameter.Add(parameters);


            data.Add("jsonrpc", "2.0");
            data.Add("id", "1");
            data.Add("method", "AssetManagement.GetInstruments");
            data.Add("params", parameter);
            var entity = JsonConvert.SerializeObject(data, Formatting.Indented);



            request.ContentLength = entity.Length;
            using (var streamWriter = new StreamWriter(request.GetRequestStream()))
            {
                streamWriter.Write(entity);
                streamWriter.Flush();
                streamWriter.Close();
            }

            var jsonResult   = JsonObjectSerialize.ObjectSerialize <DxReturnValue>(GetResponseString(request));
            var tickerResult = JsonObjectSerialize.ObjectSerialize <Dictionary <string, List <DxInstrumentsValue> > >(jsonResult.result.ToString());

            if (jsonResult.error != null)
            {
                Error = jsonResult.error;
                return(false);
            }
            else
            {
                if (tickerResult["instruments"] != null)
                {
                    TickerData = tickerResult["instruments"].First();
                }
                else
                {
                    Error = "Asset not found!";
                    return(false);
                }
            }
            return(true);
        }
        public bool Login()
        {
            var request = CreateHttpWebRequest("POST", MainURI);

            request.ContentType = "application/json";

            var data       = new Dictionary <string, object>();
            var parameter  = new List <Dictionary <string, string> >();
            var parameters = new Dictionary <string, string>();

            parameters.Add("token", this.APIKey);
            parameters.Add("secret", this.SecretKey);
            parameter.Add(parameters);


            data.Add("jsonrpc", "2.0");
            data.Add("id", "1");
            data.Add("method", "Authorization.LoginByToken");
            data.Add("params", parameter);
            var entity = JsonConvert.SerializeObject(data, Formatting.Indented);



            request.ContentLength = entity.Length;
            using (var streamWriter = new StreamWriter(request.GetRequestStream()))
            {
                streamWriter.Write(entity);
                streamWriter.Flush();
                streamWriter.Close();
            }



            var jsonResult  = JsonObjectSerialize.ObjectSerialize <DxReturnValue>(GetResponseString(request));
            var tokenResult = JsonObjectSerialize.ObjectSerialize <DxLoginByTokenValue>(jsonResult.result.ToString());

            Token = tokenResult.token;
            if (jsonResult.error != null)
            {
                Error = jsonResult.error;
                return(false);
            }
            return(true);
        }