Comments (5)
Try Request request(Request::Operation::GET_INSTRUMENTS, "coinbase", "");
from ccapi.
Try
Request request(Request::Operation::GET_INSTRUMENTS, "coinbase", "");
I'm new to this library and I couldn't find anything in the examples that uses Request::Operation::GET_INSTRUMETNS
, is the request supposed to return a list of symbols? if so how do I get that list? I saw the toString()
function which returns this:
Request [exchange = binance-us, marginType = , instrument = , serviceName = market_data, correlationId = 6D6a2kBR, secondaryCorrelationId = , paramList = [ ], credential = {}, operation = GET_INSTRUMENTS, timeSent = 1970-01-01T00:00:00.000000000Z]
from ccapi.
Actually let me reword my question, what's the best way to subscribe to all the coins to receive price updates? Currently the way I implemented it is to have a session for each coin which I'm guessing is wrong because even though it works for a few seconds but then somewhere in the thread it crashes. The examples are nice but I wish there was a better documentation so I could understand the proper usage better.
from ccapi.
when you send the request, the handler given in your session will receive the event corresponding to your request, the examples in the repo shows how to implement a custom handler and process received events.
As of my knowledge, there is no predefined request returning the list of symbols available within each exchange, but you could performed it by yourself using ccapi::Request::Operation::GENERIC_PUBLIC_REQUEST and then forming the request url following the desired exchange, and then handle the response with your handler:
ccapi::Request request(ccapi::Request::Operation::GENERIC_PUBLIC_REQUEST,CCAPI_EXCHANGE_NAME_KUCOIN, "", correlation_id);
request.appendParam({
{"HTTP_METHOD", SB_GET},
{"HTTP_PATH", SB_MKT_INFO_KUCOIN},
{"HTTP_QUERY_STRING","symbol=" + symbol},
});
from ccapi.
Actually let me reword my question, what's the best way to subscribe to all the coins to receive price updates? Currently the way I implemented it is to have a session for each coin which I'm guessing is wrong because even though it works for a few seconds but then somewhere in the thread it crashes. The examples are nice but I wish there was a better documentation so I could understand the proper usage better.
You can use just one session for all coins like this: https://github.com/crypto-chassis/ccapi#multiple-exchanges-andor-instruments.
from ccapi.
Related Issues (20)
- comile source code example with boost_beast failed (bind_front_wrapper) HOT 1
- Missing #include <iterator>, missing move constructor, missing move-assignment operator HOT 1
- bitget subscribes to the ORDER_UPDATE channel for question HOT 3
- MARKET_DEPTH in kucoin futures question HOT 1
- no correlation Id returned by event notifying orderbook subscription with Gate.io HOT 2
- segmentation fault, wsConnectionPtr null pointer in onPongByMethod HOT 1
- confusion about postProcessMessageMarketDataEventTrade in event_handler_base.h? HOT 1
- About interface synchronization request method HOT 1
- Question HOT 4
- Reconnect after disconnection HOT 2
- few subscriptions methods fail HOT 3
- add_compile_definitions(CCAPI_LAST_PRICE="d") HOT 1
- updates the bitget API from v1 to v2
- few issues with some exchanges HOT 1
- expose setTimer to python HOT 4
- I am facing this issue while using code 1
- Binance Websocket API
- random crash from ccapi_session HOT 1
- support POSITION_UPDATE and POSITION_UPDATE in okx HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccapi.