Exemple #1
0
        public async Task <JsonElement> GetAsync(string url)
        {
            using var stream = await Rpc.GetStreamAsync(url);

            return((await JsonDocument.ParseAsync(stream, new JsonDocumentOptions {
                MaxDepth = 256
            })).RootElement);
        }
Exemple #2
0
        async Task <List <CoingeckoQuote> > GetQuotes(string currency, DateTime from, DateTime to)
        {
            var _from = (long)(from - DateTime.UnixEpoch).TotalSeconds;
            var _to   = (long)(to - DateTime.UnixEpoch).TotalSeconds;

            using var stream = await Client.GetStreamAsync(
                      $"coins/tezos/market_chart/range?vs_currency={currency}&from={_from}&to={_to}");

            var res = await JsonSerializer.DeserializeAsync <CoingeckoQuotes>(stream);

            return(res.Prices);
        }
Exemple #3
0
        public async Task <JsonElement> GetAsync(string url)
        {
            using var stream = await Rpc.GetStreamAsync(url);

            using var doc = await JsonDocument.ParseAsync(stream, new JsonDocumentOptions { MaxDepth = 100_000 });