0

I am trying to place future order at binance test but getting exception.

var client = TestHelpers.CreateClient( new BinanceClientOptions("",Common.apiURL ,"")
        {
                ApiCredentials = new ApiCredentials(Common.apiKey,Common.apiSecret),
                AutoTimestamp = false,
                LogVerbosity= LogVerbosity.Debug ,
               LogWriters= new List<TextWriter> { (new StreamWriter(Path.Combine(Application.StartupPath, "logs.txt")))}



            });
            
            // act
            var result = client.FuturesUsdt.Order.PlaceOrder("BTCUSDT", OrderSide.Buy, OrderType.Limit, timeInForce: TimeInForce.GoodTillCancel, quantity: 1, price: 2000);

Exeption: System.NullReferenceException: 'Object reference not set to an instance of an object.'

This exception was originally thrown at this call stack: [External Code] Binance.Net.SubClients.Futures.BinanceClientFuturesOrder.PlaceOrderAsync(string, Binance.Net.Enums.OrderSide, Binance.Net.Enums.OrderType, decimal?, Binance.Net.Enums.PositionSide?, Binance.Net.Enums.TimeInForce?, bool?, decimal?, string, decimal?, decimal?, decimal?, Binance.Net.Enums.WorkingType?, bool?, Binance.Net.Enums.OrderResponseType?, int?, System.Threading.CancellationToken) in BinanceClientFuturesOrder.cs

APIBaseURL: https://testnet.binancefuture.com

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • Does this answer your question? [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Uwe Keim Jun 03 '21 at 17:49
  • The spot API URL was empty, after adding value to it fix the issue. – user3332695 Jul 27 '21 at 09:34

0 Answers0