Skip to content

jmptrader/golang-mtgox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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) // Both are in _int notation. Will add float later
	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.

About

A Mt. Gox Websocket API Implementation in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%