pharrisee / poloniex-api Goto Github PK
View Code? Open in Web Editor NEWARCHIVED --- A Go wrapper to the Poloniex API
License: MIT License
ARCHIVED --- A Go wrapper to the Poloniex API
License: MIT License
In both of the examples "gitlab.com/wmlph/poloniex-api"
is listed as the poloniex package. I think this was meant to be "github.com/pharrisee/poloniex-api"
correct? The examples work out fine with the second option.
Hello and thanks for this work.
When I try the example from the README (note that there is a small problem with the imports, there should be time
instead of log
), and with empty credentials, as in:
p := poloniex.NewWithCredentials("", "")
I get confirmation about the connection being established and the subscribe
commands, but I don't receive any events.
After some minutes, this is all the output that I have:
2018/01/13 15:38:55 Dial: connection was successfully established with wss://api2.poloniex.com/
2018/01/13 15:38:57 {"command":"subscribe","channel":"1002"}
2018/01/13 15:38:57 {"command":"subscribe","channel":"121"}
Is there something wrong in the example?
Or maybe this isn't supposed to be working without credentials (note that when this repository was on gitlab, a few months ago, I could get subscription events with empty credentials)?
I haven't tried with credentials.
Sometimes the websocket loses its connection, which is understandable. I looked into mitigating this problem, maybe by reconnecting to the WS API. However I saw that you were already using a library (github.com/mariuspass/recws) that should be able to reconnect in cases like this. What surprises me though, is that you made a change to not use this libs ReadMessage function anymore, how come?
Is it possible to support higher precision for decimal points? I saw on the Poloniex API that they're listing 8 decimals points in their response, while order book information through this wrapper only gives 6 points of precision. That ends up being relevant for some pairs like BTC-DOGE.
I'm not sure if this is a limitation with float64, but if the change is all right with you I can look into it and submit a pull request.
I'm trying to run your example to consume WS, but I'm getting panic due to nil pointer in logger
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x6f7ba9]
goroutine 6 [running]:
github.com/miratronix/logpher.(*Logger).LevelEnabled(...)
/home/djumpen/go/pkg/mod/github.com/miratronix/[email protected]/logger.go:49
github.com/miratronix/logpher.(*Logger).log(0x0, 0xd1c200, 0xc0000486b0, 0x2, 0x2)
/home/djumpen/go/pkg/mod/github.com/miratronix/[email protected]/logger.go:55 +0x29
github.com/miratronix/logpher.(*Logger).Info(...)
/home/djumpen/go/pkg/mod/github.com/miratronix/[email protected]/logger.go:34
github.com/miratronix/gows.(*Websocket).connect(0xc00012c000, 0x0, 0x0, 0x0, 0x0)
/home/djumpen/go/pkg/mod/github.com/miratronix/[email protected]/connection.go:15 +0x113
github.com/miratronix/gows.(*Websocket).reviver(0xc00012c000, 0xc00012a120)
/home/djumpen/go/pkg/mod/github.com/miratronix/[email protected]/connection.go:51 +0x53
created by github.com/miratronix/gows.(*Websocket).Connect
/home/djumpen/go/pkg/mod/github.com/miratronix/[email protected]/websocket.go:72 +0x92
I could fix it by initializing logger inside NewWithCredentials
but I'm wondering how it works for you as it is now.
I am receiving "json: cannot unmarshal object into Go value of type poloniex.OrderTrades"
while using the code similiar to
trades, err :=polo.OrderTrades(131531404054)
if err != nil {
log.Fatalln(err)
}
if len(trades) > 0 {
fmt.Println(trades)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.