From 391e81b00ea038837ab92b5e90ca1d23af8319a1 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara-Reid Date: Mon, 6 Aug 2018 21:33:57 +1000 Subject: [PATCH] Updated docs (#171) --- CONTRIBUTORS | 2 +- README.md | 6 +- exchanges/gateio/README.md | 137 ++++++++++++++++- exchanges/huobihadax/README.md | 140 ++++++++++++++++++ exchanges/zb/README.md | 137 ++++++++++++++++- tools/documentation/documentation.go | 6 + .../exchanges_templates/gateio.tmpl | 105 +++++++++++++ .../exchanges_templates/huobihadax.tmpl | 105 +++++++++++++ .../documentation/exchanges_templates/zb.tmpl | 105 +++++++++++++ 9 files changed, 733 insertions(+), 10 deletions(-) create mode 100644 exchanges/huobihadax/README.md create mode 100644 tools/documentation/exchanges_templates/gateio.tmpl create mode 100644 tools/documentation/exchanges_templates/huobihadax.tmpl create mode 100644 tools/documentation/exchanges_templates/zb.tmpl diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 78ad2c75..75a763f4 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -4,9 +4,9 @@ thrasher- | https://github.com/thrasher- shazbert | https://github.com/shazbert gloriousCode | https://github.com/gloriousCode 140am | https://github.com/140am +ermalguni | https://github.com/ermalguni marcofranssen | https://github.com/marcofranssen Betazoid | https://github.com/Betazoid -ermalguni | https://github.com/ermalguni crackcomm | https://github.com/crackcomm bretep | https://github.com/bretep gam-phon | https://github.com/gam-phon diff --git a/README.md b/README.md index ccb46ec8..cff95dac 100644 --- a/README.md +++ b/README.md @@ -147,13 +147,13 @@ Binaries will be published once the codebase reaches a stable condition. |User|Github|Contribution Amount| |--|--|--| -| thrasher- | https://github.com/thrasher- | 453 | -| shazbert | https://github.com/shazbert | 141 | +| thrasher- | https://github.com/thrasher- | 456 | +| shazbert | https://github.com/shazbert | 142 | | gloriousCode | https://github.com/gloriousCode | 122 | | 140am | https://github.com/140am | 8 | +| ermalguni | https://github.com/ermalguni | 4 | | marcofranssen | https://github.com/marcofranssen | 4 | | Betazoid | https://github.com/Betazoid | 4 | -| ermalguni | https://github.com/ermalguni | 3 | | crackcomm | https://github.com/crackcomm | 3 | | bretep | https://github.com/bretep | 2 | | gam-phon | https://github.com/gam-phon | 2 | diff --git a/exchanges/gateio/README.md b/exchanges/gateio/README.md index 434088f5..9133e3aa 100644 --- a/exchanges/gateio/README.md +++ b/exchanges/gateio/README.md @@ -1,9 +1,140 @@ -# GoCryptoTrader package gateio +# GoCryptoTrader package Gateio + + + + +[![Build Status](https://travis-ci.org/thrasher-/gocryptotrader.svg?branch=master)](https://travis-ci.org/thrasher-/gocryptotrader) +[![Software License](https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square)](https://github.com/thrasher-/gocryptotrader/blob/master/LICENSE) +[![GoDoc](https://godoc.org/github.com/thrasher-/gocryptotrader?status.svg)](https://godoc.org/github.com/thrasher-/gocryptotrader/exchanges/gateio) +[![Coverage Status](http://codecov.io/github/thrasher-/gocryptotrader/coverage.svg?branch=master)](http://codecov.io/github/thrasher-/gocryptotrader?branch=master) +[![Go Report Card](https://goreportcard.com/badge/github.com/thrasher-/gocryptotrader)](https://goreportcard.com/report/github.com/thrasher-/gocryptotrader) + This gateio package is part of the GoCryptoTrader codebase. -## Gateio Exchange +## This is still in active development + +You can track ideas, planned features and what's in progresss on this Trello board: [https://trello.com/b/ZAhMhpOy/gocryptotrader](https://trello.com/b/ZAhMhpOy/gocryptotrader). + +Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader Slack](https://gocryptotrader.herokuapp.com/) + +## GateIO Exchange ### Current Features -Gateio 交易所的支持,支持获取K线、支持的交易对、交易市场参数、买/卖订单、取消订单 \ No newline at end of file ++ REST functions + +### How to enable + ++ [Enable via configuration](https://github.com/thrasher-/gocryptotrader/tree/master/config#enable-exchange-via-config-example) + ++ Individual package example below: + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### How to do REST public/private calls + ++ If enabled via "configuration".json file the exchange will be added to the +IBotExchange array in the ```go var bot Bot``` and you will only be able to use +the wrapper interface functions for accessing exchange data. View routines.go +for an example of integration usage with GoCryptoTrader. Rudimentary example +below: + +main.go +```go +var g exchange.IBotExchange + +for i := range bot.exchanges { + if bot.exchanges[i].GetName() == "GateIO" { + g = bot.exchanges[i] + } +} + +// Public calls - wrapper functions + +// Fetches current ticker information +tick, err := g.GetTickerPrice() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := g.GetOrderbookEx() +if err != nil { + // Handle error +} + +// Private calls - wrapper functions - make sure your APIKEY and APISECRET are +// set and AuthenticatedAPISupport is set to true + +// Fetches current account information +accountInfo, err := g.GetExchangeAccountInfo() +if err != nil { + // Handle error +} +``` + ++ If enabled via individually importing package, rudimentary example below: + +```go +// Public calls + +// Fetches current ticker information +ticker, err := g.GetTicker() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := g.GetOrderBook() +if err != nil { + // Handle error +} + +// Private calls - make sure your APIKEY and APISECRET are set and +// AuthenticatedAPISupport is set to true + +// GetUserInfo returns account info +accountInfo, err := g.GetUserInfo(...) +if err != nil { + // Handle error +} + +// Submits an order and the exchange and returns its tradeID +tradeID, err := g.Trade(...) +if err != nil { + // Handle error +} +``` + +### How to do LongPolling public/private calls + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### Please click GoDocs chevron above to view current GoDoc information for this package + +## Contribution + +Please feel free to submit any pull requests or suggest any desired features to be added. + +When submitting a PR, please abide by our coding guidelines: + ++ Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). ++ Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. ++ Code must adhere to our [coding style](https://github.com/thrasher-/gocryptotrader/blob/master/doc/coding_style.md). ++ Pull requests need to be based on and opened against the `master` branch. + +## Donations + + + +If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to: + +***1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB*** + diff --git a/exchanges/huobihadax/README.md b/exchanges/huobihadax/README.md new file mode 100644 index 00000000..dd791bcf --- /dev/null +++ b/exchanges/huobihadax/README.md @@ -0,0 +1,140 @@ +# GoCryptoTrader package Huobihadax + + + + +[![Build Status](https://travis-ci.org/thrasher-/gocryptotrader.svg?branch=master)](https://travis-ci.org/thrasher-/gocryptotrader) +[![Software License](https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square)](https://github.com/thrasher-/gocryptotrader/blob/master/LICENSE) +[![GoDoc](https://godoc.org/github.com/thrasher-/gocryptotrader?status.svg)](https://godoc.org/github.com/thrasher-/gocryptotrader/exchanges/huobihadax) +[![Coverage Status](http://codecov.io/github/thrasher-/gocryptotrader/coverage.svg?branch=master)](http://codecov.io/github/thrasher-/gocryptotrader?branch=master) +[![Go Report Card](https://goreportcard.com/badge/github.com/thrasher-/gocryptotrader)](https://goreportcard.com/report/github.com/thrasher-/gocryptotrader) + + +This huobihadax package is part of the GoCryptoTrader codebase. + +## This is still in active development + +You can track ideas, planned features and what's in progresss on this Trello board: [https://trello.com/b/ZAhMhpOy/gocryptotrader](https://trello.com/b/ZAhMhpOy/gocryptotrader). + +Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader Slack](https://gocryptotrader.herokuapp.com/) + +## HuobiHadax Exchange + +### Current Features + ++ REST functions + +### How to enable + ++ [Enable via configuration](https://github.com/thrasher-/gocryptotrader/tree/master/config#enable-exchange-via-config-example) + ++ Individual package example below: + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### How to do REST public/private calls + ++ If enabled via "configuration".json file the exchange will be added to the +IBotExchange array in the ```go var bot Bot``` and you will only be able to use +the wrapper interface functions for accessing exchange data. View routines.go +for an example of integration usage with GoCryptoTrader. Rudimentary example +below: + +main.go +```go +var h exchange.IBotExchange + +for i := range bot.exchanges { + if bot.exchanges[i].GetName() == "HuobiHadax" { + h = bot.exchanges[i] + } +} + +// Public calls - wrapper functions + +// Fetches current ticker information +tick, err := h.GetTickerPrice() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := h.GetOrderbookEx() +if err != nil { + // Handle error +} + +// Private calls - wrapper functions - make sure your APIKEY and APISECRET are +// set and AuthenticatedAPISupport is set to true + +// Fetches current account information +accountInfo, err := h.GetExchangeAccountInfo() +if err != nil { + // Handle error +} +``` + ++ If enabled via individually importing package, rudimentary example below: + +```go +// Public calls + +// Fetches current ticker information +ticker, err := h.GetTicker() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := h.GetOrderBook() +if err != nil { + // Handle error +} + +// Private calls - make sure your APIKEY and APISECRET are set and +// AuthenticatedAPISupport is set to true + +// GetUserInfo returns account info +accountInfo, err := h.GetUserInfo(...) +if err != nil { + // Handle error +} + +// Submits an order and the exchange and returns its tradeID +tradeID, err := h.Trade(...) +if err != nil { + // Handle error +} +``` + +### How to do LongPolling public/private calls + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### Please click GoDocs chevron above to view current GoDoc information for this package + +## Contribution + +Please feel free to submit any pull requests or suggest any desired features to be added. + +When submitting a PR, please abide by our coding guidelines: + ++ Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). ++ Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. ++ Code must adhere to our [coding style](https://github.com/thrasher-/gocryptotrader/blob/master/doc/coding_style.md). ++ Pull requests need to be based on and opened against the `master` branch. + +## Donations + + + +If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to: + +***1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB*** + diff --git a/exchanges/zb/README.md b/exchanges/zb/README.md index ef06284a..4e452ad6 100644 --- a/exchanges/zb/README.md +++ b/exchanges/zb/README.md @@ -1,9 +1,140 @@ -# GoCryptoTrader package zb +# GoCryptoTrader package Zb + + + + +[![Build Status](https://travis-ci.org/thrasher-/gocryptotrader.svg?branch=master)](https://travis-ci.org/thrasher-/gocryptotrader) +[![Software License](https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square)](https://github.com/thrasher-/gocryptotrader/blob/master/LICENSE) +[![GoDoc](https://godoc.org/github.com/thrasher-/gocryptotrader?status.svg)](https://godoc.org/github.com/thrasher-/gocryptotrader/exchanges/zb) +[![Coverage Status](http://codecov.io/github/thrasher-/gocryptotrader/coverage.svg?branch=master)](http://codecov.io/github/thrasher-/gocryptotrader?branch=master) +[![Go Report Card](https://goreportcard.com/badge/github.com/thrasher-/gocryptotrader)](https://goreportcard.com/report/github.com/thrasher-/gocryptotrader) + This zb package is part of the GoCryptoTrader codebase. -## ZB Exchange +## This is still in active development + +You can track ideas, planned features and what's in progresss on this Trello board: [https://trello.com/b/ZAhMhpOy/gocryptotrader](https://trello.com/b/ZAhMhpOy/gocryptotrader). + +Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader Slack](https://gocryptotrader.herokuapp.com/) + +## ZB Exchange ### Current Features -ZB 交易所的支持,支持获取K线、买/卖订单、取消订单 \ No newline at end of file ++ REST functions + +### How to enable + ++ [Enable via configuration](https://github.com/thrasher-/gocryptotrader/tree/master/config#enable-exchange-via-config-example) + ++ Individual package example below: + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### How to do REST public/private calls + ++ If enabled via "configuration".json file the exchange will be added to the +IBotExchange array in the ```go var bot Bot``` and you will only be able to use +the wrapper interface functions for accessing exchange data. View routines.go +for an example of integration usage with GoCryptoTrader. Rudimentary example +below: + +main.go +```go +var z exchange.IBotExchange + +for i := range bot.exchanges { + if bot.exchanges[i].GetName() == "ZB" { + z = bot.exchanges[i] + } +} + +// Public calls - wrapper functions + +// Fetches current ticker information +tick, err := z.GetTickerPrice() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := z.GetOrderbookEx() +if err != nil { + // Handle error +} + +// Private calls - wrapper functions - make sure your APIKEY and APISECRET are +// set and AuthenticatedAPISupport is set to true + +// Fetches current account information +accountInfo, err := z.GetExchangeAccountInfo() +if err != nil { + // Handle error +} +``` + ++ If enabled via individually importing package, rudimentary example below: + +```go +// Public calls + +// Fetches current ticker information +ticker, err := z.GetTicker() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := z.GetOrderBook() +if err != nil { + // Handle error +} + +// Private calls - make sure your APIKEY and APISECRET are set and +// AuthenticatedAPISupport is set to true + +// GetUserInfo returns account info +accountInfo, err := z.GetUserInfo(...) +if err != nil { + // Handle error +} + +// Submits an order and the exchange and returns its tradeID +tradeID, err := z.Trade(...) +if err != nil { + // Handle error +} +``` + +### How to do LongPolling public/private calls + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### Please click GoDocs chevron above to view current GoDoc information for this package + +## Contribution + +Please feel free to submit any pull requests or suggest any desired features to be added. + +When submitting a PR, please abide by our coding guidelines: + ++ Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). ++ Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. ++ Code must adhere to our [coding style](https://github.com/thrasher-/gocryptotrader/blob/master/doc/coding_style.md). ++ Pull requests need to be based on and opened against the `master` branch. + +## Donations + + + +If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to: + +***1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB*** + diff --git a/tools/documentation/documentation.go b/tools/documentation/documentation.go index ac1b7144..efe21a92 100644 --- a/tools/documentation/documentation.go +++ b/tools/documentation/documentation.go @@ -59,9 +59,11 @@ const ( coinbasepro = "..%s..%sexchanges%scoinbasepro%s" coinut = "..%s..%sexchanges%scoinut%s" exmo = "..%s..%sexchanges%sexmo%s" + gateio = "..%s..%sexchanges%sgateio%s" gemini = "..%s..%sexchanges%sgemini%s" hitbtc = "..%s..%sexchanges%shitbtc%s" huobi = "..%s..%sexchanges%shuobi%s" + huobihadax = "..%s..%sexchanges%shuobihadax%s" itbit = "..%s..%sexchanges%sitbit%s" kraken = "..%s..%sexchanges%skraken%s" lakebtc = "..%s..%sexchanges%slakebtc%s" @@ -72,6 +74,7 @@ const ( poloniex = "..%s..%sexchanges%spoloniex%s" wex = "..%s..%sexchanges%swex%s" yobit = "..%s..%sexchanges%syobit%s" + zb = "..%s..%sexchanges%szb%s" contributorsList = "https://api.github.com/repos/thrasher-/gocryptotrader/contributors" @@ -230,9 +233,11 @@ func addPaths() { codebasePaths["exchanges coinut"] = fmt.Sprintf(coinut, path, path, path, path) codebasePaths["exchanges exmo"] = fmt.Sprintf(exmo, path, path, path, path) codebasePaths["exchanges coinbasepro"] = fmt.Sprintf(coinbasepro, path, path, path, path) + codebasePaths["exchanges gateio"] = fmt.Sprintf(gateio, path, path, path, path) codebasePaths["exchanges gemini"] = fmt.Sprintf(gemini, path, path, path, path) codebasePaths["exchanges hitbtc"] = fmt.Sprintf(hitbtc, path, path, path, path) codebasePaths["exchanges huobi"] = fmt.Sprintf(huobi, path, path, path, path) + codebasePaths["exchanges huobihadax"] = fmt.Sprintf(huobihadax, path, path, path, path) codebasePaths["exchanges itbit"] = fmt.Sprintf(itbit, path, path, path, path) codebasePaths["exchanges kraken"] = fmt.Sprintf(kraken, path, path, path, path) codebasePaths["exchanges lakebtc"] = fmt.Sprintf(lakebtc, path, path, path, path) @@ -243,6 +248,7 @@ func addPaths() { codebasePaths["exchanges poloniex"] = fmt.Sprintf(poloniex, path, path, path, path) codebasePaths["exchanges wex"] = fmt.Sprintf(wex, path, path, path, path) codebasePaths["exchanges yobit"] = fmt.Sprintf(yobit, path, path, path, path) + codebasePaths["exchanges zb"] = fmt.Sprintf(zb, path, path, path, path) codebasePaths["CONTRIBUTORS"] = fmt.Sprintf(rootPath, path, path) codebasePaths["LICENSE"] = fmt.Sprintf(rootPath, path, path) diff --git a/tools/documentation/exchanges_templates/gateio.tmpl b/tools/documentation/exchanges_templates/gateio.tmpl new file mode 100644 index 00000000..d075b1a4 --- /dev/null +++ b/tools/documentation/exchanges_templates/gateio.tmpl @@ -0,0 +1,105 @@ +{{define "exchanges gateio" -}} +{{template "header" .}} +## GateIO Exchange + +### Current Features + ++ REST functions + +### How to enable + ++ [Enable via configuration](https://github.com/thrasher-/gocryptotrader/tree/master/config#enable-exchange-via-config-example) + ++ Individual package example below: + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### How to do REST public/private calls + ++ If enabled via "configuration".json file the exchange will be added to the +IBotExchange array in the ```go var bot Bot``` and you will only be able to use +the wrapper interface functions for accessing exchange data. View routines.go +for an example of integration usage with GoCryptoTrader. Rudimentary example +below: + +main.go +```go +var g exchange.IBotExchange + +for i := range bot.exchanges { + if bot.exchanges[i].GetName() == "GateIO" { + g = bot.exchanges[i] + } +} + +// Public calls - wrapper functions + +// Fetches current ticker information +tick, err := g.GetTickerPrice() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := g.GetOrderbookEx() +if err != nil { + // Handle error +} + +// Private calls - wrapper functions - make sure your APIKEY and APISECRET are +// set and AuthenticatedAPISupport is set to true + +// Fetches current account information +accountInfo, err := g.GetExchangeAccountInfo() +if err != nil { + // Handle error +} +``` + ++ If enabled via individually importing package, rudimentary example below: + +```go +// Public calls + +// Fetches current ticker information +ticker, err := g.GetTicker() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := g.GetOrderBook() +if err != nil { + // Handle error +} + +// Private calls - make sure your APIKEY and APISECRET are set and +// AuthenticatedAPISupport is set to true + +// GetUserInfo returns account info +accountInfo, err := g.GetUserInfo(...) +if err != nil { + // Handle error +} + +// Submits an order and the exchange and returns its tradeID +tradeID, err := g.Trade(...) +if err != nil { + // Handle error +} +``` + +### How to do LongPolling public/private calls + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchanges_templates/huobihadax.tmpl b/tools/documentation/exchanges_templates/huobihadax.tmpl new file mode 100644 index 00000000..d09535cf --- /dev/null +++ b/tools/documentation/exchanges_templates/huobihadax.tmpl @@ -0,0 +1,105 @@ +{{define "exchanges huobihadax" -}} +{{template "header" .}} +## HuobiHadax Exchange + +### Current Features + ++ REST functions + +### How to enable + ++ [Enable via configuration](https://github.com/thrasher-/gocryptotrader/tree/master/config#enable-exchange-via-config-example) + ++ Individual package example below: + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### How to do REST public/private calls + ++ If enabled via "configuration".json file the exchange will be added to the +IBotExchange array in the ```go var bot Bot``` and you will only be able to use +the wrapper interface functions for accessing exchange data. View routines.go +for an example of integration usage with GoCryptoTrader. Rudimentary example +below: + +main.go +```go +var h exchange.IBotExchange + +for i := range bot.exchanges { + if bot.exchanges[i].GetName() == "HuobiHadax" { + h = bot.exchanges[i] + } +} + +// Public calls - wrapper functions + +// Fetches current ticker information +tick, err := h.GetTickerPrice() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := h.GetOrderbookEx() +if err != nil { + // Handle error +} + +// Private calls - wrapper functions - make sure your APIKEY and APISECRET are +// set and AuthenticatedAPISupport is set to true + +// Fetches current account information +accountInfo, err := h.GetExchangeAccountInfo() +if err != nil { + // Handle error +} +``` + ++ If enabled via individually importing package, rudimentary example below: + +```go +// Public calls + +// Fetches current ticker information +ticker, err := h.GetTicker() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := h.GetOrderBook() +if err != nil { + // Handle error +} + +// Private calls - make sure your APIKEY and APISECRET are set and +// AuthenticatedAPISupport is set to true + +// GetUserInfo returns account info +accountInfo, err := h.GetUserInfo(...) +if err != nil { + // Handle error +} + +// Submits an order and the exchange and returns its tradeID +tradeID, err := h.Trade(...) +if err != nil { + // Handle error +} +``` + +### How to do LongPolling public/private calls + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}} diff --git a/tools/documentation/exchanges_templates/zb.tmpl b/tools/documentation/exchanges_templates/zb.tmpl new file mode 100644 index 00000000..5a2537af --- /dev/null +++ b/tools/documentation/exchanges_templates/zb.tmpl @@ -0,0 +1,105 @@ +{{define "exchanges zb" -}} +{{template "header" .}} +## ZB Exchange + +### Current Features + ++ REST functions + +### How to enable + ++ [Enable via configuration](https://github.com/thrasher-/gocryptotrader/tree/master/config#enable-exchange-via-config-example) + ++ Individual package example below: + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### How to do REST public/private calls + ++ If enabled via "configuration".json file the exchange will be added to the +IBotExchange array in the ```go var bot Bot``` and you will only be able to use +the wrapper interface functions for accessing exchange data. View routines.go +for an example of integration usage with GoCryptoTrader. Rudimentary example +below: + +main.go +```go +var z exchange.IBotExchange + +for i := range bot.exchanges { + if bot.exchanges[i].GetName() == "ZB" { + z = bot.exchanges[i] + } +} + +// Public calls - wrapper functions + +// Fetches current ticker information +tick, err := z.GetTickerPrice() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := z.GetOrderbookEx() +if err != nil { + // Handle error +} + +// Private calls - wrapper functions - make sure your APIKEY and APISECRET are +// set and AuthenticatedAPISupport is set to true + +// Fetches current account information +accountInfo, err := z.GetExchangeAccountInfo() +if err != nil { + // Handle error +} +``` + ++ If enabled via individually importing package, rudimentary example below: + +```go +// Public calls + +// Fetches current ticker information +ticker, err := z.GetTicker() +if err != nil { + // Handle error +} + +// Fetches current orderbook information +ob, err := z.GetOrderBook() +if err != nil { + // Handle error +} + +// Private calls - make sure your APIKEY and APISECRET are set and +// AuthenticatedAPISupport is set to true + +// GetUserInfo returns account info +accountInfo, err := z.GetUserInfo(...) +if err != nil { + // Handle error +} + +// Submits an order and the exchange and returns its tradeID +tradeID, err := z.Trade(...) +if err != nil { + // Handle error +} +``` + +### How to do LongPolling public/private calls + +```go + // Exchanges will be abstracted out in further updates and examples will be + // supplied then +``` + +### Please click GoDocs chevron above to view current GoDoc information for this package +{{template "contributions"}} +{{template "donations"}} +{{end}}