From 7dd3f13c8d2a7c8272d98f587158d0f8b57f3313 Mon Sep 17 00:00:00 2001
From: Adam <31364354+MadCozBadd@users.noreply.github.com>
Date: Wed, 1 Apr 2020 11:15:10 +1100
Subject: [PATCH] Exchange API modification monitor (#404)
* WIP
* Variable Name Changes and other PR Changes
* Name Changes and Error Checks
* WIP
* Some new functionality added and nits fixed
* WIP on Nits
* More trello functionality added and some PR changes
* Minor changes and linter fixes
* Errors Fixed and some PR Changes
* PR Changes
* WIP
* WIP
* Addition of Config
* WIP of Readme file
* Readme WIP
* Addition of ReadMe
* Linter Issues fixed
* Minor Errors fixed
* fixed test timeout issues and added api keys check for tests
* Errors fixed
* Nits WIP
* Nits fixed
* More efficient mutex usage
* Consts cleaned up
* Readme file fixed
* linter issues fixed
* format issues:
* readme updates and nits
* remove backup file and address nits
* backup file removed for real
* OkexOkcoin updates and linter fixes
* errors fixed
* Nits
* errors fixed
* formatting issues
* race conditions fixed
* files fixed
* go mod n go sum
* WIP adding rate limits
* Added rate limits
* Remove test vars
* go mod tidy
* improving readme file and 2digits for trello auto update
* Added space
* removed space
* addressing nits
* documentation update
* more nits
* board id check
* linter fixes
* test race fixed
* test file match
* errors fixed
* nitz
* LOWERCASE flags
* more nitz
* broken wip
* flag addition fixed
* error fixed
* documentation updated for adding exchange using flags
* something
* add comment
* nitz fixed
* pr changes
* added gemini exchange
* testfile saving changes
* nitz
* fixing done
* pr changes
* nits
* WIP
* minor error fix
* wip
* wip
* WIP
* pr changes
* pr changes
* pr changes
* nits
* nits fixed
* t.Fail removed
* nitz
* disable lakeBTC
* contributors fixed
contributors fixed
ALL THE NITZ
OMG
* OMGGG
ALL THE NITZ
OMG
* name change errors fixed
* linter issues fixed
* linterzz
* Added disabling feature for exchanges
* bug fix
* small feature added
* fixed
bug fix:
no keys
* nits
* test
* test2
* test 3
* linter fixed
* testing
* testing
* remove logs
* OMG
* bugfix
* cyam88888
* nits
* error handled
* minor nits
fixed createnewcheck issue
fixed createnewcheck issue
* functionality change
some functionality changes
no api keys 4u :D
* trello names thro config
* err check
---
.gitignore | 3 +
CONTRIBUTORS | 10 +-
README.md | 18 +-
cmd/apichecker/README.md | 132 ++
cmd/apichecker/apicheck.go | 1598 +++++++++++++++++
cmd/apichecker/apicheck_test.go | 704 ++++++++
cmd/apichecker/apicheck_types.go | 100 ++
cmd/apichecker/testupdates.json | 430 +++++
cmd/apichecker/updates.json | 430 +++++
cmd/documentation/README.md | 2 +-
.../cmd_templates/apichecker.tmpl | 98 +
cmd/documentation/documentation.go | 10 +
cmd/documentation/sub_templates/header.tmpl | 2 +-
cmd/exchange_template/readme_file.tmpl | 2 +-
common/README.md | 2 +-
common/common.go | 5 +-
communications/README.md | 2 +-
communications/base/README.md | 2 +-
communications/slack/README.md | 2 +-
communications/smsglobal/README.md | 2 +-
communications/smtpservice/README.md | 2 +-
communications/telegram/README.md | 2 +-
config/README.md | 2 +-
currency/README.md | 2 +-
currency/forexprovider/README.md | 2 +-
currency/forexprovider/base/README.md | 2 +-
.../currencyconverterapi/README.md | 2 +-
.../forexprovider/currencylayer/README.md | 2 +-
.../exchangeratesapi.io/README.md | 2 +-
currency/forexprovider/fixer.io/README.md | 2 +-
.../forexprovider/openexchangerates/README.md | 2 +-
exchanges/README.md | 2 +-
exchanges/alphapoint/README.md | 2 +-
exchanges/binance/README.md | 2 +-
exchanges/bitfinex/README.md | 2 +-
exchanges/bitflyer/README.md | 2 +-
exchanges/bithumb/README.md | 2 +-
exchanges/bitmex/README.md | 2 +-
exchanges/bitstamp/README.md | 2 +-
exchanges/bittrex/README.md | 2 +-
exchanges/btcmarkets/README.md | 2 +-
exchanges/btse/README.md | 2 +-
exchanges/coinbasepro/README.md | 2 +-
.../coinbasepro/coinbasepro_websocket.go | 2 +-
exchanges/coinbene/README.md | 2 +-
exchanges/coinut/README.md | 2 +-
exchanges/exmo/README.md | 2 +-
exchanges/gateio/README.md | 2 +-
exchanges/gemini/README.md | 2 +-
exchanges/hitbtc/README.md | 2 +-
exchanges/huobi/README.md | 2 +-
exchanges/huobi/huobi_websocket.go | 2 +-
exchanges/itbit/README.md | 2 +-
exchanges/kraken/README.md | 2 +-
exchanges/lakebtc/README.md | 2 +-
exchanges/lbank/README.md | 2 +-
exchanges/localbitcoins/README.md | 2 +-
exchanges/mock/README.md | 2 +-
exchanges/nonce/README.md | 2 +-
exchanges/okcoin/README.md | 2 +-
exchanges/okex/README.md | 2 +-
exchanges/okgroup/README.md | 2 +-
exchanges/order/README.md | 2 +-
exchanges/orderbook/README.md | 2 +-
exchanges/poloniex/README.md | 2 +-
exchanges/request/README.md | 2 +-
exchanges/stats/README.md | 2 +-
exchanges/ticker/README.md | 2 +-
exchanges/yobit/README.md | 2 +-
exchanges/zb/README.md | 2 +-
go.mod | 1 +
portfolio/README.md | 2 +-
testdata/README.md | 2 +-
web/README.md | 2 +-
74 files changed, 3587 insertions(+), 74 deletions(-)
create mode 100644 cmd/apichecker/README.md
create mode 100644 cmd/apichecker/apicheck.go
create mode 100644 cmd/apichecker/apicheck_test.go
create mode 100644 cmd/apichecker/apicheck_types.go
create mode 100644 cmd/apichecker/testupdates.json
create mode 100644 cmd/apichecker/updates.json
create mode 100644 cmd/documentation/cmd_templates/apichecker.tmpl
diff --git a/.gitignore b/.gitignore
index d4714c73..81fab49c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,3 +29,6 @@ cmd/gctcli/gctcli
*.out
sqlboiler.toml
sqlboiler.json
+
+# GCT API Check
+backup.json
\ No newline at end of file
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 77f26633..50918086 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -4,30 +4,32 @@ thrasher- | https://github.com/thrasher-
shazbert | https://github.com/shazbert
gloriousCode | https://github.com/gloriousCode
xtda | https://github.com/xtda
-ermalguni | https://github.com/ermalguni
dependabot-preview[bot] | https://github.com/apps/dependabot-preview
+ermalguni | https://github.com/ermalguni
vadimzhukck | https://github.com/vadimzhukck
140am | https://github.com/140am
marcofranssen | https://github.com/marcofranssen
MadCozBadd | https://github.com/MadCozBadd
cranktakular | https://github.com/cranktakular
+woshidama323 | https://github.com/woshidama323
+vazha | https://github.com/vazha
crackcomm | https://github.com/crackcomm
andreygrehov | https://github.com/andreygrehov
bretep | https://github.com/bretep
-woshidama323 | https://github.com/woshidama323
-vazha | https://github.com/vazha
+Christian-Achilli | https://github.com/Christian-Achilli
gam-phon | https://github.com/gam-phon
cornelk | https://github.com/cornelk
if1live | https://github.com/if1live
lozdog245 | https://github.com/lozdog245
soxipy | https://github.com/soxipy
herenow | https://github.com/herenow
+azhang | https://github.com/azhang
blombard | https://github.com/blombard
-Christian-Achilli | https://github.com/Christian-Achilli
CodeLingoBot | https://github.com/CodeLingoBot
CodeLingoTeam | https://github.com/CodeLingoTeam
Daanikus | https://github.com/Daanikus
daniel-cohen | https://github.com/daniel-cohen
+merkeld | https://github.com/merkeld
DirectX | https://github.com/DirectX
frankzougc | https://github.com/frankzougc
idoall | https://github.com/idoall
diff --git a/README.md b/README.md
index 76807263..248993a5 100644
--- a/README.md
+++ b/README.md
@@ -138,34 +138,36 @@ Binaries will be published once the codebase reaches a stable condition.
|User|Contribution Amount|
|--|--|
-| [thrasher-](https://github.com/thrasher-) | 630 |
-| [shazbert](https://github.com/shazbert) | 186 |
-| [gloriousCode](https://github.com/gloriousCode) | 166 |
-| [xtda](https://github.com/xtda) | 38 |
+| [thrasher-](https://github.com/thrasher-) | 637 |
+| [shazbert](https://github.com/shazbert) | 188 |
+| [gloriousCode](https://github.com/gloriousCode) | 167 |
+| [xtda](https://github.com/xtda) | 42 |
+| [dependabot-preview[bot]](https://github.com/apps/dependabot-preview) | 23 |
| [ermalguni](https://github.com/ermalguni) | 14 |
-| [dependabot-preview[bot]](https://github.com/apps/dependabot-preview) | 12 |
| [vadimzhukck](https://github.com/vadimzhukck) | 10 |
| [140am](https://github.com/140am) | 8 |
| [marcofranssen](https://github.com/marcofranssen) | 8 |
| [MadCozBadd](https://github.com/MadCozBadd) | 7 |
| [cranktakular](https://github.com/cranktakular) | 5 |
+| [woshidama323](https://github.com/woshidama323) | 3 |
+| [vazha](https://github.com/vazha) | 3 |
| [crackcomm](https://github.com/crackcomm) | 3 |
| [andreygrehov](https://github.com/andreygrehov) | 2 |
| [bretep](https://github.com/bretep) | 2 |
-| [woshidama323](https://github.com/woshidama323) | 2 |
-| [vazha](https://github.com/vazha) | 2 |
+| [Christian-Achilli](https://github.com/Christian-Achilli) | 2 |
| [gam-phon](https://github.com/gam-phon) | 2 |
| [cornelk](https://github.com/cornelk) | 2 |
| [if1live](https://github.com/if1live) | 2 |
| [lozdog245](https://github.com/lozdog245) | 2 |
| [soxipy](https://github.com/soxipy) | 2 |
| [herenow](https://github.com/herenow) | 2 |
+| [azhang](https://github.com/azhang) | 1 |
| [blombard](https://github.com/blombard) | 1 |
-| [Christian-Achilli](https://github.com/Christian-Achilli) | 1 |
| [CodeLingoBot](https://github.com/CodeLingoBot) | 1 |
| [CodeLingoTeam](https://github.com/CodeLingoTeam) | 1 |
| [Daanikus](https://github.com/Daanikus) | 1 |
| [daniel-cohen](https://github.com/daniel-cohen) | 1 |
+| [merkeld](https://github.com/merkeld) | 1 |
| [DirectX](https://github.com/DirectX) | 1 |
| [frankzougc](https://github.com/frankzougc) | 1 |
| [idoall](https://github.com/idoall) | 1 |
diff --git a/cmd/apichecker/README.md b/cmd/apichecker/README.md
new file mode 100644
index 00000000..72f6362b
--- /dev/null
+++ b/cmd/apichecker/README.md
@@ -0,0 +1,132 @@
+# GoCryptoTrader package Apichecker
+
+
+
+
+[](https://travis-ci.org/thrasher-corp/gocryptotrader)
+[](https://github.com/thrasher-corp/gocryptotrader/blob/master/LICENSE)
+[](https://godoc.org/github.com/thrasher-corp/gocryptotrader/cmd/apichecker)
+[](http://codecov.io/github/thrasher-corp/gocryptotrader?branch=master)
+[](https://goreportcard.com/report/github.com/thrasher-corp/gocryptotrader)
+
+
+This apichecker package is part of the GoCryptoTrader codebase.
+
+## This is still in active development
+
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
+
+## Current Features for apichecker
+
++ Checks for API updates
++ Can automatically update Trello checklist for the updates required
++ Supports trello integration
+
+#### This tool tracks changes in exchange API documentation
+#### Keeps track of all the updates using the GoCryptoTrader trello board
+
+Be aware, this tool will:
+- Automatically update the live trello board if API keys and trello information are provided.
+- Automatically update the main json updates file, however a backup of the copy before the updates will be stored.
+
+## Usage
+
++ To run a real check for updates, parse Trello API info as flags or add them to the updates.json file and use the following command from apichecker folder in GCT:
+
+###### Linux/OSX
+GoCryptoTrader is built using [Go Modules](https://github.com/golang/go/wiki/Modules) and requires Go 1.11 or above
+Using Go Modules you now clone this repository **outside** your GOPATH
+
+```bash
+git clone https://github.com/thrasher-corp/gocryptotrader.git
+cd gocryptotrader/cmd/apichecker
+go build
+./apichecker
+```
+
+###### Windows
+
+```bash
+git clone https://github.com/thrasher-corp/gocryptotrader.git
+cd gocryptotrader\cmd\apichecker
+go build && apichecker.exe
+```
+
++ Upon addition of a new exchange, to update Trello checklist and to add the exchange to updates.json the following would need to be done:
+
+###### HTML Scraping method:
+HTMLScrapingData is a struct which contains the necessary information to scrape data from the given path website. Not all the elements of HTMLScrapingData are necessary, its all dependant on site where information is being extracted from. Regexp is used to capture necessary bits of data using r.FindString() where r is the declared regular expression. If update dates data is available, DateFormat is used to convert the dates to a more standard format which can then be used for further comparisons of which update is most recent.
+```go
+func TestAdd(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h1",
+ Key: "id",
+ Val: "revision-history",
+ TokenDataEnd: "table",
+ TextTokenData: "td",
+ DateFormat: "2006/01/02",
+ RegExp: "^20(\\d){2}/(\\d){2}/(\\d){2}$",
+ CheckString: "2019/11/15",
+ Path: "https://docs.gemini.com/rest-api/#revision-history"}
+ err := Add("Gemini", htmlScrape, data.Path, data, true, &testConfigData)
+ if err != nil {
+ t.Error(err)
+ }
+}
+```
+
+###### Github SHA Check Method:
+```go
+func TestAdd(t *testing.T) {
+ t.Parallel()
+ data := GithubData{Repo: "LBank-exchange/lbank-official-api-docs"}
+ err := Add("Lbank", github, fmt.Sprintf(githubPath, data.Repo), data, false, &configData)
+ if err != nil {
+ t.Error(err)
+ }
+}
+```
+
+###### Add using flags:
+```bash
+apichecker.exe -add=true -key=id -val=revision-history -tokendata=h1 -tokendataend=table -texttokendata=td -dateformat=2006/01/02 -checktype="HTML String Check" -regexp="^20(\d){2}/(\d){2}/(\d){2}$" -path="https://docs.gemini.com/rest-api/#revision-history" -exchangename=Gemini
+```
+
++ If all the authentication variables for trello are set trello checklist will be automatically updated with the format of 'Exchange Name (integer of how many updates have been released since the exchange API was last worked on):
+
+- To acquire your trello key and access token please login into trello using the following link and follow the steps: https://trello.com/app-key
+
+- To acquire BoardID, ListID, CardID and ChecklistID inbuilt functions can be used such as trelloGetAllLists()
+
+- To create a new list, card, checklist, and to populate the the checklist --create flag can be used.
+
+- To create a new check within a checklist, an inbuilt function within apichecker can be used: trelloCreateNewCheck
+
+- For the first time running the application & to create a list, card and checklist use the following:
+```bash
+apichecker.exe --create -apikey="insertkeyhere" -apitoken="inserttokenhere" -boardname="insertboardnamehere"
+```
+
+
+### 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-corp/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:
+
+***bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc***
diff --git a/cmd/apichecker/apicheck.go b/cmd/apichecker/apicheck.go
new file mode 100644
index 00000000..0e983c19
--- /dev/null
+++ b/cmd/apichecker/apicheck.go
@@ -0,0 +1,1598 @@
+package main
+
+import (
+ "encoding/json"
+ "errors"
+ "flag"
+ "fmt"
+ "io/ioutil"
+ "net/http"
+ "net/url"
+ "os"
+ "regexp"
+ "strconv"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/thrasher-corp/gocryptotrader/common"
+ "github.com/thrasher-corp/gocryptotrader/common/crypto"
+ exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
+ "github.com/thrasher-corp/gocryptotrader/exchanges/request"
+ "github.com/thrasher-corp/gocryptotrader/log"
+ "golang.org/x/net/html"
+)
+
+const (
+ githubPath = "https://api.github.com/repos/%s/commits/master"
+ jsonFile = "updates.json"
+ testJSONFile = "testupdates.json"
+ backupFile = "backup.json"
+ github = "GitHub Sha Check"
+ htmlScrape = "HTML String Check"
+ pathOkCoin = "https://www.okcoin.com/docs/en/#change-change"
+ pathOkex = "https://www.okex.com/docs/en/#change-change"
+ pathBTSE = "https://www.btse.com/apiexplorer/spot/#btse-spot-api"
+ pathBitfinex = "https://docs.bitfinex.com/docs/changelog"
+ pathBitmex = "https://www.bitmex.com/static/md/en-US/apiChangelog"
+ pathANX = "https://anxv3.docs.apiary.io/"
+ pathPoloniex = "https://docs.poloniex.com/#changelog"
+ pathIbBit = "https://api.itbit.com/docs"
+ pathBTCMarkets = "https://api.btcmarkets.net/openapi/info/index.yaml"
+ pathEXMO = "https://exmo.com/en/api/"
+ pathBitstamp = "https://www.bitstamp.net/api/"
+ pathHitBTC = "https://api.hitbtc.com/"
+ pathBitflyer = "https://lightning.bitflyer.com/docs?lang=en"
+ pathLakeBTC = "https://www.lakebtc.com/s/api_v2"
+ pathKraken = "https://www.kraken.com/features/api"
+ pathAlphaPoint = "https://alphapoint.github.io/slate/#introduction"
+ pathYobit = "https://www.yobit.net/en/api/"
+ pathLocalBitcoins = "https://localbitcoins.com/api-docs/"
+ pathGetAllLists = "https://api.trello.com/1/boards/%s/lists?cards=none&card_fields=all&filter=open&fields=all&key=%s&token=%s"
+ pathNewCard = "https://api.trello.com/1/cards?idList=%s&name=%s&key=%s&token=%s"
+ pathChecklists = "https://api.trello.com/1/checklists/%s/checkItems?%s&key=%s&token=%s"
+ pathChecklistItems = "https://api.trello.com/1/checklists/%s?fields=name&cards=all&card_fields=name&key=%s&token=%s"
+ pathUpdateItems = "https://api.trello.com/1/cards/%s/checkItem/%s?%s&key=%s&token=%s"
+ pathCheckBoardID = "https://api.trello.com/1/members/me/boards?key=%s&token=%s"
+ pathNewChecklist = "https://api.trello.com/1/checklists?idCard=%s&name=%s&key=%s&token=%s"
+ pathNewList = "https://api.trello.com/1/lists?name=%s&idBoard=%s&key=%s&token=%s"
+ pathGetCards = "https://api.trello.com/1/lists/%s/cards?key=%s&token=%s"
+ pathGetChecklists = "https://api.trello.com/1/cards/%s/checklists?&key=%s&token=%s"
+ pathDeleteCheckitems = "https://api.trello.com/1/checklists/%s/checkItems/%s?key=%s&token=%s"
+ complete = "complete"
+ incomplete = "incomplete"
+ createList = "UpdatesList"
+ createCard = "UpdatesCard"
+ createChecklist = "UpdatesChecklist"
+ btcMarkets = "BTC Markets"
+ okcoin = "OkCoin International"
+)
+
+var (
+ verbose, add, create, testMode bool
+ apiKey, apiToken, trelloBoardID, trelloBoardName, trelloListID, trelloChecklistID, trelloCardID, exchangeName, checkType, tokenData, key, val, tokenDataEnd, textTokenData, dateFormat, regExp, checkString, path string
+ configData, testConfigData, usageData Config
+)
+
+func main() {
+ flag.StringVar(&apiKey, "apikey", "", "sets the API key for Trello board interaction")
+ flag.StringVar(&apiToken, "apitoken", "", "sets the API token for Trello board interaction")
+ flag.StringVar(&trelloChecklistID, "checklistid", "", "sets the checklist ID for Trello board interaction")
+ flag.StringVar(&trelloCardID, "cardid", "", "sets the card ID for Trello board interaction")
+ flag.StringVar(&trelloListID, "listid", "", "sets the list ID for Trello board interaction")
+ flag.StringVar(&trelloBoardID, "boardid", "", "sets the board ID for Trello board interaction")
+ flag.StringVar(&trelloBoardName, "boardname", "", "sets the board name for Trello board interaction")
+ flag.StringVar(&exchangeName, "exchangename", "", "sets the exchangeName for the new exchange")
+ flag.StringVar(&checkType, "checktype", "", "sets the checkType for the new exchange")
+ flag.StringVar(&tokenData, "tokendata", "", "sets the tokenData for adding a new exchange")
+ flag.StringVar(&key, "key", "", "sets the key for adding a new exchange")
+ flag.StringVar(&val, "val", "", "sets the val for adding a new exchange")
+ flag.StringVar(&tokenDataEnd, "tokendataend", "", "sets the tokenDataEnd for adding a new exchange")
+ flag.StringVar(&textTokenData, "texttokendata", "", "sets the textTokenData for adding a new exchange")
+ flag.StringVar(®Exp, "regexp", "", "sets the regExp for adding a new exchange")
+ flag.StringVar(&dateFormat, "dateformat", "", "sets the dateFormat for adding a new exchange")
+ flag.StringVar(&path, "path", "", "sets the path for adding a new exchange")
+ flag.BoolVar(&add, "add", false, "used as a trigger to add a new exchange from command line")
+ flag.BoolVar(&verbose, "verbose", false, "increases logging verbosity for API Update Checker")
+ flag.BoolVar(&create, "create", false, "specifies whether to automatically create trello list, card and checklist in a given board")
+ flag.Parse()
+ var err error
+ c := log.GenDefaultSettings()
+ log.GlobalLogConfig = &c
+ log.SetupGlobalLogger()
+ configData, err = readFileData(jsonFile)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ testConfigData, err = readFileData(testJSONFile)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ usageData = testConfigData
+ if canUpdateTrello() || (create && areAPIKeysSet()) {
+ usageData = configData
+ }
+ if add {
+ switch checkType {
+ case github:
+ var data GithubData
+ data.Repo = path
+ err = addExch(exchangeName, checkType, data, false)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ case htmlScrape:
+ var data HTMLScrapingData
+ data.TokenData = tokenData
+ data.Key = key
+ data.Val = val
+ data.TokenDataEnd = tokenDataEnd
+ data.TextTokenData = textTokenData
+ data.DateFormat = dateFormat
+ data.RegExp = regExp
+ data.Path = path
+ err = addExch(exchangeName, checkType, data, false)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ }
+ }
+ var a string
+ if canUpdateTrello() || create {
+ setAuthVars()
+ if trelloBoardName != "" {
+ a, err = trelloGetBoardID()
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ trelloBoardID = a
+ }
+ if create {
+ err = createAndSet()
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ }
+ err = updateFile(backupFile)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ err = checkUpdates(jsonFile)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ } else {
+ log.Warnln(log.Global, "This is a test update since API keys are not set.")
+ err := checkUpdates(testJSONFile)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ log.Infoln(log.Global, "API update check completed successfully")
+ }
+}
+
+// createAndSet creates and sets the necessary trello board items and sets the authenticated variables accordingly
+func createAndSet() error {
+ var err error
+ err = trelloCreateNewList()
+ if err != nil {
+ return err
+ }
+ err = trelloCreateNewCard()
+ if err != nil {
+ return err
+ }
+ err = trelloCreateNewChecklist()
+ if err != nil {
+ return err
+ }
+ setAuthVars()
+ return nil
+}
+
+// setAuthVars checks if the cmdline vars are set and sets them onto config file and vice versa
+func setAuthVars() {
+ if apiKey == "" {
+ apiKey = configData.Key
+ usageData.Key = configData.Key
+ } else {
+ configData.Key = apiKey
+ usageData.Key = apiKey
+ }
+ if apiToken == "" {
+ apiToken = configData.Token
+ usageData.Token = configData.Token
+ } else {
+ configData.Token = apiToken
+ usageData.Token = apiToken
+ }
+ if trelloCardID == "" {
+ trelloCardID = configData.CardID
+ usageData.CardID = configData.CardID
+ } else {
+ configData.CardID = trelloCardID
+ usageData.CardID = trelloCardID
+ }
+ if trelloChecklistID == "" {
+ trelloChecklistID = configData.ChecklistID
+ usageData.ChecklistID = configData.ChecklistID
+ } else {
+ configData.ChecklistID = trelloChecklistID
+ usageData.ChecklistID = trelloChecklistID
+ }
+ if trelloListID == "" {
+ trelloListID = configData.ListID
+ usageData.ListID = configData.ListID
+ } else {
+ configData.ListID = trelloListID
+ usageData.ListID = trelloListID
+ }
+ if trelloBoardID == "" {
+ trelloBoardID = configData.BoardID
+ usageData.BoardID = configData.BoardID
+ } else {
+ configData.BoardID = trelloBoardID
+ usageData.BoardID = trelloBoardID
+ }
+}
+
+// writeAuthVars writes the new authentication variables to the updates.json file
+func writeAuthVars(testMode bool) error {
+ setAuthVars()
+ if testMode {
+ return updateFile(testJSONFile)
+ }
+ return updateFile(jsonFile)
+}
+
+// canUpdateTrello checks if all the data necessary for updating trello is available
+func canUpdateTrello() bool {
+ return areAPIKeysSet() && isTrelloBoardDataSet()
+}
+
+// areAPIKeysSet checks if api keys and tokens are set
+func areAPIKeysSet() bool {
+ return (apiKey != "" && apiToken != "") || (configData.Key != "" && configData.Token != "")
+}
+
+// isTrelloBoardDataSet checks if data required to update trello board is set
+func isTrelloBoardDataSet() bool {
+ if (trelloBoardID != "" && trelloListID != "" && trelloChecklistID != "" && trelloCardID != "") ||
+ (configData.CardID != "" && configData.ChecklistID != "" && configData.BoardID != "" && configData.ListID != "") {
+ return true
+ }
+ return false
+}
+
+// getSha gets the sha of the latest commit
+func getSha(repoPath string) (ShaResponse, error) {
+ var resp ShaResponse
+ getPath := fmt.Sprintf(githubPath, repoPath)
+ if verbose {
+ log.Debugf(log.Global, "Getting SHA of this path: %v\n", getPath)
+ }
+ return resp, sendGetReq(getPath, &resp)
+}
+
+// checkExistingExchanges checks if the given exchange exists
+func checkExistingExchanges(exchName string) bool {
+ for x := range usageData.Exchanges {
+ if usageData.Exchanges[x].Name == exchName {
+ return true
+ }
+ }
+ return false
+}
+
+// checkMissingExchanges checks if any supported exchanges are missing api checker functionality
+func checkMissingExchanges() []string {
+ var tempArray []string
+ for x := range usageData.Exchanges {
+ tempArray = append(tempArray, usageData.Exchanges[x].Name)
+ }
+ supportedExchs := exchange.Exchanges
+ for z := 0; z < len(supportedExchs); {
+ if common.StringDataContainsInsensitive(tempArray, supportedExchs[z]) {
+ supportedExchs = append(supportedExchs[:z], supportedExchs[z+1:]...)
+ continue
+ }
+ z++
+ }
+ return supportedExchs
+}
+
+// readFileData reads the file data from the given json file
+func readFileData(fileName string) (Config, error) {
+ var c Config
+ file, err := os.Open(fileName)
+ if err != nil {
+ return c, err
+ }
+ defer file.Close()
+ byteValue, err := ioutil.ReadAll(file)
+ if err != nil {
+ return c, err
+ }
+ err = json.Unmarshal(byteValue, &c)
+ if err != nil {
+ return c, err
+ }
+ return c, nil
+}
+
+// checkUpdates checks updates.json for all the existing exchanges
+func checkUpdates(fileName string) error {
+ var resp []string
+ errMap := make(map[string]error)
+ var wg sync.WaitGroup
+ var m sync.Mutex
+ allExchangeData := usageData.Exchanges
+ for x := range allExchangeData {
+ if allExchangeData[x].Disabled {
+ continue
+ }
+ wg.Add(1)
+ go func(e ExchangeInfo) {
+ defer wg.Done()
+ switch e.CheckType {
+ case github:
+ m.Lock()
+ repoPath := e.Data.GitHubData.Repo
+ m.Unlock()
+ sha, err := getSha(repoPath)
+ m.Lock()
+ if err != nil {
+ errMap[e.Name] = err
+ m.Unlock()
+ return
+ }
+ if sha.ShaResp == "" {
+ errMap[e.Name] = errors.New("invalid sha")
+ m.Unlock()
+ return
+ }
+ if sha.ShaResp != e.Data.GitHubData.Sha {
+ resp = append(resp, e.Name)
+ e.Data.GitHubData.Sha = sha.ShaResp
+ }
+ m.Unlock()
+ case htmlScrape:
+ checkStr, err := checkChangeLog(e.Data.HTMLData)
+ m.Lock()
+ if err != nil {
+ errMap[e.Name] = err
+ m.Unlock()
+ return
+ }
+ if checkStr != e.Data.HTMLData.CheckString {
+ resp = append(resp, e.Name)
+ e.Data.HTMLData.CheckString = checkStr
+ }
+ m.Unlock()
+ }
+ }(allExchangeData[x])
+ }
+ wg.Wait()
+ file, err := json.MarshalIndent(&usageData, "", " ")
+ if err != nil {
+ return err
+ }
+ var check bool
+ if areAPIKeysSet() {
+ check, err = trelloCheckBoardID()
+ if err != nil {
+ return err
+ }
+ if !check {
+ return errors.New("incorrect boardID or api info")
+ }
+ var a ChecklistItemData
+ for y := range resp {
+ a, err = trelloGetChecklistItems()
+ if err != nil {
+ return err
+ }
+ var contains bool
+ for z := range a.CheckItems {
+ if strings.Contains(a.CheckItems[z].Name, resp[y]) {
+ err = trelloUpdateCheckItem(a.CheckItems[z].ID, a.CheckItems[z].Name, a.CheckItems[z].State)
+ if err != nil {
+ return err
+ }
+ contains = true
+ }
+ }
+ if !contains {
+ err = trelloCreateNewCheck(resp[y])
+ if err != nil {
+ return err
+ }
+ }
+ }
+ a, err = trelloGetChecklistItems()
+ if err != nil {
+ return err
+ }
+ for l := range a.CheckItems {
+ if a.CheckItems[l].State == complete {
+ err = trelloDeleteCheckItem(a.CheckItems[l].ID)
+ if err != nil {
+ return err
+ }
+ }
+ }
+ }
+ if !areAPIKeysSet() {
+ fileName = testJSONFile
+ if verbose {
+ log.Warnln(log.Global, "Updating test file; main file & trello will not be automatically updated since API key & token are not set")
+ }
+ }
+ log.Warnf(log.Global, "The following exchanges need an update: %v\n", resp)
+ for k := range errMap {
+ log.Warnf(log.Global, "Error: %v\n", errMap[k])
+ }
+ unsup := checkMissingExchanges()
+ log.Warnf(log.Global, "The following exchanges are not supported by apichecker: %v\n", unsup)
+ log.Debugf(log.Global, "Saving the updates to the following file: %s\n", fileName)
+ return ioutil.WriteFile(fileName, file, 0770)
+}
+
+// checkChangeLog checks the exchanges which support changelog updates.json
+func checkChangeLog(htmlData *HTMLScrapingData) (string, error) {
+ var dataStrings []string
+ var err error
+ switch htmlData.Path {
+ case pathBTSE:
+ dataStrings, err = htmlScrapeBTSE(htmlData)
+ case pathBitfinex:
+ dataStrings, err = htmlScrapeBitfinex(htmlData)
+ case pathBitmex:
+ dataStrings, err = htmlScrapeBitmex(htmlData)
+ case pathANX:
+ dataStrings, err = htmlScrapeANX(htmlData)
+ case pathPoloniex:
+ dataStrings, err = htmlScrapePoloniex(htmlData)
+ case pathIbBit:
+ dataStrings, err = htmlScrapeItBit(htmlData)
+ case pathBTCMarkets:
+ dataStrings, err = htmlScrapeBTCMarkets(htmlData)
+ case pathEXMO:
+ dataStrings, err = htmlScrapeExmo(htmlData)
+ case pathBitstamp:
+ dataStrings, err = htmlScrapeBitstamp(htmlData)
+ case pathHitBTC:
+ dataStrings, err = htmlScrapeHitBTC(htmlData)
+ case pathBitflyer:
+ dataStrings, err = htmlScrapeBitflyer(htmlData)
+ case pathLakeBTC:
+ dataStrings, err = htmlScrapeLakeBTC(htmlData)
+ case pathKraken:
+ dataStrings, err = htmlScrapeKraken(htmlData)
+ case pathAlphaPoint:
+ dataStrings, err = htmlScrapeAlphaPoint(htmlData)
+ case pathYobit:
+ dataStrings, err = htmlScrapeYobit(htmlData)
+ case pathLocalBitcoins:
+ dataStrings, err = htmlScrapeLocalBitcoins(htmlData)
+ case pathOkCoin, pathOkex:
+ dataStrings, err = htmlScrapeOk(htmlData)
+ default:
+ dataStrings, err = htmlScrapeDefault(htmlData)
+ }
+ if err != nil {
+ return "", err
+ }
+ switch {
+ case len(dataStrings) == 1:
+ return dataStrings[0], nil
+ case len(dataStrings) > 1:
+ x, err := time.Parse(htmlData.DateFormat, dataStrings[0])
+ if err != nil {
+ return "", err
+ }
+ y, err := time.Parse(htmlData.DateFormat, dataStrings[len(dataStrings)-1])
+ if err != nil {
+ return "", err
+ }
+ z := y.Sub(x)
+ switch {
+ case z > 0:
+ return dataStrings[len(dataStrings)-1], nil
+ case z < 0:
+ return dataStrings[0], nil
+ default:
+ return "", errors.New("two or more updates were done on the same day, please check manually")
+ }
+ }
+ return "", fmt.Errorf("no response found for the following path: %s", htmlData.Path)
+}
+
+// addExch appends exchange data to updates.json for future api checks
+func addExch(exchName, checkType string, data interface{}, isUpdate bool) error {
+ var file []byte
+ if !isUpdate {
+ if checkExistingExchanges(exchName) {
+ log.Debugf(log.Global, "%v exchange already exists\n", exchName)
+ return nil
+ }
+ exchangeData, err := fillData(exchName, checkType, data)
+ if err != nil {
+ return err
+ }
+ usageData.Exchanges = append(usageData.Exchanges, exchangeData)
+ file, err = json.MarshalIndent(&usageData, "", " ")
+ if err != nil {
+ return err
+ }
+ } else {
+ info, err := fillData(exchName, checkType, data)
+ if err != nil {
+ return err
+ }
+ allExchData := update(exchName, usageData.Exchanges, info)
+ usageData.Exchanges = allExchData
+ file, err = json.MarshalIndent(&usageData, "", " ")
+ if err != nil {
+ return err
+ }
+ }
+ if canUpdateTrello() {
+ if !isUpdate {
+ err := trelloCreateNewCheck(fmt.Sprintf("%s 1", exchName))
+ if err != nil {
+ return err
+ }
+ }
+ return ioutil.WriteFile(jsonFile, file, 0770)
+ }
+ return ioutil.WriteFile(testJSONFile, file, 0770)
+}
+
+// fillData fills exchange data based on the given checkType
+func fillData(exchName, checkType string, data interface{}) (ExchangeInfo, error) {
+ switch checkType {
+ case github:
+ tempData := data.(GithubData)
+ tempSha, err := getSha(path)
+ if err != nil {
+ return ExchangeInfo{}, err
+ }
+ tempData.Sha = tempSha.ShaResp
+ return ExchangeInfo{
+ Name: exchName,
+ CheckType: checkType,
+ Data: &CheckData{
+ GitHubData: &tempData,
+ },
+ }, nil
+ case htmlScrape:
+ tempData := data.(HTMLScrapingData)
+ checkStr, err := checkChangeLog(&tempData)
+ if err != nil {
+ return ExchangeInfo{}, err
+ }
+ return ExchangeInfo{
+ Name: exchName,
+ CheckType: checkType,
+ Data: &CheckData{
+ HTMLData: &HTMLScrapingData{
+ CheckString: checkStr,
+ DateFormat: tempData.DateFormat,
+ Key: tempData.Key,
+ RegExp: tempData.RegExp,
+ TextTokenData: tempData.TextTokenData,
+ TokenData: tempData.TokenData,
+ TokenDataEnd: tempData.TokenDataEnd,
+ Val: tempData.Val,
+ Path: tempData.Path},
+ },
+ }, nil
+ default:
+ return ExchangeInfo{}, errors.New("invalid checkType")
+ }
+}
+
+// htmlScrapeDefault gets check string data for the default cases
+func htmlScrapeDefault(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for _, a := range token.Attr {
+ if a.Key == htmlData.Key && a.Val == htmlData.Val {
+ loop2:
+ for {
+ nextToken := tokenizer.Next()
+ switch nextToken {
+ case html.EndTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TokenDataEnd {
+ break loop2
+ }
+ case html.StartTagToken:
+ newtok := tokenizer.Token()
+ if newtok.Data == htmlData.TextTokenData {
+ inner := tokenizer.Next()
+ if inner == html.TextToken {
+ tempStr := string(tokenizer.Text())
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ result := r.MatchString(tempStr)
+ if result {
+ appendStr := r.FindString(tempStr)
+ resp = append(resp, appendStr)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeBTSE gets the check string for BTSE exchange
+func htmlScrapeBTSE(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for _, z := range token.Attr {
+ if z.Key == htmlData.Key && z.Val == htmlData.Val {
+ inner := tokenizer.Next()
+ if inner == html.TextToken {
+ resp = append(resp, string(tokenizer.Text()))
+ }
+ }
+ }
+ }
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeBitfinex gets the check string for Bitfinex exchange
+func htmlScrapeBitfinex(htmlData *HTMLScrapingData) ([]string, error) {
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return nil, err
+ }
+ a, err := ioutil.ReadAll(temp.Body)
+ if err != nil {
+ return nil, err
+ }
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return nil, err
+ }
+ str := r.FindAllString(string(a), -1)
+ var resp []string
+ for x := range str {
+ tempStr := strings.Replace(str[x], "section-v-", "", 1)
+ var repeat bool
+ for y := range resp {
+ if tempStr == resp[y] {
+ repeat = true
+ break
+ }
+ }
+ if !repeat {
+ resp = append(resp, tempStr)
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeBitmex gets the check string for Bitmex exchange
+func htmlScrapeBitmex(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for _, x := range token.Attr {
+ if x.Key != htmlData.Key {
+ continue
+ }
+ tempStr := x.Val
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ result := r.MatchString(tempStr)
+ if result {
+ appendStr := r.FindString(tempStr)
+ resp = append(resp, appendStr)
+ }
+ }
+ }
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeHitBTC gets the check string for HitBTC Exchange
+func htmlScrapeHitBTC(htmlData *HTMLScrapingData) ([]string, error) {
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return nil, err
+ }
+ a, err := ioutil.ReadAll(temp.Body)
+ if err != nil {
+ return nil, err
+ }
+ aBody := string(a)
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return nil, err
+ }
+ str := r.FindAllString(aBody, -1)
+ var resp []string
+ for x := range str {
+ tempStr := strings.Replace(str[x], "section-v-", "", 1)
+ var repeat bool
+ for y := range resp {
+ if tempStr == resp[y] {
+ repeat = true
+ break
+ }
+ }
+ if !repeat {
+ resp = append(resp, tempStr)
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeBTCMarkets gets the check string for BTCMarkets exchange
+func htmlScrapeBTCMarkets(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tempData, err := ioutil.ReadAll(temp.Body)
+ if err != nil {
+ return resp, err
+ }
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ result := r.FindString(string(tempData))
+ resp = append(resp, result)
+ return resp, nil
+}
+
+// htmlScrapeBitflyer gets the check string for BTCMarkets exchange
+func htmlScrapeBitflyer(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ var tempArray []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for {
+ nextToken := tokenizer.Next()
+ switch nextToken {
+ case html.EndTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TokenDataEnd {
+ break loop
+ }
+ case html.StartTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TextTokenData {
+ inner := tokenizer.Next()
+ if inner == html.TextToken {
+ tempStr := string(tokenizer.Text())
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ result := r.MatchString(tempStr)
+ if result {
+ appendStr := r.FindString(tempStr)
+ tempArray = append(tempArray, appendStr)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ resp = append(resp, tempArray[1])
+ return resp, nil
+}
+
+// htmlScrapeOk gets the check string for Okex
+func htmlScrapeOk(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for _, a := range token.Attr {
+ if a.Key == htmlData.Key && a.Val == htmlData.Val {
+ loop2:
+ for {
+ nextToken := tokenizer.Next()
+ switch nextToken {
+ case html.StartTagToken:
+ f := tokenizer.Token()
+ for _, tkz := range f.Attr {
+ if tkz.Key == htmlData.Key {
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ result := r.MatchString(tkz.Val)
+ if result {
+ appendStr := strings.Replace(tkz.Val, htmlData.TokenDataEnd, "", 1)
+ resp = append(resp, appendStr)
+ }
+ }
+ }
+ case html.EndTagToken:
+ tk := tokenizer.Token()
+ if tk.Data == "ul" {
+ break loop2
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ resp = resp[:1]
+ return resp, nil
+}
+
+// htmlScrapeANX gets the check string for BTCMarkets exchange
+func htmlScrapeANX(htmlData *HTMLScrapingData) ([]string, error) {
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return nil, err
+ }
+ a, err := ioutil.ReadAll(temp.Body)
+ if err != nil {
+ return nil, err
+ }
+ aBody := string(a)
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return nil, err
+ }
+ str := r.FindAllString(aBody, -1)
+ var resp []string
+ for x := range str {
+ tempStr := strings.Replace(str[x], "section-v-", "", 1)
+ var repeat bool
+ for y := range resp {
+ if tempStr == resp[y] {
+ repeat = true
+ break
+ }
+ }
+ if !repeat {
+ resp = append(resp, tempStr)
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeExmo gets the check string for Exmo Exchange
+func htmlScrapeExmo(htmlData *HTMLScrapingData) ([]string, error) {
+ temp, err := http.NewRequest(http.MethodGet, htmlData.Path, nil)
+ if err != nil {
+ return nil, err
+ }
+ temp.Header.Set("User-Agent", "GCT")
+ httpClient := &http.Client{}
+ httpResp, err := httpClient.Do(temp)
+ if err != nil {
+ return nil, err
+ }
+ a, err := ioutil.ReadAll(httpResp.Body)
+ if err != nil {
+ return nil, err
+ }
+ aBody := string(a)
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return nil, err
+ }
+ resp := r.FindAllString(aBody, -1)
+ return resp, nil
+}
+
+// htmlScrapePoloniex gets the check string for Poloniex Exchange
+func htmlScrapePoloniex(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for _, z := range token.Attr {
+ if z.Key == htmlData.Key && z.Val == htmlData.Val {
+ loop2:
+ for {
+ nextToken := tokenizer.Next()
+ switch nextToken {
+ case html.EndTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TokenDataEnd {
+ break loop2
+ }
+ case html.StartTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TextTokenData {
+ newToken := tokenizer.Next()
+ if newToken == html.TextToken {
+ tempStr := string(tokenizer.Text())
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ result := r.FindString(tempStr)
+ resp = append(resp, result)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeItBit gets the check string for ItBit Exchange
+func htmlScrapeItBit(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for _, z := range token.Attr {
+ if z.Key == htmlData.Key {
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ if r.MatchString(z.Val) {
+ resp = append(resp, z.Val)
+ }
+ }
+ }
+ }
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeLakeBTC gets the check string for LakeBTC Exchange
+func htmlScrapeLakeBTC(htmlData *HTMLScrapingData) ([]string, error) {
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return nil, err
+ }
+ a, err := ioutil.ReadAll(temp.Body)
+ if err != nil {
+ return nil, err
+ }
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return nil, err
+ }
+ str := r.FindString(string(a))
+ sha := crypto.GetSHA256([]byte(str))
+ var resp []string
+ resp = append(resp, crypto.HexEncodeToString(sha))
+ return resp, nil
+}
+
+// htmlScrapeBitstamp gets the check string for Bitstamp Exchange
+func htmlScrapeBitstamp(htmlData *HTMLScrapingData) ([]string, error) {
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return nil, err
+ }
+ a, err := ioutil.ReadAll(temp.Body)
+ if err != nil {
+ return nil, err
+ }
+ aBody := string(a)
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return nil, err
+ }
+ resp := r.FindAllString(aBody, -1)
+ return resp, nil
+}
+
+// htmlScrapeKraken gets the check string for Kraken Exchange
+func htmlScrapeKraken(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ inner := tokenizer.Next()
+ if inner == html.TextToken {
+ if string(tokenizer.Text()) == "Get account balance" {
+ loop2:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.EndTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TokenDataEnd {
+ break loop2
+ }
+ case html.StartTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TextTokenData {
+ inside := tokenizer.Next()
+ if inside == html.TextToken {
+ tempStr := string(tokenizer.Text())
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ result := r.MatchString(tempStr)
+ if result {
+ resp = append(resp, tempStr)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeAlphaPoint gets the check string for Kraken Exchange
+func htmlScrapeAlphaPoint(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for _, x := range token.Attr {
+ if x.Key == htmlData.Key && x.Val == htmlData.Val {
+ loop2:
+ for {
+ inner := tokenizer.Next()
+ switch inner {
+ case html.EndTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TokenDataEnd {
+ break loop2
+ }
+ case html.StartTagToken:
+ t := tokenizer.Token()
+ if t.Data == htmlData.TextTokenData {
+ for _, y := range t.Attr {
+ if y.Key == htmlData.Key {
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return resp, err
+ }
+ result := r.MatchString(y.Val)
+ if result {
+ resp = append(resp, y.Val)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeYobit gets the check string for Yobit Exchange
+func htmlScrapeYobit(htmlData *HTMLScrapingData) ([]string, error) {
+ var resp []string
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return resp, err
+ }
+ tokenizer := html.NewTokenizer(temp.Body)
+ var case1, case2, case3 bool
+loop:
+ for {
+ next := tokenizer.Next()
+ switch next {
+ case html.ErrorToken:
+ break loop
+ case html.StartTagToken:
+ token := tokenizer.Token()
+ if token.Data == htmlData.TokenData {
+ for _, x := range token.Attr {
+ if x.Key == htmlData.Key {
+ switch x.Val {
+ case "n4":
+ inner := tokenizer.Next()
+ if inner == html.TextToken {
+ if string(tokenizer.Text()) == "v2" {
+ case1 = true
+ }
+ }
+ case "n5":
+ inner := tokenizer.Next()
+ if inner == html.TextToken {
+ tempStr := string(tokenizer.Text())
+ if tempStr == "v3" {
+ case2 = true
+ resp = append(resp, tempStr)
+ }
+ }
+ case "n6":
+ inner := tokenizer.Next()
+ if inner == html.TextToken {
+ tempStr := string(tokenizer.Text())
+ if tempStr != "v4" {
+ case3 = true
+ }
+ if case1 && case2 && case3 {
+ return resp, nil
+ }
+ resp = append(resp, tempStr)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return resp, nil
+}
+
+// htmlScrapeLocalBitcoins gets the check string for Yobit Exchange
+func htmlScrapeLocalBitcoins(htmlData *HTMLScrapingData) ([]string, error) {
+ temp, err := http.Get(htmlData.Path)
+ if err != nil {
+ return nil, err
+ }
+ a, err := ioutil.ReadAll(temp.Body)
+ if err != nil {
+ return nil, err
+ }
+ r, err := regexp.Compile(htmlData.RegExp)
+ if err != nil {
+ return nil, err
+ }
+ str := r.FindString(string(a))
+ sha := crypto.GetSHA256([]byte(str))
+ var resp []string
+ resp = append(resp, crypto.HexEncodeToString(sha))
+ return resp, nil
+}
+
+// trelloCreateNewCheck creates a new checklist item within a given checklist from trello
+func trelloCreateNewCheck(newCheckName string) error {
+ newName, err := nameStateChanges(newCheckName, "")
+ if err != nil {
+ return err
+ }
+ var resp interface{}
+ params := url.Values{}
+ params.Set("name", newName)
+ return sendAuthReq(http.MethodPost,
+ fmt.Sprintf(pathChecklists, trelloChecklistID, params.Encode(), apiKey, apiToken),
+ &resp)
+}
+
+// trelloCheckBoardID gets board id of the trello boards for a user which can be used for checking if a given board exists
+func trelloCheckBoardID() (bool, error) {
+ var data []MembersData
+ err := sendAuthReq(http.MethodGet,
+ fmt.Sprintf(pathCheckBoardID, apiKey, apiToken),
+ &data)
+ if err != nil {
+ return false, err
+ }
+ if data == nil {
+ return false, errors.New("no trello boards available for the given apikey and token")
+ }
+ for x := range data {
+ if (trelloBoardID == data[x].ShortID) || (trelloBoardID == data[x].ID) || (trelloBoardName == data[x].Name) {
+ return true, nil
+ }
+ }
+ return false, nil
+}
+
+// trelloGetChecklistItems get info on all the items on a given checklist from trello
+func trelloGetChecklistItems() (ChecklistItemData, error) {
+ var resp ChecklistItemData
+ path := fmt.Sprintf(pathChecklistItems, trelloChecklistID, apiKey, apiToken)
+ return resp, sendGetReq(path, &resp)
+}
+
+// nameStateChanges returns the appropriate update name & state for trello
+func nameStateChanges(currentName, currentState string) (string, error) {
+ name := currentName
+ exists := false
+ var num int64
+ var err error
+ switch currentName {
+ case btcMarkets, okcoin:
+ if strings.Count(currentName, " ") == 2 {
+ exists = true
+ }
+ name = fmt.Sprintf("%s %s", strings.Split(currentName, " ")[0], strings.Split(currentName, " ")[1])
+ if !exists {
+ return fmt.Sprintf("%s 1", name), nil
+ }
+ num, err = strconv.ParseInt(strings.Split(currentName, " ")[2], 10, 64)
+ if err != nil {
+ return "", err
+ }
+ default:
+ if strings.Contains(currentName, " ") {
+ exists = true
+ name = strings.Split(currentName, " ")[0]
+ if !exists {
+ return fmt.Sprintf("%s 1", name), nil
+ }
+ num, err = strconv.ParseInt(strings.Split(currentName, " ")[1], 10, 64)
+ if err != nil {
+ return "", err
+ }
+ }
+ if !exists {
+ return fmt.Sprintf("%s 1", name), nil
+ }
+ }
+
+ newNum := num
+ if currentState == complete {
+ newNum = 1
+ } else {
+ newNum++
+ }
+ return fmt.Sprintf("%s %d", name, newNum), nil
+}
+
+// trelloUpdateCheckItem updates a check item for trello
+func trelloUpdateCheckItem(checkItemID, name, state string) error {
+ var resp interface{}
+ params := url.Values{}
+ newName, err := nameStateChanges(name, state)
+ if err != nil {
+ return err
+ }
+ params.Set("name", newName)
+ params.Set("state", incomplete)
+ path := fmt.Sprintf(pathUpdateItems, trelloCardID, checkItemID, params.Encode(), apiKey, apiToken)
+ err = sendAuthReq(http.MethodPut, path, &resp)
+ return err
+}
+
+// update updates the exchange data
+func update(currentName string, info []ExchangeInfo, updatedInfo ExchangeInfo) []ExchangeInfo {
+ for x := range info {
+ if info[x].Name == currentName {
+ if info[x].CheckType == updatedInfo.CheckType {
+ info[x].Data.GitHubData = updatedInfo.Data.GitHubData
+ info[x].Data.HTMLData = updatedInfo.Data.HTMLData
+ break
+ }
+ }
+ }
+ return info
+}
+
+// UpdateFile updates the given file to match updates.json
+func updateFile(name string) error {
+ file, err := json.MarshalIndent(&configData, "", " ")
+ if err != nil {
+ return err
+ }
+ return ioutil.WriteFile(name, file, 0770)
+}
+
+// SendGetReq sends get req
+func sendGetReq(path string, result interface{}) error {
+ var requester *request.Requester
+ if strings.Contains(path, "github") {
+ requester = request.New("Apichecker",
+ common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout),
+ request.NewBasicRateLimit(time.Hour, 60))
+ } else {
+ requester = request.New("Apichecker",
+ common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout),
+ request.NewBasicRateLimit(time.Second, 100))
+ }
+ return requester.SendPayload(&request.Item{
+ Method: http.MethodGet,
+ Path: path,
+ Result: result,
+ Verbose: verbose})
+}
+
+// sendAuthReq sends auth req
+func sendAuthReq(method, path string, result interface{}) error {
+ requester := request.New("Apichecker",
+ common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout),
+ request.NewBasicRateLimit(time.Second*10, 100))
+ return requester.SendPayload(&request.Item{
+ Method: method,
+ Path: path,
+ Result: result,
+ Verbose: verbose})
+}
+
+// trelloGetBoardID gets all board ids on trello for a given user
+func trelloGetBoardID() (string, error) {
+ if trelloBoardName == "" {
+ return "", errors.New("trelloBoardName not set, cannot find the trelloBoard")
+ }
+ var resp []TrelloData
+ err := sendGetReq(fmt.Sprintf(pathCheckBoardID, apiKey, apiToken),
+ &resp)
+ if err != nil {
+ return "", err
+ }
+ for x := range resp {
+ if resp[x].Name == trelloBoardName {
+ return resp[x].ID, err
+ }
+ }
+ return "", errors.New("boardID not found")
+}
+
+// trelloGetLists gets all lists from a given board
+func trelloGetLists() ([]TrelloData, error) {
+ var resp []TrelloData
+ return resp, sendGetReq(fmt.Sprintf(pathGetAllLists, trelloBoardID, apiKey, apiToken), &resp)
+}
+
+// trelloNewList creates a new list on a specified boards on trello
+func trelloCreateNewList() error {
+ if trelloBoardID == "" {
+ return errors.New("trelloBoardID not set, cannot create a new list")
+ }
+ var resp interface{}
+ listName := createList
+ if configData.CreateListName != "" {
+ listName = configData.CreateListName
+ }
+ err := sendAuthReq(http.MethodPost,
+ fmt.Sprintf(pathNewList, listName, trelloBoardID, apiKey, apiToken),
+ &resp)
+ if err != nil {
+ return err
+ }
+ lists, err := trelloGetLists()
+ if err != nil {
+ return err
+ }
+ for x := range lists {
+ if lists[x].Name != listName {
+ continue
+ }
+ trelloListID = lists[x].ID
+ usageData.ListID = lists[x].ID
+ err = writeAuthVars(testMode)
+ if err != nil {
+ return err
+ }
+ return nil
+ }
+ return nil
+}
+
+// trelloDeleteCheckItem deletes check item from a checklist
+func trelloDeleteCheckItem(checkitemID string) error {
+ if checkitemID == "" {
+ return errors.New("checkitemID cannot be empty")
+ }
+ var resp interface{}
+ return sendAuthReq(http.MethodDelete,
+ fmt.Sprintf(pathDeleteCheckitems, trelloChecklistID, checkitemID, apiKey, apiToken),
+ &resp)
+}
+
+// trelloGetAllCards gets all cards from a given list
+func trelloGetAllCards() ([]TrelloData, error) {
+ var resp []TrelloData
+ return resp, sendGetReq(fmt.Sprintf(pathGetCards, trelloListID, apiKey, apiToken), &resp)
+}
+
+// trelloCreateNewCard creates a new card on the list specified on trello
+func trelloCreateNewCard() error {
+ if trelloListID == "" {
+ return errors.New("trelloListID not set, cannot create a new checklist")
+ }
+ var resp interface{}
+ cardName := createCard
+ if configData.CreateCardName != "" {
+ cardName = configData.CreateCardName
+ }
+ err := sendAuthReq(http.MethodPost,
+ fmt.Sprintf(pathNewCard, trelloListID, cardName, apiKey, apiToken),
+ &resp)
+ if err != nil {
+ return err
+ }
+ cards, err := trelloGetAllCards()
+ if err != nil {
+ return err
+ }
+ for x := range cards {
+ if cards[x].Name != cardName {
+ continue
+ }
+ trelloCardID = cards[x].ID
+ usageData.CardID = cards[x].ID
+ err = writeAuthVars(testMode)
+ if err != nil {
+ return err
+ }
+ return nil
+ }
+ return errors.New("card id and name not found, list creation failed")
+}
+
+// trelloGetAllChecklists gets all checklists from a card on trello
+func trelloGetAllChecklists() ([]TrelloData, error) {
+ var resp []TrelloData
+ return resp, sendGetReq(fmt.Sprintf(pathGetChecklists, trelloCardID, apiKey, apiToken), &resp)
+}
+
+// trelloCreateNewChecklist creates a new checklist on a specified card on trello
+func trelloCreateNewChecklist() error {
+ if !areAPIKeysSet() || (trelloCardID == "") {
+ return errors.New("apikeys or trelloCardID not set, cannot create a new checklist")
+ }
+ var resp interface{}
+ checklistName := createChecklist
+ if configData.CreateChecklistName != "" {
+ checklistName = configData.CreateChecklistName
+ }
+ err := sendAuthReq(http.MethodPost,
+ fmt.Sprintf(pathNewChecklist, trelloCardID, checklistName, apiKey, apiToken),
+ &resp)
+ if err != nil {
+ return err
+ }
+ checklists, err := trelloGetAllChecklists()
+ if err != nil {
+ return err
+ }
+ for x := range checklists {
+ if checklists[x].Name != checklistName {
+ continue
+ }
+ trelloChecklistID = checklists[x].ID
+ usageData.ChecklistID = checklists[x].ID
+ err = writeAuthVars(testMode)
+ if err != nil {
+ return err
+ }
+ return nil
+ }
+ return errors.New("checklist id and name not found, checklist creation failed")
+}
diff --git a/cmd/apichecker/apicheck_test.go b/cmd/apichecker/apicheck_test.go
new file mode 100644
index 00000000..cbbfa6cd
--- /dev/null
+++ b/cmd/apichecker/apicheck_test.go
@@ -0,0 +1,704 @@
+package main
+
+import (
+ "encoding/json"
+ "io/ioutil"
+ "os"
+ "reflect"
+ "testing"
+
+ "github.com/thrasher-corp/gocryptotrader/common/convert"
+ exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
+ "github.com/thrasher-corp/gocryptotrader/log"
+)
+
+var (
+ testAPIKey = ""
+ testAPIToken = ""
+ testChecklistID = ""
+ testCardID = ""
+ testListID = ""
+ testBoardID = ""
+ testBoardName = ""
+ canTestMainFile = false
+)
+
+func TestMain(m *testing.M) {
+ setTestVars()
+ testMode = true
+ c := log.GenDefaultSettings()
+ c.Enabled = convert.BoolPtr(true)
+ log.GlobalLogConfig = &c
+ log.Infoln(log.Global, "set verbose to true for more detailed output")
+ var err error
+ configData, err = readFileData(jsonFile)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ testConfigData, err = readFileData(testJSONFile)
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ usageData = testConfigData
+ setTestVars()
+ defer os.Exit(m.Run())
+ defer func() {
+ err := removeTestFileVars()
+ if err != nil {
+ log.Error(log.Global, err)
+ os.Exit(1)
+ }
+ }()
+}
+
+func areTestAPIKeysSet() bool {
+ return (testAPIKey != "" && testAPIToken != "")
+}
+
+func setTestVars() {
+ if !canUpdateTrello() {
+ apiKey = testAPIKey
+ apiToken = testAPIToken
+ trelloChecklistID = testChecklistID
+ trelloCardID = testCardID
+ trelloListID = testListID
+ trelloBoardID = testBoardID
+ trelloBoardName = testBoardName
+ return
+ }
+}
+
+func removeTestFileVars() error {
+ a, err := readFileData(testJSONFile)
+ if err != nil {
+ return err
+ }
+ a.BoardID = ""
+ a.CardID = ""
+ a.ChecklistID = ""
+ a.Key = ""
+ a.ListID = ""
+ a.Token = ""
+ file, err := json.MarshalIndent(&a, "", " ")
+ if err != nil {
+ return err
+ }
+ return ioutil.WriteFile(testJSONFile, file, 0770)
+}
+
+func canTestTrello() bool {
+ if testAPIKey != "" && testAPIToken != "" && testChecklistID != "" && testCardID != "" && testListID != "" && (testBoardID != "" || testBoardName != "") {
+ return true
+ }
+ return false
+}
+
+func TestCheckUpdates(t *testing.T) {
+ if !canUpdateTrello() || !canTestTrello() {
+ t.Skip()
+ }
+ err := checkUpdates(testJSONFile)
+ if err != nil {
+ t.Fatal(err)
+ }
+}
+
+func TestUpdateFile(t *testing.T) {
+ realConf, err := readFileData(jsonFile)
+ if err != nil {
+ t.Fatal(err)
+ }
+ configData = realConf
+ err = updateFile(testJSONFile)
+ if err != nil {
+ t.Fatal(err)
+ }
+ testConf, err := readFileData(testJSONFile)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !reflect.DeepEqual(realConf, testConf) {
+ t.Error("test file update failed")
+ }
+}
+
+func TestCheckExistingExchanges(t *testing.T) {
+ t.Parallel()
+ if !checkExistingExchanges("Kraken") {
+ t.Fatal("Kraken data not found")
+ }
+}
+
+func TestCheckChangeLog(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h1",
+ Key: "id",
+ Val: "revision-history",
+ TokenDataEnd: "table",
+ TextTokenData: "td",
+ DateFormat: "2006/01/02",
+ RegExp: `^20(\d){2}/(\d){2}/(\d){2}$`,
+ Path: "https://docs.gemini.com/rest-api/#revision-history"}
+ _, err := checkChangeLog(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestAdd(t *testing.T) {
+ t.Parallel()
+ data2 := HTMLScrapingData{TokenData: "a",
+ Key: "href",
+ Val: "./#change-change",
+ TokenDataEnd: "./#change-",
+ RegExp: `./#change-\d{8}`,
+ Path: "wrongpath"}
+ err := addExch("WrongExch", htmlScrape, data2, false)
+ if err == nil {
+ t.Log("expected an error due to invalid path being parsed in")
+ }
+}
+
+func TestHTMLScrapeGemini(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h1",
+ Key: "id",
+ Val: "revision-history",
+ TokenDataEnd: "table",
+ TextTokenData: "td",
+ DateFormat: "2006/01/02",
+ RegExp: "^20(\\d){2}/(\\d){2}/(\\d){2}$",
+ CheckString: "2019/11/15",
+ Path: "https://docs.gemini.com/rest-api/#revision-history"}
+ _, err := htmlScrapeDefault(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeHuobi(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h1",
+ Key: "id",
+ Val: "change-log",
+ TokenDataEnd: "h2",
+ TextTokenData: "td",
+ DateFormat: "2006.01.02 15:04",
+ RegExp: "^20(\\d){2}.(\\d){2}.(\\d){2} (\\d){2}:(\\d){2}$",
+ CheckString: "2019.12.27 19:00",
+ Path: "https://huobiapi.github.io/docs/spot/v1/en/#change-log"}
+ _, err := htmlScrapeDefault(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeCoinbasepro(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h1",
+ Key: "id",
+ Val: "changelog",
+ TokenDataEnd: "ul",
+ TextTokenData: "strong",
+ DateFormat: "01/02/06",
+ RegExp: "^(\\d){1,2}/(\\d){1,2}/(\\d){2}$",
+ CheckString: "12/16/19",
+ Path: "https://docs.pro.coinbase.com/#changelog"}
+ _, err := htmlScrapeDefault(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeBitfinex(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{DateFormat: "2006-01-02",
+ RegExp: `section-v-(2\d{3}-\d{1,2}-\d{1,2})`,
+ Path: "https://docs.bitfinex.com/docs/changelog"}
+ _, err := htmlScrapeBitfinex(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeBitmex(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h4",
+ Key: "id",
+ Val: "",
+ TokenDataEnd: "",
+ TextTokenData: "",
+ DateFormat: "Jan-2-2006",
+ RegExp: `([A-Z]{1}[a-z]{2}-\d{1,2}-2\d{3})`,
+ Path: "https://www.bitmex.com/static/md/en-US/apiChangelog"}
+ _, err := htmlScrapeBitmex(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeHitBTC(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{RegExp: `newest version \d{1}.\d{1}`,
+ Path: "https://api.hitbtc.com/"}
+ _, err := htmlScrapeHitBTC(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeDefault(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h3",
+ Key: "id",
+ Val: "change-change",
+ TokenDataEnd: "section",
+ TextTokenData: "p",
+ DateFormat: "2006-01-02",
+ RegExp: "(2\\d{3}-\\d{1,2}-\\d{1,2})",
+ CheckString: "2019-04-28",
+ Path: "https://www.okcoin.com/docs/en/#change-change"}
+ _, err := htmlScrapeDefault(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeBTSE(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{RegExp: `^version: \d{1}.\d{1}.\d{1}`,
+ Path: "https://api.btcmarkets.net/openapi/info/index.yaml"}
+ _, err := htmlScrapeBTSE(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeBTCMarkets(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{RegExp: `^version: \d{1}.\d{1}.\d{1}`,
+ Path: "https://api.btcmarkets.net/openapi/info/index.yaml"}
+ _, err := htmlScrapeBTCMarkets(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeBitflyer(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "p",
+ TokenDataEnd: "h3",
+ TextTokenData: "code",
+ RegExp: `^https://api.bitflyer.com/v\d{1}/$`,
+ Path: "https://lightning.bitflyer.com/docs?lang=en"}
+ _, err := htmlScrapeBitflyer(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeANX(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{RegExp: `ANX Exchange API v\d{1}`,
+ Path: "https://anxv3.docs.apiary.io/#reference/quickstart-catalog"}
+ _, err := htmlScrapeANX(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLPoloniex(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h1",
+ Key: "id",
+ Val: "changelog",
+ TokenDataEnd: "div",
+ TextTokenData: "h2",
+ DateFormat: "2006-01-02",
+ RegExp: `(2\d{3}-\d{1,2}-\d{1,2})`,
+ Path: "https://docs.poloniex.com/#changelog"}
+ _, err := htmlScrapePoloniex(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLItBit(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "a",
+ Key: "href",
+ Val: "changelog",
+ TokenDataEnd: "div",
+ TextTokenData: "h2",
+ DateFormat: "2006-01-02",
+ RegExp: `^https://api.itbit.com/v\d{1}/$`,
+ Path: "https://api.itbit.com/docs"}
+ _, err := htmlScrapeItBit(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLLakeBTC(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "div",
+ Key: "class",
+ Val: "flash-message",
+ TokenDataEnd: "h2",
+ TextTokenData: "h1",
+ DateFormat: "",
+ RegExp: `APIv\d{1}`,
+ Path: "https://www.lakebtc.com/s/api_v2"}
+ _, err := htmlScrapeLakeBTC(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeExmo(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{RegExp: `Last updated on [\s\S]*, 20\d{2}`,
+ Path: "https://exmo.com/en/api/"}
+ _, err := htmlScrapeExmo(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLBitstamp(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{RegExp: `refer to the v\d{1} API for future references.`,
+ Path: "https://www.bitstamp.net/api/"}
+ _, err := htmlScrapeBitstamp(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLKraken(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h3",
+ TokenDataEnd: "p",
+ TextTokenData: "p",
+ RegExp: `URL: https://api.kraken.com/\d{1}/private/Balance`,
+ Path: "https://www.kraken.com/features/api"}
+ _, err := htmlScrapeKraken(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLAlphaPoint(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h1",
+ Key: "id",
+ Val: "introduction",
+ TokenDataEnd: "blockquote",
+ TextTokenData: "h3",
+ RegExp: `revised-calls-\d{1}-\d{1}-\d{1}-gt-\d{1}-\d{1}-\d{1}`,
+ Path: "https://alphapoint.github.io/slate/#introduction"}
+ _, err := htmlScrapeAlphaPoint(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLYobit(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h2",
+ Key: "id",
+ Path: "https://www.yobit.net/en/api/"}
+ _, err := htmlScrapeYobit(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeLocalBitcoins(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "div",
+ Key: "class",
+ Val: "col-md-12",
+ RegExp: `col-md-12([\s\S]*?)clearfix`,
+ Path: "https://localbitcoins.com/api-docs/"}
+ _, err := htmlScrapeLocalBitcoins(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestHTMLScrapeOk(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "a",
+ Key: "href",
+ Val: "./#change-change",
+ TokenDataEnd: "./#change-",
+ RegExp: `./#change-\d{8}`,
+ Path: "https://www.okex.com/docs/en/"}
+ _, err := htmlScrapeOk(&data)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestUpdate(t *testing.T) {
+ t.Parallel()
+ var exchCheck, updatedExch HTMLScrapingData
+ for x := range configData.Exchanges {
+ if configData.Exchanges[x].Name == "Exmo" {
+ exchCheck = *configData.Exchanges[x].Data.HTMLData
+ }
+ }
+ info := ExchangeInfo{Name: "Exmo",
+ CheckType: "HTML String Check",
+ Data: &CheckData{HTMLData: &HTMLScrapingData{RegExp: `Last updated on [\s\S]*, 20\d{2}`,
+ Path: "https://exmo.com/en/api/"},
+ },
+ }
+ updatedExchs := update("Exmo", configData.Exchanges, info)
+ for y := range updatedExchs {
+ if updatedExchs[y].Name == "Exmo" {
+ updatedExch = *updatedExchs[y].Data.HTMLData
+ }
+ }
+ if updatedExch == exchCheck {
+ t.Fatal("update failed")
+ }
+}
+
+func TestCheckMissingExchanges(t *testing.T) {
+ t.Parallel()
+ a := checkMissingExchanges()
+ if len(a) > len(exchange.Exchanges) {
+ t.Fatal("invalid response")
+ }
+}
+
+func TestNameUpdates(t *testing.T) {
+ t.Parallel()
+ tester := []struct {
+ Name string
+ Status string
+ ExpectedName string
+ ErrorExpected bool
+ }{
+ {
+ Name: "incorrectname",
+ Status: "incomplete",
+ ErrorExpected: true,
+ },
+ {
+ Name: "Gemini 2 2",
+ Status: "incomplete",
+ ErrorExpected: false,
+ },
+ {
+ Name: " Gemini 23",
+ Status: "incomplete",
+ ErrorExpected: true,
+ },
+ {
+ Name: "Gemini 123",
+ Status: "complete",
+ ExpectedName: "Gemini 1",
+ ErrorExpected: false,
+ },
+ {
+ Name: "Gemini",
+ Status: "complete",
+ ExpectedName: "Gemini 1",
+ ErrorExpected: false,
+ },
+ {
+ Name: "Gemini 24 ",
+ Status: "incomplete",
+ ErrorExpected: false,
+ },
+ }
+ for x := range tester {
+ r, err := nameStateChanges(tester[x].Name, tester[x].Status)
+ if r != tester[x].ExpectedName && err != nil && !tester[x].ErrorExpected {
+ t.Errorf("%d failed, expected %v, %v, got: %v, %v\n", x,
+ tester[x].ExpectedName,
+ tester[x].ErrorExpected,
+ r,
+ err)
+ }
+ }
+}
+
+func TestReadFileData(t *testing.T) {
+ t.Parallel()
+ _, err := readFileData(testJSONFile)
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestGetSha(t *testing.T) {
+ t.Parallel()
+ _, err := getSha("binance-exchange/binance-official-api-docs")
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestCheckBoardID(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ a, err := trelloCheckBoardID()
+ if err != nil {
+ t.Error(err)
+ }
+ if a != true {
+ t.Error("no match found for the given boardID")
+ }
+}
+
+func TestTrelloGetLists(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ _, err := trelloGetLists()
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestGetAllCards(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ _, err := trelloGetAllCards()
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestGetAllChecklists(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ _, err := trelloGetAllChecklists()
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestTrelloGetAllBoards(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ if trelloBoardID != "" || testBoardName != "" {
+ t.Skip()
+ }
+ _, err := trelloGetBoardID()
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestCreateNewList(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ err := trelloCreateNewList()
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestTrelloCreateNewCard(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ err := trelloCreateNewCard()
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestCreateNewChecklist(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ err := trelloCreateNewChecklist()
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestWriteAuthVars(t *testing.T) {
+ if canTestMainFile {
+ trelloCardID = "jdsfl"
+ err := writeAuthVars(testMode)
+ if err != nil {
+ t.Log(err)
+ }
+ }
+}
+
+func TestCreateNewCheck(t *testing.T) {
+ if !canTestTrello() {
+ t.Skip()
+ }
+ err := trelloCreateNewCheck("Gemini")
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestUpdateCheckItem(t *testing.T) {
+ if !canTestTrello() {
+ t.Skip()
+ }
+ a, err := trelloGetChecklistItems()
+ if err != nil {
+ t.Error(err)
+ }
+ var checkID string
+ for x := range a.CheckItems {
+ if a.CheckItems[x].Name == "Gemini 1" {
+ checkID = a.CheckItems[x].ID
+ }
+ }
+ err = trelloUpdateCheckItem(checkID, "Gemini 1", "incomplete")
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestGetChecklistItems(t *testing.T) {
+ if !canTestTrello() {
+ t.Skip()
+ }
+ _, err := trelloGetChecklistItems()
+ if err != nil {
+ t.Error(err)
+ }
+}
+
+func TestSetAuthVars(t *testing.T) {
+ t.Parallel()
+ apiKey = ""
+ configData.Key = ""
+ apiToken = ""
+ configData.Token = ""
+ setAuthVars()
+ if usageData.Key != "" && usageData.Token != "" {
+ t.Errorf("incorrect key and token values")
+ }
+}
+
+func TestTrelloDeleteCheckItems(t *testing.T) {
+ if !areTestAPIKeysSet() {
+ t.Skip()
+ }
+ err := trelloDeleteCheckItem("")
+ if err != nil {
+ t.Error(err)
+ }
+}
diff --git a/cmd/apichecker/apicheck_types.go b/cmd/apichecker/apicheck_types.go
new file mode 100644
index 00000000..e628e57d
--- /dev/null
+++ b/cmd/apichecker/apicheck_types.go
@@ -0,0 +1,100 @@
+package main
+
+// ShaResponse stores raw response from the queries
+type ShaResponse struct {
+ ShaResp string `json:"sha"`
+}
+
+// ExchangeInfo stores exchange info
+type ExchangeInfo struct {
+ Name string
+ CheckType string
+ Data *CheckData `json:",omitempty"`
+ Disabled bool
+}
+
+// CheckData is the necessary data required for checking updates
+type CheckData struct {
+ HTMLData *HTMLScrapingData `json:",omitempty"`
+ GitHubData *GithubData `json:",omitempty"`
+}
+
+// HTMLScrapingData stores input required for extracting latest update data using HTML
+type HTMLScrapingData struct {
+ TokenData string `json:",omitempty"`
+ Key string `json:",omitempty"`
+ Val string `json:",omitempty"`
+ TokenDataEnd string `json:",omitempty"`
+ TextTokenData string `json:",omitempty"`
+ DateFormat string `json:",omitempty"`
+ RegExp string `json:",omitempty"`
+ CheckString string `json:",omitempty"`
+ Path string `json:",omitempty"`
+}
+
+// GithubData stores input required for extracting latest update data
+type GithubData struct {
+ Repo string `json:",omitempty"`
+ Sha string `json:",omitempty"`
+}
+
+// ListData stores trello lists' required data
+type ListData struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ IDBoard string `json:"idBoard"`
+}
+
+// CardFill contains data necessary to create a new card
+type CardFill struct {
+ Name string
+ Desc string
+ Pos string
+ Due string
+ ListID string
+ MembersID string
+ LabelsID string
+ URLSource string
+}
+
+// ItemData stores data of items on a given checklist
+type ItemData struct {
+ State string `json:"state"`
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Position int64 `json:"pos"`
+}
+
+// ChecklistItemData stores items on a given checklist
+type ChecklistItemData struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ CheckItems []ItemData `json:"checkItems"`
+}
+
+// MembersData saves member's data which includes the boards accessible
+type MembersData struct {
+ Name string `json:"name"`
+ ShortID string `json:"shortlink"`
+ ID string `json:"id"`
+}
+
+// Config is a format for storing update data
+type Config struct {
+ CardID string `json:"CardID"`
+ ChecklistID string `json:"ChecklistID"`
+ ListID string `json:"ListID"`
+ BoardID string `json:"BoardID"`
+ Key string `json:"Key"`
+ Token string `json:"Token"`
+ CreateCardName string
+ CreateListName string
+ CreateChecklistName string
+ Exchanges []ExchangeInfo `json:"Exchanges"`
+}
+
+// TrelloData stores data on a given item (board, list, card)
+type TrelloData struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+}
diff --git a/cmd/apichecker/testupdates.json b/cmd/apichecker/testupdates.json
new file mode 100644
index 00000000..ae8644af
--- /dev/null
+++ b/cmd/apichecker/testupdates.json
@@ -0,0 +1,430 @@
+{
+ "CardID": "",
+ "ChecklistID": "",
+ "ListID": "",
+ "BoardID": "",
+ "Key": "",
+ "Token": "",
+ "CreateCardName": "",
+ "CreateListName": "",
+ "CreateChecklistName": "",
+ "Exchanges": [
+ {
+ "Name": "Huobi",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "change-log",
+ "TokenDataEnd": "h2",
+ "TextTokenData": "td",
+ "DateFormat": "2006.01.02 15:04",
+ "RegExp": "^20(\\d){2}.(\\d){2}.(\\d){2} (\\d){2}:(\\d){2}$",
+ "CheckString": "2019.12.27 19:00",
+ "Path": "https://huobiapi.github.io/docs/spot/v1/en/#change-log"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Coinbasepro",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "changelog",
+ "TokenDataEnd": "ul",
+ "TextTokenData": "strong",
+ "DateFormat": "01/02/06",
+ "RegExp": "^(\\d){1,2}/(\\d){1,2}/(\\d){2}$",
+ "CheckString": "2/20/20",
+ "Path": "https://docs.pro.coinbase.com/#changelog"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Binance",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "binance-exchange/binance-official-api-docs",
+ "Sha": "4878d48adc0075669ba85033b0e2d40c2876cf56"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bithumb",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "bithumb-pro/bithumb.pro-official-api-docs",
+ "Sha": "6293502c7736ab4971491978225ef4d104bdff31"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bittrex",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "Bittrex/bittrex.github.io",
+ "Sha": "fc1ea9c10c48aa82c4dc2c6be74887ef61b5b31b"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "CoinbeneSpot",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "Coinbene/API-SPOT-v2-Documents",
+ "Sha": "e9135a782ba6016bcf008778be368882ad7c784d"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "CoinbeneSwap",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "Coinbene/API-SWAP-Documents",
+ "Sha": "6b7871dae4d2af028a33dde956fbce101e2f9acd"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Coinut",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "coinut/api",
+ "Sha": "6936dab4d2beba3c8245a603aebf3f545ebcf3f9"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Gateio",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "gateio/gateapi-go",
+ "Sha": "81e2f1bb92c5406853139ae054bbda599483e127"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Lbank",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "LBank-exchange/lbank-official-api-docs",
+ "Sha": "85e7bb83f03d4239c3aad26cabb997a1a2bbb3d1"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "BTSE",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "btse-spot-api",
+ "TokenDataEnd": "blockquote",
+ "TextTokenData": "h1",
+ "RegExp": "^BTSE Spot API v(\\d){1}.(\\d){1}$",
+ "CheckString": "BTSE Spot API v3.0.2",
+ "Path": "https://www.btse.com/apiexplorer/spot/#btse-spot-api"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bitfinex",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "class",
+ "Val": "header-scroll",
+ "TokenDataEnd": "p",
+ "DateFormat": "2006-01-02",
+ "RegExp": "section-v-(2\\d{3}-\\d{1,2}-\\d{1,2})",
+ "CheckString": "2019-08-19",
+ "Path": "https://docs.bitfinex.com/docs/changelog"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "ANX",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "RegExp": "ANX Exchange API v\\d{1}",
+ "CheckString": "ANX Exchange API v3",
+ "Path": "https://anxv3.docs.apiary.io/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Poloniex",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "changelog",
+ "TokenDataEnd": "div",
+ "TextTokenData": "h2",
+ "DateFormat": "2006-01-02",
+ "RegExp": "(2\\d{3}-\\d{1,2}-\\d{1,2})",
+ "CheckString": "2020-03-24",
+ "Path": "https://docs.poloniex.com/#changelog"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "ItBit",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "a",
+ "Key": "href",
+ "RegExp": "^https://api.itbit.com/v\\d{1}/$",
+ "CheckString": "https://api.itbit.com/v1/",
+ "Path": "https://api.itbit.com/docs"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bitmex",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h4",
+ "Key": "id",
+ "DateFormat": "Jan-2-2006",
+ "RegExp": "([A-Z]{1}[a-z]{2}-\\d{1,2}-2\\d{3})",
+ "CheckString": "Dec-16-2019",
+ "Path": "https://www.bitmex.com/static/md/en-US/apiChangelog"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "HitBTC",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "about-companyname-api",
+ "TokenDataEnd": "h2",
+ "TextTokenData": "p",
+ "RegExp": "newest version \\d{1}.\\d{1}",
+ "CheckString": "newest version 2.0",
+ "Path": "https://api.hitbtc.com/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "BTC Markets",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "RegExp": "^version: \\d{1}.\\d{1}.\\d{1}",
+ "CheckString": "version: 3.0.0",
+ "Path": "https://api.btcmarkets.net/openapi/info/index.yaml"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bitflyer",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "p",
+ "TokenDataEnd": "h3",
+ "TextTokenData": "code",
+ "RegExp": "^https://api.bitflyer.com/v\\d{1}/$",
+ "CheckString": "https://api.bitflyer.com/v1/",
+ "Path": "https://lightning.bitflyer.com/docs?lang=en"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "LakeBTC",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "div",
+ "Key": "class",
+ "Val": "flash-message",
+ "TokenDataEnd": "h2",
+ "TextTokenData": "h1",
+ "RegExp": "APIv\\d{1}",
+ "CheckString": "de2491b95ef1f6ea334247b13f0f14f6816fb5961cc63acc0542b07fc0336dd8",
+ "Path": "https://www.lakebtc.com/s/api_v2"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Exmo",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "RegExp": "Last updated on [\\s\\S]*, 20\\d{2}",
+ "CheckString": "Last updated on December, 16th, 2019",
+ "Path": "https://exmo.com/en/api/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Kraken",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h3",
+ "TokenDataEnd": "p",
+ "TextTokenData": "p",
+ "RegExp": "URL: https://api.kraken.com/\\d{1}/private/Balance",
+ "CheckString": "URL: https://api.kraken.com/0/private/Balance",
+ "Path": "https://www.kraken.com/features/api"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bitstamp",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h2",
+ "Key": "class",
+ "Val": "text-subtitle mt48",
+ "TokenDataEnd": "h4",
+ "TextTokenData": "p",
+ "RegExp": "refer to the v\\d{1} API for future references.",
+ "CheckString": "refer to the v2 API for future references.",
+ "Path": "https://www.bitstamp.net/api/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "AlphaPoint",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "introduction",
+ "TokenDataEnd": "blockquote",
+ "TextTokenData": "h3",
+ "RegExp": "revised-calls-\\d{1}-\\d{1}-\\d{1}-gt-\\d{1}-\\d{1}-\\d{1}",
+ "CheckString": "revised-calls-3-3-2-gt-3-3-3",
+ "Path": "https://alphapoint.github.io/slate/#introduction"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Yobit",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h2",
+ "Key": "id",
+ "CheckString": "v3",
+ "Path": "https://www.yobit.net/en/api/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "LocalBitcoins",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "div",
+ "Key": "class",
+ "Val": "col-md-12",
+ "RegExp": "col-md-12([\\s\\S]*?)clearfix",
+ "CheckString": "37a144dc619776b87c098da5a88bef7fed6c8a7cea2d4b9a38c96750726c93ff",
+ "Path": "https://localbitcoins.com/api-docs/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "OkCoin International",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "a",
+ "Key": "href",
+ "Val": "./#change-change",
+ "TokenDataEnd": "./#change-",
+ "RegExp": "./#change-\\d{8}",
+ "CheckString": "20200229",
+ "Path": "https://www.okcoin.com/docs/en/#change-change"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Okex",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "a",
+ "Key": "href",
+ "Val": "./#change-change",
+ "TokenDataEnd": "./#change-",
+ "RegExp": "./#change-\\d{8}",
+ "CheckString": "20200331",
+ "Path": "https://www.okex.com/docs/en/#change-change"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Gemini",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "revision-history",
+ "TokenDataEnd": "table",
+ "TextTokenData": "td",
+ "DateFormat": "2006/01/02",
+ "RegExp": "^20(\\d){2}/(\\d){2}/(\\d){2}$",
+ "CheckString": "2020/03/05",
+ "Path": "https://docs.gemini.com/rest-api/#revision-history"
+ }
+ },
+ "Disabled": false
+ }
+ ]
+}
\ No newline at end of file
diff --git a/cmd/apichecker/updates.json b/cmd/apichecker/updates.json
new file mode 100644
index 00000000..ae8644af
--- /dev/null
+++ b/cmd/apichecker/updates.json
@@ -0,0 +1,430 @@
+{
+ "CardID": "",
+ "ChecklistID": "",
+ "ListID": "",
+ "BoardID": "",
+ "Key": "",
+ "Token": "",
+ "CreateCardName": "",
+ "CreateListName": "",
+ "CreateChecklistName": "",
+ "Exchanges": [
+ {
+ "Name": "Huobi",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "change-log",
+ "TokenDataEnd": "h2",
+ "TextTokenData": "td",
+ "DateFormat": "2006.01.02 15:04",
+ "RegExp": "^20(\\d){2}.(\\d){2}.(\\d){2} (\\d){2}:(\\d){2}$",
+ "CheckString": "2019.12.27 19:00",
+ "Path": "https://huobiapi.github.io/docs/spot/v1/en/#change-log"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Coinbasepro",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "changelog",
+ "TokenDataEnd": "ul",
+ "TextTokenData": "strong",
+ "DateFormat": "01/02/06",
+ "RegExp": "^(\\d){1,2}/(\\d){1,2}/(\\d){2}$",
+ "CheckString": "2/20/20",
+ "Path": "https://docs.pro.coinbase.com/#changelog"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Binance",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "binance-exchange/binance-official-api-docs",
+ "Sha": "4878d48adc0075669ba85033b0e2d40c2876cf56"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bithumb",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "bithumb-pro/bithumb.pro-official-api-docs",
+ "Sha": "6293502c7736ab4971491978225ef4d104bdff31"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bittrex",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "Bittrex/bittrex.github.io",
+ "Sha": "fc1ea9c10c48aa82c4dc2c6be74887ef61b5b31b"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "CoinbeneSpot",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "Coinbene/API-SPOT-v2-Documents",
+ "Sha": "e9135a782ba6016bcf008778be368882ad7c784d"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "CoinbeneSwap",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "Coinbene/API-SWAP-Documents",
+ "Sha": "6b7871dae4d2af028a33dde956fbce101e2f9acd"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Coinut",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "coinut/api",
+ "Sha": "6936dab4d2beba3c8245a603aebf3f545ebcf3f9"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Gateio",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "gateio/gateapi-go",
+ "Sha": "81e2f1bb92c5406853139ae054bbda599483e127"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Lbank",
+ "CheckType": "GitHub Sha Check",
+ "Data": {
+ "GitHubData": {
+ "Repo": "LBank-exchange/lbank-official-api-docs",
+ "Sha": "85e7bb83f03d4239c3aad26cabb997a1a2bbb3d1"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "BTSE",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "btse-spot-api",
+ "TokenDataEnd": "blockquote",
+ "TextTokenData": "h1",
+ "RegExp": "^BTSE Spot API v(\\d){1}.(\\d){1}$",
+ "CheckString": "BTSE Spot API v3.0.2",
+ "Path": "https://www.btse.com/apiexplorer/spot/#btse-spot-api"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bitfinex",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "class",
+ "Val": "header-scroll",
+ "TokenDataEnd": "p",
+ "DateFormat": "2006-01-02",
+ "RegExp": "section-v-(2\\d{3}-\\d{1,2}-\\d{1,2})",
+ "CheckString": "2019-08-19",
+ "Path": "https://docs.bitfinex.com/docs/changelog"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "ANX",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "RegExp": "ANX Exchange API v\\d{1}",
+ "CheckString": "ANX Exchange API v3",
+ "Path": "https://anxv3.docs.apiary.io/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Poloniex",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "changelog",
+ "TokenDataEnd": "div",
+ "TextTokenData": "h2",
+ "DateFormat": "2006-01-02",
+ "RegExp": "(2\\d{3}-\\d{1,2}-\\d{1,2})",
+ "CheckString": "2020-03-24",
+ "Path": "https://docs.poloniex.com/#changelog"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "ItBit",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "a",
+ "Key": "href",
+ "RegExp": "^https://api.itbit.com/v\\d{1}/$",
+ "CheckString": "https://api.itbit.com/v1/",
+ "Path": "https://api.itbit.com/docs"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bitmex",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h4",
+ "Key": "id",
+ "DateFormat": "Jan-2-2006",
+ "RegExp": "([A-Z]{1}[a-z]{2}-\\d{1,2}-2\\d{3})",
+ "CheckString": "Dec-16-2019",
+ "Path": "https://www.bitmex.com/static/md/en-US/apiChangelog"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "HitBTC",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "about-companyname-api",
+ "TokenDataEnd": "h2",
+ "TextTokenData": "p",
+ "RegExp": "newest version \\d{1}.\\d{1}",
+ "CheckString": "newest version 2.0",
+ "Path": "https://api.hitbtc.com/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "BTC Markets",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "RegExp": "^version: \\d{1}.\\d{1}.\\d{1}",
+ "CheckString": "version: 3.0.0",
+ "Path": "https://api.btcmarkets.net/openapi/info/index.yaml"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bitflyer",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "p",
+ "TokenDataEnd": "h3",
+ "TextTokenData": "code",
+ "RegExp": "^https://api.bitflyer.com/v\\d{1}/$",
+ "CheckString": "https://api.bitflyer.com/v1/",
+ "Path": "https://lightning.bitflyer.com/docs?lang=en"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "LakeBTC",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "div",
+ "Key": "class",
+ "Val": "flash-message",
+ "TokenDataEnd": "h2",
+ "TextTokenData": "h1",
+ "RegExp": "APIv\\d{1}",
+ "CheckString": "de2491b95ef1f6ea334247b13f0f14f6816fb5961cc63acc0542b07fc0336dd8",
+ "Path": "https://www.lakebtc.com/s/api_v2"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Exmo",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "RegExp": "Last updated on [\\s\\S]*, 20\\d{2}",
+ "CheckString": "Last updated on December, 16th, 2019",
+ "Path": "https://exmo.com/en/api/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Kraken",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h3",
+ "TokenDataEnd": "p",
+ "TextTokenData": "p",
+ "RegExp": "URL: https://api.kraken.com/\\d{1}/private/Balance",
+ "CheckString": "URL: https://api.kraken.com/0/private/Balance",
+ "Path": "https://www.kraken.com/features/api"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Bitstamp",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h2",
+ "Key": "class",
+ "Val": "text-subtitle mt48",
+ "TokenDataEnd": "h4",
+ "TextTokenData": "p",
+ "RegExp": "refer to the v\\d{1} API for future references.",
+ "CheckString": "refer to the v2 API for future references.",
+ "Path": "https://www.bitstamp.net/api/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "AlphaPoint",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "introduction",
+ "TokenDataEnd": "blockquote",
+ "TextTokenData": "h3",
+ "RegExp": "revised-calls-\\d{1}-\\d{1}-\\d{1}-gt-\\d{1}-\\d{1}-\\d{1}",
+ "CheckString": "revised-calls-3-3-2-gt-3-3-3",
+ "Path": "https://alphapoint.github.io/slate/#introduction"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Yobit",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h2",
+ "Key": "id",
+ "CheckString": "v3",
+ "Path": "https://www.yobit.net/en/api/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "LocalBitcoins",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "div",
+ "Key": "class",
+ "Val": "col-md-12",
+ "RegExp": "col-md-12([\\s\\S]*?)clearfix",
+ "CheckString": "37a144dc619776b87c098da5a88bef7fed6c8a7cea2d4b9a38c96750726c93ff",
+ "Path": "https://localbitcoins.com/api-docs/"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "OkCoin International",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "a",
+ "Key": "href",
+ "Val": "./#change-change",
+ "TokenDataEnd": "./#change-",
+ "RegExp": "./#change-\\d{8}",
+ "CheckString": "20200229",
+ "Path": "https://www.okcoin.com/docs/en/#change-change"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Okex",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "a",
+ "Key": "href",
+ "Val": "./#change-change",
+ "TokenDataEnd": "./#change-",
+ "RegExp": "./#change-\\d{8}",
+ "CheckString": "20200331",
+ "Path": "https://www.okex.com/docs/en/#change-change"
+ }
+ },
+ "Disabled": false
+ },
+ {
+ "Name": "Gemini",
+ "CheckType": "HTML String Check",
+ "Data": {
+ "HTMLData": {
+ "TokenData": "h1",
+ "Key": "id",
+ "Val": "revision-history",
+ "TokenDataEnd": "table",
+ "TextTokenData": "td",
+ "DateFormat": "2006/01/02",
+ "RegExp": "^20(\\d){2}/(\\d){2}/(\\d){2}$",
+ "CheckString": "2020/03/05",
+ "Path": "https://docs.gemini.com/rest-api/#revision-history"
+ }
+ },
+ "Disabled": false
+ }
+ ]
+}
\ No newline at end of file
diff --git a/cmd/documentation/README.md b/cmd/documentation/README.md
index 38cce5cb..b4af59cd 100644
--- a/cmd/documentation/README.md
+++ b/cmd/documentation/README.md
@@ -14,7 +14,7 @@ This documentation 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/cmd/documentation/cmd_templates/apichecker.tmpl b/cmd/documentation/cmd_templates/apichecker.tmpl
new file mode 100644
index 00000000..353a2717
--- /dev/null
+++ b/cmd/documentation/cmd_templates/apichecker.tmpl
@@ -0,0 +1,98 @@
+{{define "cmd apichecker" -}}
+{{template "header" .}}
+## Current Features for {{.Name}}
+
++ Checks for API updates
++ Can automatically update Trello checklist for the updates required
++ Supports trello integration
+
+#### This tool tracks changes in exchange API documentation
+#### Keeps track of all the updates using the GoCryptoTrader trello board
+
+Be aware, this tool will:
+- Automatically update the live trello board if API keys and trello information are provided.
+- Automatically update the main json updates file, however a backup of the copy before the updates will be stored.
+
+## Usage
+
++ To run a real check for updates, parse Trello API info as flags or add them to the updates.json file and use the following command from apichecker folder in GCT:
+
+###### Linux/OSX
+GoCryptoTrader is built using [Go Modules](https://github.com/golang/go/wiki/Modules) and requires Go 1.11 or above
+Using Go Modules you now clone this repository **outside** your GOPATH
+
+```bash
+git clone https://github.com/thrasher-corp/gocryptotrader.git
+cd gocryptotrader/cmd/apichecker
+go build
+./apichecker
+```
+
+###### Windows
+
+```bash
+git clone https://github.com/thrasher-corp/gocryptotrader.git
+cd gocryptotrader\cmd\apichecker
+go build && apichecker.exe
+```
+
++ Upon addition of a new exchange, to update Trello checklist and to add the exchange to updates.json the following would need to be done:
+
+###### HTML Scraping method:
+HTMLScrapingData is a struct which contains the necessary information to scrape data from the given path website. Not all the elements of HTMLScrapingData are necessary, its all dependant on site where information is being extracted from. Regexp is used to capture necessary bits of data using r.FindString() where r is the declared regular expression. If update dates data is available, DateFormat is used to convert the dates to a more standard format which can then be used for further comparisons of which update is most recent.
+```go
+func TestAdd(t *testing.T) {
+ t.Parallel()
+ data := HTMLScrapingData{TokenData: "h1",
+ Key: "id",
+ Val: "revision-history",
+ TokenDataEnd: "table",
+ TextTokenData: "td",
+ DateFormat: "2006/01/02",
+ RegExp: "^20(\\d){2}/(\\d){2}/(\\d){2}$",
+ CheckString: "2019/11/15",
+ Path: "https://docs.gemini.com/rest-api/#revision-history"}
+ err := Add("Gemini", htmlScrape, data.Path, data, true, &testConfigData)
+ if err != nil {
+ t.Error(err)
+ }
+}
+```
+
+###### Github SHA Check Method:
+```go
+func TestAdd(t *testing.T) {
+ t.Parallel()
+ data := GithubData{Repo: "LBank-exchange/lbank-official-api-docs"}
+ err := Add("Lbank", github, fmt.Sprintf(githubPath, data.Repo), data, false, &configData)
+ if err != nil {
+ t.Error(err)
+ }
+}
+```
+
+###### Add using flags:
+```bash
+apichecker.exe -add=true -key=id -val=revision-history -tokendata=h1 -tokendataend=table -texttokendata=td -dateformat=2006/01/02 -checktype="HTML String Check" -regexp="^20(\d){2}/(\d){2}/(\d){2}$" -path="https://docs.gemini.com/rest-api/#revision-history" -exchangename=Gemini
+```
+
++ If all the authentication variables for trello are set trello checklist will be automatically updated with the format of 'Exchange Name (integer of how many updates have been released since the exchange API was last worked on):
+
+- To acquire your trello key and access token please login into trello using the following link and follow the steps: https://trello.com/app-key
+
+- To acquire BoardID, ListID, CardID and ChecklistID inbuilt functions can be used such as trelloGetAllLists()
+
+- To create a new list, card, checklist, and to populate the the checklist --create flag can be used.
+
+- To create a new check within a checklist, an inbuilt function within apichecker can be used: trelloCreateNewCheck
+
+- For the first time running the application & to create a list, card and checklist use the following:
+```bash
+apichecker.exe --create -apikey="insertkeyhere" -apitoken="inserttokenhere" -boardname="insertboardnamehere"
+```
+
+
+### Please click GoDocs chevron above to view current GoDoc information for this package
+{{template "contributions"}}
+{{template "donations" .}}
+{{end}}
\ No newline at end of file
diff --git a/cmd/documentation/documentation.go b/cmd/documentation/documentation.go
index 343408c3..f586dbf1 100644
--- a/cmd/documentation/documentation.go
+++ b/cmd/documentation/documentation.go
@@ -170,6 +170,16 @@ func main() {
contributors = append(contributors, []Contributor{
// idoall's contributors were forked and merged, so his contributions
// aren't automatically retrievable
+ {
+ Login: "DirectX",
+ URL: "https://github.com/DirectX",
+ Contributions: 1,
+ },
+ {
+ Login: "frankzougc",
+ URL: "https://github.com/frankzougc",
+ Contributions: 1,
+ },
{
Login: "idoall",
URL: "https://github.com/idoall",
diff --git a/cmd/documentation/sub_templates/header.tmpl b/cmd/documentation/sub_templates/header.tmpl
index 3a0880f3..36284bea 100644
--- a/cmd/documentation/sub_templates/header.tmpl
+++ b/cmd/documentation/sub_templates/header.tmpl
@@ -9,7 +9,7 @@ This {{.Name}} 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
{{end}}
diff --git a/cmd/exchange_template/readme_file.tmpl b/cmd/exchange_template/readme_file.tmpl
index b0c7b739..b7bee611 100644
--- a/cmd/exchange_template/readme_file.tmpl
+++ b/cmd/exchange_template/readme_file.tmpl
@@ -7,7 +7,7 @@ An exchange interface wrapper for the GoCryptoTrader application.
## 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).
+ You can track ideas, planned features and what's in progress on this Trello board: [https://trello.com/b/ZAhMhpOy/gocryptotrader](https://trello.com/b/ZAhMhpOy/gocryptotrader).
## Current {{.CapitalName}} Exchange Features
diff --git a/common/README.md b/common/README.md
index c711ff07..5c0a95dc 100644
--- a/common/README.md
+++ b/common/README.md
@@ -14,7 +14,7 @@ This common 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/common/common.go b/common/common.go
index 52a2205f..4a41be5d 100644
--- a/common/common.go
+++ b/common/common.go
@@ -159,7 +159,10 @@ func YesOrNo(input string) bool {
func SendHTTPRequest(method, urlPath string, headers map[string]string, body io.Reader) (string, error) {
result := strings.ToUpper(method)
- if result != http.MethodPost && result != http.MethodGet && result != http.MethodDelete {
+ if result != http.MethodOptions && result != http.MethodGet &&
+ result != http.MethodHead && result != http.MethodPost &&
+ result != http.MethodPut && result != http.MethodDelete &&
+ result != http.MethodTrace && result != http.MethodConnect {
return "", errors.New("invalid HTTP method specified")
}
diff --git a/communications/README.md b/communications/README.md
index 0a01dc30..6f9ffb5e 100644
--- a/communications/README.md
+++ b/communications/README.md
@@ -14,7 +14,7 @@ This comms 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/communications/base/README.md b/communications/base/README.md
index 932fe20c..0825572d 100644
--- a/communications/base/README.md
+++ b/communications/base/README.md
@@ -14,7 +14,7 @@ This base 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/communications/slack/README.md b/communications/slack/README.md
index 8c9954cb..5ff0b6f9 100644
--- a/communications/slack/README.md
+++ b/communications/slack/README.md
@@ -14,7 +14,7 @@ This slack 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/communications/smsglobal/README.md b/communications/smsglobal/README.md
index 7ad8f6b1..231c61a7 100644
--- a/communications/smsglobal/README.md
+++ b/communications/smsglobal/README.md
@@ -14,7 +14,7 @@ This smsglobal 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/communications/smtpservice/README.md b/communications/smtpservice/README.md
index 4553a656..d3768e5d 100644
--- a/communications/smtpservice/README.md
+++ b/communications/smtpservice/README.md
@@ -14,7 +14,7 @@ This smtp 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/communications/telegram/README.md b/communications/telegram/README.md
index 97053067..0be51d6d 100644
--- a/communications/telegram/README.md
+++ b/communications/telegram/README.md
@@ -14,7 +14,7 @@ This telegram 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/config/README.md b/config/README.md
index 80212cc6..40ab7127 100644
--- a/config/README.md
+++ b/config/README.md
@@ -14,7 +14,7 @@ This config 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/currency/README.md b/currency/README.md
index dbc6c985..e56dfe79 100644
--- a/currency/README.md
+++ b/currency/README.md
@@ -14,7 +14,7 @@ This currency 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/currency/forexprovider/README.md b/currency/forexprovider/README.md
index bf8aef44..4b8d0de5 100644
--- a/currency/forexprovider/README.md
+++ b/currency/forexprovider/README.md
@@ -14,7 +14,7 @@ This forexprovider 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/currency/forexprovider/base/README.md b/currency/forexprovider/base/README.md
index 7e8f859f..101cbc73 100644
--- a/currency/forexprovider/base/README.md
+++ b/currency/forexprovider/base/README.md
@@ -14,7 +14,7 @@ This forexprovider 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/currency/forexprovider/currencyconverterapi/README.md b/currency/forexprovider/currencyconverterapi/README.md
index fcd1c898..d4e59a74 100644
--- a/currency/forexprovider/currencyconverterapi/README.md
+++ b/currency/forexprovider/currencyconverterapi/README.md
@@ -14,7 +14,7 @@ This forexprovider 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/currency/forexprovider/currencylayer/README.md b/currency/forexprovider/currencylayer/README.md
index 1970d0c3..f86834ce 100644
--- a/currency/forexprovider/currencylayer/README.md
+++ b/currency/forexprovider/currencylayer/README.md
@@ -14,7 +14,7 @@ This forexprovider 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/currency/forexprovider/exchangeratesapi.io/README.md b/currency/forexprovider/exchangeratesapi.io/README.md
index 111f66d2..72a55be8 100644
--- a/currency/forexprovider/exchangeratesapi.io/README.md
+++ b/currency/forexprovider/exchangeratesapi.io/README.md
@@ -14,7 +14,7 @@ This forexprovider 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/currency/forexprovider/fixer.io/README.md b/currency/forexprovider/fixer.io/README.md
index ce39cd37..f6d6010c 100644
--- a/currency/forexprovider/fixer.io/README.md
+++ b/currency/forexprovider/fixer.io/README.md
@@ -14,7 +14,7 @@ This forexprovider 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/currency/forexprovider/openexchangerates/README.md b/currency/forexprovider/openexchangerates/README.md
index dc785126..da5c9c2c 100644
--- a/currency/forexprovider/openexchangerates/README.md
+++ b/currency/forexprovider/openexchangerates/README.md
@@ -14,7 +14,7 @@ This forexprovider 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/README.md b/exchanges/README.md
index 6843eca1..02689727 100644
--- a/exchanges/README.md
+++ b/exchanges/README.md
@@ -14,7 +14,7 @@ This exchanges 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/alphapoint/README.md b/exchanges/alphapoint/README.md
index a8476695..e79fa38f 100644
--- a/exchanges/alphapoint/README.md
+++ b/exchanges/alphapoint/README.md
@@ -14,7 +14,7 @@ This alphapoint 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/binance/README.md b/exchanges/binance/README.md
index 537f0235..a15e5513 100644
--- a/exchanges/binance/README.md
+++ b/exchanges/binance/README.md
@@ -14,7 +14,7 @@ This binance 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/bitfinex/README.md b/exchanges/bitfinex/README.md
index 72d2a2c7..bdfa7384 100644
--- a/exchanges/bitfinex/README.md
+++ b/exchanges/bitfinex/README.md
@@ -14,7 +14,7 @@ This bitfinex 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/bitflyer/README.md b/exchanges/bitflyer/README.md
index 7c3aa018..509de9c5 100644
--- a/exchanges/bitflyer/README.md
+++ b/exchanges/bitflyer/README.md
@@ -14,7 +14,7 @@ This bitflyer 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/bithumb/README.md b/exchanges/bithumb/README.md
index 91e19bb6..c6c05e4f 100644
--- a/exchanges/bithumb/README.md
+++ b/exchanges/bithumb/README.md
@@ -14,7 +14,7 @@ This bithumb 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/bitmex/README.md b/exchanges/bitmex/README.md
index 3a3f72c8..5ca4466e 100644
--- a/exchanges/bitmex/README.md
+++ b/exchanges/bitmex/README.md
@@ -14,7 +14,7 @@ This bitmex 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/bitstamp/README.md b/exchanges/bitstamp/README.md
index 24d3a721..05eea3e2 100644
--- a/exchanges/bitstamp/README.md
+++ b/exchanges/bitstamp/README.md
@@ -14,7 +14,7 @@ This bitstamp 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/bittrex/README.md b/exchanges/bittrex/README.md
index 60d1d7a7..4d6e186e 100644
--- a/exchanges/bittrex/README.md
+++ b/exchanges/bittrex/README.md
@@ -14,7 +14,7 @@ This bittrex 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/btcmarkets/README.md b/exchanges/btcmarkets/README.md
index 51605af7..e9ce7ee8 100644
--- a/exchanges/btcmarkets/README.md
+++ b/exchanges/btcmarkets/README.md
@@ -14,7 +14,7 @@ This btcmarkets 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/btse/README.md b/exchanges/btse/README.md
index 53c100ce..78a2e90c 100644
--- a/exchanges/btse/README.md
+++ b/exchanges/btse/README.md
@@ -14,7 +14,7 @@ This btse 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/coinbasepro/README.md b/exchanges/coinbasepro/README.md
index 4574a344..424ade60 100644
--- a/exchanges/coinbasepro/README.md
+++ b/exchanges/coinbasepro/README.md
@@ -14,7 +14,7 @@ This coinbasepro 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/coinbasepro/coinbasepro_websocket.go b/exchanges/coinbasepro/coinbasepro_websocket.go
index a6b333ff..bb0f01c6 100644
--- a/exchanges/coinbasepro/coinbasepro_websocket.go
+++ b/exchanges/coinbasepro/coinbasepro_websocket.go
@@ -393,7 +393,7 @@ func (c *CoinbasePro) Subscribe(channelToSubscribe wshandler.WebsocketChannelSub
}
if channelToSubscribe.Channel == "user" || channelToSubscribe.Channel == "full" {
n := strconv.FormatInt(time.Now().Unix(), 10)
- message := n + "GET" + "/users/self/verify"
+ message := n + http.MethodGet + "/users/self/verify"
hmac := crypto.GetHMAC(crypto.HashSHA256, []byte(message),
[]byte(c.API.Credentials.Secret))
subscribe.Signature = crypto.Base64Encode(hmac)
diff --git a/exchanges/coinbene/README.md b/exchanges/coinbene/README.md
index 13106aeb..1f8c2e0b 100644
--- a/exchanges/coinbene/README.md
+++ b/exchanges/coinbene/README.md
@@ -14,7 +14,7 @@ This coinbene 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/coinut/README.md b/exchanges/coinut/README.md
index 2220d38b..5147ae9d 100644
--- a/exchanges/coinut/README.md
+++ b/exchanges/coinut/README.md
@@ -14,7 +14,7 @@ This coinut 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/exmo/README.md b/exchanges/exmo/README.md
index a7366558..7471069d 100644
--- a/exchanges/exmo/README.md
+++ b/exchanges/exmo/README.md
@@ -14,7 +14,7 @@ This exmo 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/gateio/README.md b/exchanges/gateio/README.md
index 844979fb..1ef262ec 100644
--- a/exchanges/gateio/README.md
+++ b/exchanges/gateio/README.md
@@ -14,7 +14,7 @@ This gateio 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/gemini/README.md b/exchanges/gemini/README.md
index 8ddad4dd..01c2cec6 100644
--- a/exchanges/gemini/README.md
+++ b/exchanges/gemini/README.md
@@ -14,7 +14,7 @@ This gemini 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/hitbtc/README.md b/exchanges/hitbtc/README.md
index 3c22c1ce..b4327a5e 100644
--- a/exchanges/hitbtc/README.md
+++ b/exchanges/hitbtc/README.md
@@ -14,7 +14,7 @@ This hitbtc 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/huobi/README.md b/exchanges/huobi/README.md
index 99fe3622..04562fae 100644
--- a/exchanges/huobi/README.md
+++ b/exchanges/huobi/README.md
@@ -14,7 +14,7 @@ This huobi 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/huobi/huobi_websocket.go b/exchanges/huobi/huobi_websocket.go
index cfa6724a..4f773411 100644
--- a/exchanges/huobi/huobi_websocket.go
+++ b/exchanges/huobi/huobi_websocket.go
@@ -485,7 +485,7 @@ func (h *HUOBI) wsGenerateSignature(timestamp, endpoint string) []byte {
values.Set("Timestamp", timestamp)
host := "api.huobi.pro"
payload := fmt.Sprintf("%s\n%s\n%s\n%s",
- "GET", host, endpoint, values.Encode())
+ http.MethodGet, host, endpoint, values.Encode())
return crypto.GetHMAC(crypto.HashSHA256, []byte(payload), []byte(h.API.Credentials.Secret))
}
diff --git a/exchanges/itbit/README.md b/exchanges/itbit/README.md
index f7df3c4d..0ca96912 100644
--- a/exchanges/itbit/README.md
+++ b/exchanges/itbit/README.md
@@ -14,7 +14,7 @@ This itbit 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/kraken/README.md b/exchanges/kraken/README.md
index a2646e19..6b6b4e8a 100644
--- a/exchanges/kraken/README.md
+++ b/exchanges/kraken/README.md
@@ -14,7 +14,7 @@ This kraken 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/lakebtc/README.md b/exchanges/lakebtc/README.md
index 1ff26915..f8c393ee 100644
--- a/exchanges/lakebtc/README.md
+++ b/exchanges/lakebtc/README.md
@@ -14,7 +14,7 @@ This lakebtc 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/lbank/README.md b/exchanges/lbank/README.md
index f596236b..042a01e6 100644
--- a/exchanges/lbank/README.md
+++ b/exchanges/lbank/README.md
@@ -14,7 +14,7 @@ This lbank 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/localbitcoins/README.md b/exchanges/localbitcoins/README.md
index 9a9d01a8..492324fc 100644
--- a/exchanges/localbitcoins/README.md
+++ b/exchanges/localbitcoins/README.md
@@ -14,7 +14,7 @@ This localbitcoins 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/mock/README.md b/exchanges/mock/README.md
index 96239a08..1f25b967 100644
--- a/exchanges/mock/README.md
+++ b/exchanges/mock/README.md
@@ -14,7 +14,7 @@ This Mock 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/nonce/README.md b/exchanges/nonce/README.md
index 14ff1af5..527c67fb 100644
--- a/exchanges/nonce/README.md
+++ b/exchanges/nonce/README.md
@@ -14,7 +14,7 @@ This nonce 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/okcoin/README.md b/exchanges/okcoin/README.md
index 9fb1b00a..7c496881 100644
--- a/exchanges/okcoin/README.md
+++ b/exchanges/okcoin/README.md
@@ -14,7 +14,7 @@ This okcoin 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/okex/README.md b/exchanges/okex/README.md
index 5afb6346..e297d14f 100644
--- a/exchanges/okex/README.md
+++ b/exchanges/okex/README.md
@@ -14,7 +14,7 @@ This okex 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/okgroup/README.md b/exchanges/okgroup/README.md
index e986882f..067b8f53 100644
--- a/exchanges/okgroup/README.md
+++ b/exchanges/okgroup/README.md
@@ -14,7 +14,7 @@ This okex 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).
+You can track ideas, planned features and what's in progress 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/)
diff --git a/exchanges/order/README.md b/exchanges/order/README.md
index 19692d0a..c3545244 100644
--- a/exchanges/order/README.md
+++ b/exchanges/order/README.md
@@ -14,7 +14,7 @@ This orders 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/orderbook/README.md b/exchanges/orderbook/README.md
index f05429ed..b8998602 100644
--- a/exchanges/orderbook/README.md
+++ b/exchanges/orderbook/README.md
@@ -14,7 +14,7 @@ This orderbook 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/poloniex/README.md b/exchanges/poloniex/README.md
index 685235b9..d8e06503 100644
--- a/exchanges/poloniex/README.md
+++ b/exchanges/poloniex/README.md
@@ -14,7 +14,7 @@ This poloniex 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/request/README.md b/exchanges/request/README.md
index 0335cee4..fec9d343 100644
--- a/exchanges/request/README.md
+++ b/exchanges/request/README.md
@@ -14,7 +14,7 @@ This request 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/stats/README.md b/exchanges/stats/README.md
index ae31f817..dc6c81af 100644
--- a/exchanges/stats/README.md
+++ b/exchanges/stats/README.md
@@ -14,7 +14,7 @@ This stats 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/ticker/README.md b/exchanges/ticker/README.md
index 049bc7f9..a505906f 100644
--- a/exchanges/ticker/README.md
+++ b/exchanges/ticker/README.md
@@ -14,7 +14,7 @@ This ticker 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/yobit/README.md b/exchanges/yobit/README.md
index c7df0c6b..6101d2c6 100644
--- a/exchanges/yobit/README.md
+++ b/exchanges/yobit/README.md
@@ -14,7 +14,7 @@ This yobit 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/exchanges/zb/README.md b/exchanges/zb/README.md
index 107d497a..0fd2bf48 100644
--- a/exchanges/zb/README.md
+++ b/exchanges/zb/README.md
@@ -14,7 +14,7 @@ This zb 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/go.mod b/go.mod
index c53664b0..876d2299 100644
--- a/go.mod
+++ b/go.mod
@@ -23,6 +23,7 @@ require (
github.com/urfave/cli v1.22.3
github.com/volatiletech/null v8.0.0+incompatible
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5
+ golang.org/x/net v0.0.0-20191002035440-2ec189313ef0
golang.org/x/sys v0.0.0-20191003212358-c178f38b412c // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
google.golang.org/genproto v0.0.0-20191002211648-c459b9ce5143
diff --git a/portfolio/README.md b/portfolio/README.md
index 0a1d2c77..79548689 100644
--- a/portfolio/README.md
+++ b/portfolio/README.md
@@ -14,7 +14,7 @@ This portfolio 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/testdata/README.md b/testdata/README.md
index 24b3f7ee..2461713c 100644
--- a/testdata/README.md
+++ b/testdata/README.md
@@ -14,7 +14,7 @@ This testdata 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
diff --git a/web/README.md b/web/README.md
index 35e0b41b..4087fbbf 100644
--- a/web/README.md
+++ b/web/README.md
@@ -14,7 +14,7 @@ This web 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).
+You can track ideas, planned features and what's in progress 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://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)