Esempio n. 1
0
        //  public async Task<CurrencyListings> GetCurrencyListingsHistoricalAsync(string timestamp, int start = 1, int limit = 100,
        //   List<string> convert = null, SortBy sort = SortBy.Market_Cap, SortDirection sort_dir = SortDirection.Desc,
        //   CryptocurrencyType cryptocurrency_type = CryptocurrencyType.All)
        //  {

        //throw new CoinMarketCapException("Not implemented by CoinMarketCap");

        //   //var response = await Request<CurrencyListings>("cryptocurrency/listings/historical",
        //   // new QueryParams(timestamp.ToQueryParam("timestamp"), start.ToQueryParam("start"), limit.ToQueryParam("limit"),
        //	  //  convert.ToQueryParam("convert"), sort.ToQueryParam("sort"),
        //	  //  sort_dir.ToQueryParam("sort_dir"), cryptocurrency_type.ToQueryParam("cryptocurrency_type")));

        //   //return response;
        //  }

        public async Task <CurrencyListings> GetCurrencyListingsAsync(int start             = 1, int limit = 100,
                                                                      List <string> convert = null, SortBy sort = SortBy.Market_Cap, SortDirection sort_dir = SortDirection.Desc,
                                                                      CryptocurrencyType cryptocurrency_type = CryptocurrencyType.All)
        {
            if (convert == null || convert.Count == 0)
            {
                convert = new List <string> {
                    "USD"
                }
            }
            ;
            var response = await Request <CurrencyListings>("cryptocurrency/listings/latest",
                                                            new QueryParams(start.ToQueryParam("start"), limit.ToQueryParam("limit"), convert.ToQueryParam("convert"),
                                                                            sort.ToQueryParam("sort"), sort_dir.ToQueryParam("sort_dir"),
                                                                            cryptocurrency_type.ToQueryParam("cryptocurrency_type")));

            return(response);
        }
Esempio n. 2
0
        public async Task <ExchangeListings> GetExchangeListingsAsync(List <string> convert, int start = 1, int limit                    = 100,
                                                                      SortBy sort            = SortBy.Volume_24h, SortDirection sort_dir = SortDirection.Desc,
                                                                      MarketType market_type = MarketType.Fees)
        {
            if (convert == null || convert.Count == 0)
            {
                convert = new List <string> {
                    "USD"
                }
            }
            ;
            var response = await Request <ExchangeListings>("exchange/listings/latest",
                                                            new QueryParams(start.ToQueryParam("start"), limit.ToQueryParam("limit"), sort.ToQueryParam("sort"),
                                                                            sort_dir.ToQueryParam("sort_dir"), market_type.ToQueryParam("market_type"), convert.ToQueryParam("convert")));

            return(response);
        }