Skip to content

Commit

Permalink
exchanges: Remove LocalBitcoins and fix Bybit tests (thrasher-corp#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
thrasher- authored Feb 22, 2023
1 parent e94f9bb commit e44ae3d
Show file tree
Hide file tree
Showing 32 changed files with 14 additions and 10,638 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader
| ItBit | Yes | NA | No |
| Kraken | Yes | Yes | NA |
| Lbank | Yes | No | NA |
| LocalBitcoins | Yes | NA | NA |
| OKCoin International | Yes | Yes | No |
| Okx | Yes | Yes | NA |
| Poloniex | Yes | Yes | NA |
Expand Down
30 changes: 0 additions & 30 deletions cmd/apichecker/apicheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"time"

"github.com/thrasher-corp/gocryptotrader/common"
"github.com/thrasher-corp/gocryptotrader/common/crypto"
gctfile "github.com/thrasher-corp/gocryptotrader/common/file"
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
"github.com/thrasher-corp/gocryptotrader/exchanges/request"
Expand Down Expand Up @@ -48,7 +47,6 @@ const (
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"
Expand Down Expand Up @@ -488,8 +486,6 @@ func checkChangeLog(htmlData *HTMLScrapingData) (string, error) {
dataStrings, err = htmlScrapeAlphaPoint(htmlData)
case pathYobit:
dataStrings, err = htmlScrapeYobit(htmlData)
case pathLocalBitcoins:
dataStrings, err = htmlScrapeLocalBitcoins(htmlData)
case pathOkCoin:
dataStrings, err = htmlScrapeOk(htmlData)
default:
Expand Down Expand Up @@ -1137,32 +1133,6 @@ loop:
return resp, nil
}

// htmlScrapeLocalBitcoins gets the check string for Yobit Exchange
func htmlScrapeLocalBitcoins(htmlData *HTMLScrapingData) ([]string, error) {
temp, err := sendHTTPGetRequest(htmlData.Path, nil)
if err != nil {
return nil, err
}
defer temp.Body.Close()

a, err := io.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, err := crypto.GetSHA256([]byte(str))
if err != nil {
return nil, err
}
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, "")
Expand Down
10 changes: 0 additions & 10 deletions cmd/apichecker/apicheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,6 @@ func TestHTMLYobit(t *testing.T) {
}
}

func TestHTMLScrapeLocalBitcoins(t *testing.T) {
t.Parallel()
data := HTMLScrapingData{TokenData: "div",
RegExp: `col-md-12([\s\S]*?)clearfix`,
Path: "https://localbitcoins.com/api-docs/"}
if _, err := htmlScrapeLocalBitcoins(&data); err != nil {
t.Error(err)
}
}

func TestHTMLScrapeOk(t *testing.T) {
t.Parallel()
data := HTMLScrapingData{TokenData: "a",
Expand Down
15 changes: 0 additions & 15 deletions cmd/apichecker/testupdates.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,21 +327,6 @@
},
"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",
Expand Down
15 changes: 0 additions & 15 deletions cmd/apichecker/updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,21 +327,6 @@
},
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ _b in this context is an `IBotExchange` implemented struct_
| ItBit | Yes | NA | No |
| Kraken | Yes | Yes | No |
| Lbank | Yes | No | Yes |
| LocalBitcoins | Yes | NA | No |
| OKCoin International | Yes | Yes | No |
| Okx | Yes | Yes | Yes |
| Poloniex | Yes | Yes | Yes |
Expand Down
98 changes: 0 additions & 98 deletions cmd/documentation/exchanges_templates/localbitcoins.tmpl

This file was deleted.

1 change: 0 additions & 1 deletion cmd/documentation/root_templates/root_readme.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader
| ItBit | Yes | NA | No |
| Kraken | Yes | Yes | NA |
| Lbank | Yes | No | NA |
| LocalBitcoins | Yes | NA | NA |
| OKCoin International | Yes | Yes | No |
| Okx | Yes | Yes | NA |
| Poloniex | Yes | Yes | NA |
Expand Down
5 changes: 0 additions & 5 deletions cmd/exchange_wrapper_issues/wrapperconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@
"secret": "Secret",
"otpSecret": "-"
},
"localbitcoins": {
"key": "Key",
"secret": "Secret",
"otpSecret": "-"
},
"okcoin international": {
"key": "Key",
"secret": "Secret",
Expand Down
4 changes: 2 additions & 2 deletions common/file/archive/zip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ func TestZip(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if filepath.Base(o[0]) != "binance.json" || filepath.Base(o[4]) != "localbitcoins.json" {
if filepath.Base(o[0]) != "binance.json" {
t.Fatal("unexpected archive result received")
}
if expected := 7; len(o) != expected {
if expected := 6; len(o) != expected {
t.Fatalf("expected %v files to be extracted received: %v ", expected, len(o))
}

Expand Down
76 changes: 0 additions & 76 deletions config_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2020,82 +2020,6 @@
}
]
},
{
"name": "LocalBitcoins",
"enabled": true,
"verbose": false,
"httpTimeout": 15000000000,
"websocketResponseCheckTimeout": 30000000,
"websocketResponseMaxLimit": 7000000000,
"websocketTrafficTimeout": 30000000000,
"websocketOrderbookBufferLimit": 5,
"baseCurrencies": "ARS,AUD,BRL,CAD,CHF,CZK,DKK,EUR,GBP,HKD,ILS,INR,MXN,NOK,NZD,PLN,RUB,SEK,SGD,THB,USD,ZAR",
"currencyPairs": {
"requestFormat": {
"uppercase": true
},
"configFormat": {
"uppercase": true
},
"useGlobalFormat": true,
"assetTypes": [
"spot"
],
"pairs": {
"spot": {
"enabled": "BTCAUD,BTCUSD",
"available": "BTCBOB,BTCCZK,BTCUAH,BTCKZT,BTCPAB,BTCPLN,BTCJMD,BTCSZL,BTCILS,BTCMAD,BTCCOP,BTCHRK,BTCEUR,BTCUYU,BTCRSD,BTCPEN,BTCJOD,BTCCHF,BTCKWD,BTCAOA,BTCRUB,BTCVND,BTCRON,BTCHNL,BTCLTC,BTCCLP,BTCNOK,BTCINR,BTCQAR,BTCPKR,BTCTZS,BTCUGX,BTCZMW,BTCXAF,BTCBDT,BTCUSD,BTCDKK,BTCPYG,BTCTHB,BTCSEK,BTCSGD,BTCGEL,BTCBYN,BTCTWD,BTCAED,BTCCAD,BTCAUD,BTCKRW,BTCBRL,BTCCRC,BTCETH,BTCHKD,BTCBWP,BTCXRP,BTCZAR,BTCVES,BTCAMD,BTCSAR,BTCPHP,BTCMVR,BTCGTQ,BTCLKR,BTCCDF,BTCARS,BTCEGP,BTCOMR,BTCNZD,BTCNGN,BTCGBP,BTCMWK,BTCXOF,BTCGHS,BTCDOP,BTCKES,BTCIDR,BTCJPY,BTCNAD,BTCMYR,BTCMUR,BTCCNY,BTCRWF,BTCTRY,BTCMXN"
}
}
},
"api": {
"authenticatedSupport": false,
"authenticatedWebsocketApiSupport": false,
"endpoints": {
"url": "NON_DEFAULT_HTTP_LINK_TO_EXCHANGE_API",
"urlSecondary": "NON_DEFAULT_HTTP_LINK_TO_EXCHANGE_API",
"websocketURL": "NON_DEFAULT_HTTP_LINK_TO_WEBSOCKET_EXCHANGE_API"
},
"credentials": {
"key": "Key",
"secret": "Secret"
},
"credentialsValidator": {
"requiresKey": true,
"requiresSecret": true
}
},
"features": {
"supports": {
"restAPI": true,
"restCapabilities": {
"tickerBatching": true,
"autoPairUpdates": true
},
"websocketAPI": false,
"websocketCapabilities": {}
},
"enabled": {
"autoPairUpdates": true,
"websocketAPI": false
}
},
"bankAccounts": [
{
"enabled": false,
"bankName": "",
"bankAddress": "",
"bankPostalCode": "",
"bankPostalCity": "",
"bankCountry": "",
"accountName": "",
"accountNumber": "",
"swiftCode": "",
"iban": "",
"supportedCurrencies": ""
}
]
},
{
"name": "OKCOIN International",
"enabled": true,
Expand Down
2 changes: 0 additions & 2 deletions docs/ADD_NEW_EXCHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ Yes means supported, No means not yet implemented and NA means protocol unsuppor
| ItBit | Yes | NA | No |
| Kraken | Yes | Yes | NA |
| Lbank | Yes | No | NA |
| LocalBitcoins | Yes | NA | NA |
| OKCoin International | Yes | Yes | No |
| Okx | Yes | Yes | NA |
| Poloniex | Yes | Yes | NA |
Expand Down Expand Up @@ -247,7 +246,6 @@ var Exchanges = []string{
"itbit",
"kraken",
"lbank",
"localbitcoins",
"okcoin international",
"okx",
"poloniex",
Expand Down
1 change: 0 additions & 1 deletion docs/MULTICHAIN_TRANSFER_SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ $ ./gctcli withdrawcryptofunds --exchange=binance --currency=USDT --address=TJU9
| ItBit | No | No | |
| Kraken | Yes | Yes | Front-end and API don't match total available transfer chains |
| Lbank | No | No | |
| LocalBitcoins | No | No | Supports BTC only |
| OKCoin International | No | No | Requires API update to version 5 |
| Okx | Yes | Yes | |
| Poloniex | Yes | Yes | |
Expand Down
3 changes: 1 addition & 2 deletions docs/OHLCV.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ A helper tool [cmd/dbseed](../cmd/dbseed/README.md) has been created for assisti
| Huobi | Y |
| itBIT | |
| Kraken | Y |
| lBank | Y |
| Localbitcoins | |
| lBank | Y |
| Okcoin | Y |
| Okx | Y |
| Poloniex | Y |
Expand Down
Loading

0 comments on commit e44ae3d

Please sign in to comment.