RestClient PlaceOrder
See original GitHub issueDescribe the bug restClient.Spot.Order.PlaceOrder(“BTCUSDT”, OrderSide.Buy, OrderType.Market, 0.1) returns null. Sometimes it places order and returns null but most of the time null is returned and order is not placed. It does not happen every time, but when some time has passed, it happens. KeepAliveUserStream is working fine.
To Reproduce
WebCallResult<BinancePlacedOrder> result = null;
try
{
result = restClient.Spot.Order.PlaceOrder("BTCUSDT", OrderSide.Buy, OrderType.Market, 0.1);
if (result.Success)
{
return result.Data.OrderId;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message); --- Object reference not set to an instance of an object.
}
Expected behavior WebCallResult != null is returned, so Success or Error can be checked
Issue Analytics
- State:
- Created 2 years ago
- Comments:26 (5 by maintainers)
Top Results From Across the Web
Why does placeOrder() take so much time to create Request?
Hi All! I have a requirement to create several Requested Items in a Request based on a list of elements specified by the...
Read more >Salesforce Placeorder Rest Api
Place Order REST API Developer Guide. Requirements and Limitations Authorization Through Connected Apps and OAuth ...
Read more >Place order using REST API
Place order using REST API. To submit an order, we need some additional data to enter in our request as seen in the...
Read more >Place order using Magento Rest API - Issue
1 Answer 1 · 1. Get Customer Token · 2. Get Cart ID (Quote ID) - using customer id. · 3. Add Configurable...
Read more >clients
func (*RestClient) GetTransfers ¶ ... GetTransfers gets a historical record of deposits/withdrawals between the given time range. :param t_start: (str) time in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re not checking any result if it was successfull. If you call for example GetAccountInfo you’ll have to check if the call was successful by doing something like this:
Checking it like this will guarentee that
data
is never null. If the call fails for some reason thenclient.General.GetAccountInfo().Data.Balances
will throw an exception because theData
property is null.Very interesting info, thx. It seems to me a little wierd to create a new instance of restclient for every request. I thought that one object would be enough. Like you create a single instance, and use it so send different requests. That is what I was doing. I’m testing your examples with using and multiple restclients at the moment.