GithubHelp home page GithubHelp logo

Comments (4)

jsam avatar jsam commented on May 22, 2024

Ok, scratch that. To answer my own question.

Backend actually does send the exchange event, it's just that there is a bug in tools/websocket_client. In line 183, instead of using WebsocketEventResponse type we should use WebsocketEvent type, cause in that case unmarshal actually works correctly. Before I send PR with a fix, can somebody confirm this?

Also, what's the best practice for timestamping ticker updates?

from gocryptotrader.

thrasher- avatar thrasher- commented on May 22, 2024

Hey @jsam, you are correct. If you wish to get exchange ticker/orderbook streamed using the websocket client, you'd want a WebsocketEvent type in for the loop. This way you'll get the exchange info. As for timestamping ticker updates, a solution would be to have a variable in the ticker.Price struct which has a time.Time var and is set to whenever a ticker item is created/updated.

from gocryptotrader.

gloriousCode avatar gloriousCode commented on May 22, 2024

Hey @jsam I'm already getting the exchange name from the ticker_update event.
So the message from the websocket is structured like:

{
data:any,
exchange:string,
error:any,
event:string
}

Or see my object here. I'm using the exchange property since its not contained within the data property

See here for where I map this object. It's what I use to render the selected exchange/currency here:
image

Timestamps are definitely missing though.

from gocryptotrader.

jsam avatar jsam commented on May 22, 2024

Thank you very much. I'll send a PR, after work.

from gocryptotrader.

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.