-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameter name: The Guarded argument was null. #34
Comments
I'm receiving the exact same error on client.CreateOrder. This occurs no matter if it is a market buy or market sell. Also using BinanceDotNet v4.0.1. My ApiKey and Secret are valid. var createOrderResponse = await client.CreateOrder(new BinanceExchange.API.Models.Request.CreateOrderRequest(){
Symbol = <<anycoinsymbol - I've tried multiple>>,
Side = <<BinanceExchange.API.Enums.OrderSide.Buy>> or <<BinanceExchange.API.Enums.OrderSide.Sell>>,
Type = <<BinanceExchange.API.Enums.OrderType.Market>>,
Quantity = <correctly calculated qty that meets rules in Exchange Info payload>>,
NewClientOrderId = <<my custom string>>
}); I've tried to catch all BinanceExchange.API.Models.Response.Errors, but all I get is this:
|
Heres what i reckon is happening, based on the binance api docs (https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md), depending on the type of Order you are executing some parameters are required and some are not. But the code here in BinanceDotNet requires that all parameters be passed into the CreateTestOrder() method. I.e. And since you passed in the Time-In-Force value, BinanceDotNet passes that parameter to the binance api which will cause a "Malformed Request" error |
@paolobriones @glitch100 On my CreateOrderRequest object in the client.CreateOrder method:
|
@ryanjhardinorders thats exactly what i said, its sending additional request parameters that causes the binance api to throw a malformed error @glitch100 im working on a fix for it now, will send as soon as i can |
@glitch100 this bug is related to #10 |
@paolobriones |
I believe this fix is included in the #32 release . Please retest there. If you are wondering it's because I have a deliberate |
@glitch100 @ryanjhardinorders |
Issue Overview
Trying to execute a Market Order (via client.CreateTestOrder()) with a valid Key/Secret, the code throws an exception saying: "Parameter name: The Guarded argument was null."
Package Version: BinanceDotNet v4.0.1
Repro Steps
BinanceClient client = new BinanceClient(new ClientConfiguration {
ApiKey = "VALIDAPIKEY",
SecretKey = "VALIDSECRETKEY"
});
await client.CreateTestOrder(new CreateOrderRequest {
Symbol = "TRXBTC",
Quantity = 100,
});
The text was updated successfully, but these errors were encountered: