niXman / binapi

Binance API C++ implementation
Apache License 2.0
263 stars 88 forks source link

Use of "responce" instead of "response" in types.hpp and api.cpp #75

Closed lnghrdntcr closed 9 months ago

lnghrdntcr commented 9 months ago

Several APIs and types use the term "responce" instead of "response" in the function declaration/type name. This appears to be a typo. If those methods/types were to be private, I would have created a PR correcting the typos. However, most (if not all) of those APIs are public, hence, correcting the declaration might break builds that use this lib as a dependency.

I'm opening this issue to ask feedback to the developer on how to proceed.

List of occurrences of the term "responce" (last commit on master)

$ grep -rn "responce" 
include/binapi/types.hpp:541:    get_responce_type() const {
include/binapi/types.hpp:555:    bool is_valid_responce_type()  const { const auto r =  get_responce_type(); return r.first != e_trade_resp_type::UNKNOWN; }
include/binapi/types.hpp:556:    bool is_ack_responce_type()    const { const auto r =  get_responce_type(); return r.first == e_trade_resp_type::ACK; }
include/binapi/types.hpp:557:    bool is_result_responce_type() const { const auto r =  get_responce_type(); return r.first == e_trade_resp_type::RESULT; }
include/binapi/types.hpp:558:    bool is_full_responce_type()   const { const auto r =  get_responce_type(); return r.first == e_trade_resp_type::FULL; }
include/binapi/types.hpp:559:    bool is_test_responce_type()   const { const auto r =  get_responce_type(); return r.first == e_trade_resp_type::TEST; }
include/binapi/types.hpp:561:    const new_order_info_ack_t& get_responce_ack() const {
include/binapi/types.hpp:562:        const auto r =  get_responce_type();
include/binapi/types.hpp:567:    const new_order_info_result_t& get_responce_result() const {
include/binapi/types.hpp:568:        const auto r =  get_responce_type();
include/binapi/types.hpp:573:    const new_order_info_full_t& get_responce_full() const {
include/binapi/types.hpp:574:        const auto r =  get_responce_type();
include/binapi/types.hpp:579:    const new_test_order_info_t& get_responce_test() const {
include/binapi/types.hpp:580:        const auto r =  get_responce_type();
include/binapi/types.hpp:587:        const auto r =  get_responce_type();
src/api.cpp:917:    const char *responce_type = e_trade_resp_type_to_string(resp);
src/api.cpp:918:    assert(responce_type);
src/api.cpp:930:        ,{"newOrderRespType", responce_type}
src/api.cpp:960:    const char *responce_type = e_trade_resp_type_to_string(resp);
src/api.cpp:961:    assert(responce_type);
src/api.cpp:973:        ,{"newOrderRespType", responce_type}

List of occurrences of the term "response" (last commit on master)

grep -rn "response"
src/api.cpp:439:        boost::beast::http::response<boost::beast::http::string_body> bres;
src/api.cpp:459:    using response_ptr = std::unique_ptr<boost::beast::http::response<boost::beast::http::string_body>>;
src/api.cpp:460:    using response_type = typename response_ptr::element_type;
src/api.cpp:587:        auto resp = std::make_unique<response_type>();
src/api.cpp:591:        // Receive the HTTP response
src/api.cpp:601:    void on_read(const boost::system::error_code &ec, response_ptr resp, ssl_socket_ptr ssl_socket, std::size_t rd) {
src/api.cpp:618:    void on_shutdown(const boost::system::error_code &ec, response_ptr resp, ssl_socket_ptr ssl_socket) {
niXman commented 9 months ago

hi,

Several APIs and types use the term "responce" instead of "response" in the function declaration/type name.

yeah, I was just waiting for someone to pay attention to this =)

I'm opening this issue to ask feedback to the developer on how to proceed.

great, i'm interested too!

thank you!

lnghrdntcr commented 9 months ago

Should I proceed with the PR?

niXman commented 9 months ago

yes please!

thanks!

lnghrdntcr commented 9 months ago

This "issue" has been solved in PR #76.