예제 #1
0
        public async Task <TickersData> GetTopCrypto(int start, int limit, string sort, string convert)
        {
            var startParam   = start >= 1 ? $"start={start}" : null;
            var limitParam   = limit >= 1 ? $"limit={limit}" : null;
            var sortParam    = !string.IsNullOrWhiteSpace(sort) ? $"sort={sort}" : null;
            var convertParam = !string.IsNullOrWhiteSpace(convert) ? $"convert={convert}" : null;

            var url      = queryStringService.AppendQueryString(Endpoints.Ticker, startParam, limitParam, sortParam, convertParam);
            var response = await _restClient.GetAsync(url);

            return(await jsonParserService.ParseResponse <TickersData>(response));
        }
예제 #2
0
        public async Task <ListingsData> Get()
        {
            var querystringService = new QueryStringService();
            var jsonParserService  = new JsonParserService();

            var url      = querystringService.AppendQueryString(Endpoints.Listings, "");
            var response = await _restClient.GetAsync(url);

            return(await jsonParserService.ParseResponse <ListingsData>(response));
        }
예제 #3
0
        public async Task <GlobalData> Get(string convert)
        {
            var queryStringService = new QueryStringService();
            var jsonParserService  = new JsonParserService();
            var convertParam       = !string.IsNullOrWhiteSpace(convert) ? $"convert={convert}" : null;

            var url      = queryStringService.AppendQueryString(Endpoints.GlobalData, convertParam);
            var response = await _restClient.GetAsync(url);

            return(await jsonParserService.ParseResponse <GlobalData>(response));
        }