Giter VIP home page Giter VIP logo

Comments (5)

cryptochassis avatar cryptochassis commented on August 16, 2024 1

Try Request request(Request::Operation::GET_INSTRUMENTS, "coinbase", "");

from ccapi.

omidnabi avatar omidnabi commented on August 16, 2024

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.

omidnabi avatar omidnabi commented on August 16, 2024

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.

nelyajizi avatar nelyajizi commented on August 16, 2024

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.

cryptochassis avatar cryptochassis commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.