niXman / binapi

Binance API C++ implementation
Apache License 2.0
252 stars 85 forks source link

Assertion failed: is_result_responce_type() #29

Closed gitkornel closed 3 years ago

gitkornel commented 3 years ago

Hello, I'm getting this error, tried to fix it but nothing worked.

Best Regards.

Error: Assertion failed: is_result_responce_type(), file C:\Users\admin\Desktop\binance\source\API\include\binapi\types.hpp, line 510

Also, I found out market_buy_order.v.get_responce_full().price is always 0 for some reason.

Code:

std::string final_coin_name = coin_name + "BTC";
auto market_buy_order = api.new_order(
    final_coin_name.c_str(),
    binapi::e_side::buy,
    binapi::e_type::market,
        binapi::e_time::GTC,
    quantity.c_str(),
    nullptr,
    nullptr,
    nullptr,
    nullptr
    );

std::cout << market_buy_order.v.get_responce_full().price << std::endl;
std::cout << market_buy_order.v.get_responce_result().price << std::endl;
niXman commented 3 years ago

hi,

ah, this is because newOrderRespType hardcoded as FULL here. I need to think how to do this better...

niXman commented 3 years ago

fixed in mster: https://github.com/niXman/binapi/commit/73cf3e322430c8b37be556fa8cb6d507fdb711e4

test it please.

niXman commented 3 years ago

@gitkornel any news?

gitkornel commented 3 years ago

@gitkornel any news?

hello, still zero.

gitkornel commented 3 years ago

v.get_responce_result().price

is always 0 for some reason

niXman commented 3 years ago

please provide me server reply.