mtgox
An implementation of a Mt. Gox client in Go. It uses the websocket interface.
Note: This API mostly complete but untested in production.
Documentation
Example below. API Documentation on Godoc.
Example
func ExampleMtGoxApi() {
gox, err := NewFromConfig(os.ExpandEnv("$MTGOX_CONFIG"))
if err != nil {
panic(err)
}
c, err := gox.Subscribe("ticker", "depth")
if err != nil {
panic(err)
}
go func() {
for msg := range c {
fmt.Println("Got ticker or depth:", msg)
}
}()
orderchan, err := gox.SubmitOrder("bid", 100000000, 10000)
if err != nil {
panic(err)
}
order := <- orderchan
if order.Success {
fmt.Println("Yay submitted an order!", order.Result)
} else {
fmt.Println("Boo. Failure!", order.Error)
}
}
License
MIT found in LICENSE file.