dmikushin / binance-cxx-api Goto Github PK
View Code? Open in Web Editor NEWBinance Bincoin Exchange C++ API
License: MIT License
Binance Bincoin Exchange C++ API
License: MIT License
Hello,
When following the installation instructions of this library, executing the cmd "cmake .." in the build directory causes the following error:
CMake Error at CMakeLists.txt:31 (target_link_libraries):
Cannot specify link libraries for target "mbedcrypto::mbedcrypto" which is
not built by this project.
Do I need to install mbedcrypto separately, and if so wich one? Because there are multiple mbedcrypto git repos.
(Thank you for your time)
Hello
I tested this library and python one
When call the same restful API , this library costs 800ms and python library only cost 300ms . Is there any way to imporve the performance? Is the problem with keep alive?
Thanks
Hi Dmikushin.
Thanks for your project.
I would like to know if you have the c++ code for place a new order using Lotsize , I have seen your function binance::Market::getLotSize, but I wold like to know if you have the implementation using this function + Rules of StepSize ?
Thanks for your help.
Best Regards Maria.
hi, is it possible to subscribe and parse different streams at the same time ? if so, can you provide with an example if possible ? Also, do you think it's safe to multi-thread ? My aim is to open one many streams per symbol and pipe the data through a local socket to another module. Thanks !
Hi,
almost got it compiled on osx 10.13.6.
uint64_t tid;
pthread_threadid_np(NULL, &tid);
return tid;
then code compiles. There seems to be a problem with jsoncpp though. cause the last stepp in compiling libbinacpp.so gives me this error:
/usr/local/Cellar/gcc/9.2.0_2/bin/g++-9 -fPIC -shared -lcurl -lwebsockets -ljsoncpp binance.cpp *.o -o libbinacpp.so -lcrypto -L /usr/local/Cellar/[email protected]/1.1.1d/lib/ -L/usr/local/lib -ljsoncp
"Json::Reader::parse(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, Json::Value&, bool)", referenced from:
binance::Account::getInfo(Json::Value&, long) in binance_account.o
binance::Account::getTrades(Json::Value&, char const*, int) in binance_account.o
binance::Account::getTradesSigned(Json::Value&, char const*, long, long, int) in binance_account.o
binance::Account::getHistoricalTrades(Json::Value&, char const*, long, int) in binance_account.o
binance::Account::getOpenOrders(Json::Value&, long) in binance_account.o
binance::Account::getOpenOrders(Json::Value&, char const*, long) in binance_account.o
binance::Account::getAllOrders(Json::Value&, char const*, long, int, long) in binance_account.o
...
"Json::Value::getMemberNamesabi:cxx11 const", referenced from:
binance::Account::getInfo(Json::Value&, long) in binance_account.o
binance::Account::getTrades(Json::Value&, char const*, int) in binance_account.o
binance::Account::getTradesSigned(Json::Value&, char const*, long, long, int) in binance_account.o
binance::Account::getHistoricalTrades(Json::Value&, char const*, long, int) in binance_account.o
binance::Account::getOpenOrders(Json::Value&, long) in binance_account.o
binance::Account::getOpenOrders(Json::Value&, char const*, long) in binance_account.o
binance::Account::getAllOrders(Json::Value&, char const*, long, int, long) in binance_account.o
...
"Json::Value::asStringabi:cxx11 const", referenced from:
binance::Account::getInfo(Json::Value&, long) in binance_account.o
binance::Account::getTrades(Json::Value&, char const*, int) in binance_account.o
binance::Account::getTradesSigned(Json::Value&, char const*, long, long, int) in binance_account.o
binance::Account::getHistoricalTrades(Json::Value&, char const*, long, int) in binance_account.o
binance::Account::getOpenOrders(Json::Value&, long) in binance_account.o
binance::Account::getOpenOrders(Json::Value&, char const*, long) in binance_account.o
binance::Account::getAllOrders(Json::Value&, char const*, long, int, long) in binance_account.o
...
if i remove -ljsoncpp there are tons of errors, so it clearly finds jsoncpp. I have no idea what the issue is. Any help appreciated.
(compiles fine on linux ! thanks for the effort)
I get following error while trying to run the example:
[2019/04/01 20:23:07:5422] NOTICE: lws_protocol_init
[2019/04/01 20:23:07:8858] ERR: SSL connect error 337047686: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
2019-04-01 20:23:07 885877 :binance::Websocket::event_cb LWS_CALLBACK_CLIENT_CONNECTION_ERROR
Any idea?
git clone https://github.com/dmikushin/binance-cxx-api.git
cd binance-cxx-api
mkdir build
cd build/
cmake ..
./example
After cmake ..
I did not find an example under build directory.
./example
won't run.
Did you miss any command? Thanks.
Best.
Alex
I am getting Segmentation Fault, just by executing "account.getInfo(json_result, recvWindow)"
Program received signal SIGSEGV, Segmentation fault.
0x00007fbf4151abd6 in mbedtls_sha256_finish_ret (ctx=0x55658cd7faf0, output=0x2af8 <error: Cannot access memory at address 0x2af8>) at /opt/binance-cxx-api/ThirdParty/mbedtls/crypto/library/sha256.c:386
386 PUT_UINT32_BE( ctx->state[0], output, 0 );
Hi guys,
i have an issue with placing a market order. Especially with the timeforce.
I get this message when trying to : "Parameter 'timeInForce' sent when not required."
Do you know how can i fix it ?
thanks
Hi,
I'm sure you will be glad to know there is another, better and more complete implementation of Binance API on C++: https://github.com/niXman/binapi
I will be grateful for advertising! =)
Currently we have access to spot data which is available at 'stream.binance.com'. Can we access futures data also which is available at fstream.binance.com? Simply changing BINANCE_WS_HOST to fstream.binance.com doesn't work. Has anyone else tried accessing futures data using binance-cxx-api?
I have a strange issue here, almost after 24 hours of running my program using
Websocket::enter_event_loop()
I do not receive any more "wsi scheduling validity check"
in program syslogs.
Therefore the program does not get any update from Binance ticker which I set-up.
I was wondering if anyone else has this kind of behavior.
Hello,
I compiled everything and can use the REST functions without issues, but I'm struggling to find a solution to getting the websocket examples to work.
Without changing the original code, the connection fails with lws_ssl_client_connect1.
If I add LCCSCF_ALLOW_INSECURE, there are no errors, but no data is received.
Any ideas on how can I debug/fix it?
Hello,
Since I updated the changes after #13, I get a segmentation fault when running example.cpp. I narrowed down the cause to line 78: Websocket::enter_event_loop();
Had 0 problems before, so I'm positive it's since last update. Sometimes it happens instantly, sometimes it takes longer (10-20 seconds). So I'm guessing it happens in the do-while loop.
OS info:
System Version: macOS 10.14.6 (18G103)
Kernel Version: Darwin 18.7.0
Thank you for your time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.