Closed DaniilSokolyuk closed 3 months ago
Hi, your comment doesnt make any sense. I think you wrote a comment in the wrong repository as you are referring to some binance repo?
why my comment doesn't make sense? how to define a custom http client to execute requests? link to binance repo as an example of a very high quality client for an exchange
I was confused because literally nothing is deserialized into map[string]string
and there is no http client inside any of the websocket implementations so i thought you made a comment in the wrong repo.
Although you are right about that every currency gets deserialized into a float64. Can you please explain why string is preferred over float64? If you want to do any calculation or comparison you have to make it a float64 anyway.
f1 := float64(0.1)
f2 := float64(0.2)
fmt.Println(f1 + f2) // 0.30000000000000004
v, err := strconv.ParseFloat("30000000005.12345678", 64)
if err != nil {
panic(err)
}
fmt.Println(fmt.Sprintf("%f", v)) // 30000000005.123455
because there is no precision when using float, in golang for money mostly use https://github.com/shopspring/decimal since there is no built-in decimal support, but it is not a good solution to force some library for decimal, so string is the best solution.
That makes sense, i will look into it.
@DaniilSokolyuk i've released v2.1.0, please check it out when you have the time ;-)
Release notes https://github.com/larscom/bitvavo-go/releases/tag/v2.1.0
Hi, interesting changes with websocket, but without defining a custom http.client it's impossible to use, we need to declare a custom http.RoundTripper for logging metrics and traces, and also define a custom Proxy, example here https://github.com/adshao/go-binance/blob/master/v2/client.go#L387 And also what's the point of deserializing everything in map[string]string and using float? float is not used by anyone in real life for money, leave string please So it would be great to have logging in websocket (connect, disconnect, reconnect, errors)