public async Task <JsonElement> GetAsync(string url) { using var stream = await Rpc.GetStreamAsync(url); return((await JsonDocument.ParseAsync(stream, new JsonDocumentOptions { MaxDepth = 256 })).RootElement); }
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); }
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 });