JKorf / Binance.Net

A C# .netstandard client library for the Binance REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/Binance.Net/
MIT License
1.02k stars 420 forks source link

Error <WebCallResult<BinanceFuturesPlacedOrder> not found (Binance.Net 9.40) #1337

Closed eXcroll closed 5 months ago

eXcroll commented 5 months ago

Hi, thanks for this library, I've been using it for a very long time, with the latest update I can't figure out how to call <WebCallResult>. I upgraded from version 9.17 to version 9.40 and an error appeared at this point in the code:

    static async Task<WebCallResult<BinanceFuturesPlacedOrder>> PlaceSellOrder(string symb, decimal quantity)
    {
        var sellClient = new BinanceRestClient(options =>
        {
            options.ApiCredentials = new ApiCredentials(API_KEY, API_SECRET);
            options.UsdFuturesOptions.ApiCredentials = new ApiCredentials(API_KEY, API_SECRET);
            options.AutoTimestamp = true;
            options.UsdFuturesOptions.AutoTimestamp = true;
        });

        return await sellClient.UsdFuturesApi.Trading.PlaceOrderAsync(
            symb,
            OrderSide.Sell,
            FuturesOrderType.Market,
            quantity: quantity,
            newClientOrderId: lastOrderId.ToString()
        );

    }

CS0246 The type or namespace name "BinanceFuturesPlacedOrder" could not be found (are you missing a using directive or an assembly reference?)

I tried to find a replacement for this callback, but there was no such thing in the new version of the library...

JKorf commented 5 months ago

Hi, the response type of the PlaceOrderAsync method has changed. Previously it was WebCallResult, now it is just WebCallResult. The model itself still looks the same

eXcroll commented 5 months ago

Hi, the response type of the PlaceOrderAsync method has changed. Previously it was WebCallResult, now it is just WebCallResult. The model itself still looks the same

Ok, tnx. I've redone the method and now everything works as before