What's Changed
// Instantiate Insight
var insight = await ThirdwebInsight.Create(client);
// Fetch current token price
var ethPriceToday = await insight.GetTokenPrice(addressOrSymbol: "ETH", chainId: 1);
Console.WriteLine($"ETH price today: {ethPriceToday.PriceUsd}");
// Fetch token price at specified timestamp
var ethPriceYesterday = await insight.GetTokenPrice(
addressOrSymbol: "ETH",
chainId: 1,
timestamp: Utils.GetUnixTimeStampNow() - 86400
);
Console.WriteLine($"ETH price yesterday: {ethPriceYesterday.PriceUsd}");
// Fetch multiple token prices across multiple chains
var multiTokenPrices = await insight.GetTokenPrices(
addressOrSymbols: new string[] { "POL", "APE" },
chainIds: new BigInteger[] { 137, 33139 }
);
Console.WriteLine($"Multi token prices: {JsonConvert.SerializeObject(multiTokenPrices, Formatting.Indented)}");