How to Get a Pair of BTCUSDT Courses Using Binance.net

69 Views Asked by At

I have a trouble to get pair BTCUSDT What I did:

BinanceRestClient client = new();

//await HandleRequest("Symbol list", () => client.SpotApi.ExchangeData.GetExchangeInfoAsync(), result => result.Symbols.Where(x => x.BaseAsset == "BTC").Select(s => s.PriceFilter.MaxPrice.ToString()).First());
await HandleRequest("Symbol list", () => client.SpotApi.ExchangeData.GetExchangeInfoAsync(), result => result.Symbols.Where(x => x.BaseAsset == "USDT").Select(s => s.Name).First());
static async Task HandleRequest<T>(string action, Func<Task<WebCallResult<T>>> request, Func<T, string> outputData)
{
    Console.WriteLine("Press enter to continue");
    Console.ReadLine();
    Console.Clear();
    Console.WriteLine("Requesting " + action + " ..");
    var bookPrices = await request();
    if (bookPrices.Success)
        Console.WriteLine($"{action}: " + outputData(bookPrices.Data));
    else
        Console.WriteLine($"Failed to retrieve data: {bookPrices.Error}");
    Console.WriteLine();
}

if I use: https://www.binance.com/api/v3/exchangeInfo

I can see: BaseAsset (first pair) And QuoteAsset (second pair): but where is course of pair?

0

There are 0 best solutions below