GithubHelp home page GithubHelp logo

Comments (4)

0cv avatar 0cv commented on May 22, 2024

@adshao thoughts ?

from go-binance.

adshao avatar adshao commented on May 22, 2024

@Krisa Sorry for the late reply. Yes, I agree with you, an optional parameter useServerTime in https://github.com/jaggedsoft/node-binance-api#troubleshooting is more acceptable and useful in some cases than directly calling ntp synchronization in #125.

from go-binance.

adshao avatar adshao commented on May 22, 2024

To support this feature, we could set useServerTime in https://github.com/adshao/go-binance/blob/master/client.go#L191 as a per request option.

from go-binance.

0cv avatar 0cv commented on May 22, 2024

@adshao The problem of useServerTime in the node binance library is that it does a one time request when the client is initialized and... that's it. If the app is running multiple days, we can easily get out of sync again. That's the opposite of #125, and not really better either.

I'd be more in favour of exposing the timeOffset here https://github.com/jaggedsoft/node-binance-api/blob/d011f5845a91c06a0f4ef32ff08bed31d53cb29e/node-binance-api.js#L1207 (or rather TimeOffset) in the Client https://github.com/adshao/go-binance/blob/master/client.go#L172 which can be overwritten. A function BinanceClient.NewSetTimeOffsetService().Do(context.Background()) could also accessory set this TimeOffset, but that would be nothing more than querying Binance time and putting it into TimeOffset. Actually node-binance is also having such function here https://github.com/jaggedsoft/node-binance-api/blob/d011f5845a91c06a0f4ef32ff08bed31d53cb29e/node-binance-api.js#L1979 (additionally to the init param)

from go-binance.

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.