Remove OKCoin China exchange support

This commit is contained in:
Adrian Gallagher
2019-02-08 14:03:28 +11:00
parent 26d67f5228
commit ef51b59c8b
7 changed files with 16 additions and 131 deletions

View File

@@ -41,7 +41,6 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader
| Kraken | Yes | NA | NA |
| LakeBTC | Yes | No | NA |
| LocalBitcoins | Yes | NA | NA |
| OKCoin China | Yes | Yes | No |
| OKCoin International | Yes | Yes | No |
| OKEX | Yes | Yes | No |
| Poloniex | Yes | Yes | NA |

View File

@@ -11,7 +11,7 @@ import (
const (
// Default number of enabled exchanges. Modify this whenever an exchange is
// added or removed
defaultEnabledExchanges = 28
defaultEnabledExchanges = 27
)
func TestGetCurrencyConfig(t *testing.T) {

View File

@@ -1025,47 +1025,6 @@
}
]
},
{
"name": "OKCOIN China",
"enabled": true,
"verbose": false,
"websocket": false,
"useSandbox": false,
"restPollingDelay": 10,
"httpTimeout": 15000000000,
"httpUserAgent": "",
"authenticatedApiSupport": false,
"apiKey": "Key",
"apiSecret": "Secret",
"apiUrl": "NON_DEFAULT_HTTP_LINK_TO_EXCHANGE_API",
"apiUrlSecondary": "NON_DEFAULT_HTTP_LINK_TO_EXCHANGE_API",
"proxyAddress": "",
"websocketUrl": "NON_DEFAULT_HTTP_LINK_TO_WEBSOCKET_EXCHANGE_API",
"availablePairs": "BTCCNY,LTCCNY",
"enabledPairs": "BTCCNY,LTCCNY",
"baseCurrencies": "CNY",
"assetTypes": "SPOT",
"supportsAutoPairUpdates": false,
"pairsLastUpdated": 1545884823,
"configCurrencyPairFormat": {
"uppercase": true
},
"requestCurrencyPairFormat": {
"uppercase": false,
"delimiter": "_"
},
"bankAccounts": [
{
"bankName": "",
"bankAddress": "",
"accountName": "",
"accountNumber": "",
"swiftCode": "",
"iban": "",
"supportedCurrencies": ""
}
]
},
{
"name": "OKCOIN International",
"enabled": true,

View File

@@ -178,8 +178,6 @@ func LoadExchange(name string, useWG bool, wg *sync.WaitGroup) error {
exch = new(lakebtc.LakeBTC)
case "localbitcoins":
exch = new(localbitcoins.LocalBitcoins)
case "okcoin china":
exch = new(okcoin.OKCoin)
case "okcoin international":
exch = new(okcoin.OKCoin)
case "okex":

View File

@@ -9,11 +9,10 @@ import (
"strings"
"time"
"github.com/thrasher-/gocryptotrader/currency/symbol"
"github.com/gorilla/websocket"
"github.com/thrasher-/gocryptotrader/common"
"github.com/thrasher-/gocryptotrader/config"
"github.com/thrasher-/gocryptotrader/currency/symbol"
exchange "github.com/thrasher-/gocryptotrader/exchanges"
"github.com/thrasher-/gocryptotrader/exchanges/request"
"github.com/thrasher-/gocryptotrader/exchanges/ticker"
@@ -22,11 +21,9 @@ import (
const (
okcoinAPIURL = "https://www.okcoin.com/api/v1/"
okcoinAPIURLChina = "https://www.okcoin.com/api/v1/"
okcoinAPIURLBase = "https://www.okcoin.com/api/"
okcoinAPIVersion = "1"
okcoinWebsocketURL = "wss://real.okcoin.com:10440/websocket/okcoinapi"
okcoinWebsocketURLChina = "wss://real.okcoin.cn:10440/websocket/okcoinapi"
okcoinInstruments = "instruments"
okcoinTicker = "ticker.do"
okcoinDepth = "depth.do"
@@ -86,14 +83,6 @@ type OKCoin struct {
WebsocketConn *websocket.Conn
}
// setCurrencyPairFormats sets currency pair formatting for this package
func (o *OKCoin) setCurrencyPairFormats() {
o.RequestCurrencyPairFormat.Delimiter = "_"
o.RequestCurrencyPairFormat.Uppercase = false
o.ConfigCurrencyPairFormat.Delimiter = ""
o.ConfigCurrencyPairFormat.Uppercase = true
}
// SetDefaults sets current default values for this package
func (o *OKCoin) SetDefaults() {
o.SetErrorDefaults()
@@ -117,40 +106,22 @@ func (o *OKCoin) Setup(exch config.ExchangeConfig) {
if !exch.Enabled {
o.SetEnabled(false)
} else {
if exch.Name == "OKCOIN International" {
o.AssetTypes = append(o.AssetTypes, o.FuturesValues...)
o.APIUrlDefault = okcoinAPIURL
o.APIUrl = o.APIUrlDefault
o.Name = "OKCOIN International"
o.WebsocketURL = okcoinWebsocketURL
o.setCurrencyPairFormats()
o.Requester = request.New(o.Name,
request.NewRateLimit(time.Second, okcoinAuthRate),
request.NewRateLimit(time.Second, okcoinUnauthRate),
common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
o.ConfigCurrencyPairFormat.Delimiter = "_"
o.ConfigCurrencyPairFormat.Uppercase = true
o.RequestCurrencyPairFormat.Uppercase = false
o.RequestCurrencyPairFormat.Delimiter = "_"
o.SupportsAutoPairUpdating = true
} else {
o.APIUrlDefault = okcoinAPIURLChina
o.APIUrl = o.APIUrlDefault
o.Name = "OKCOIN China"
o.WebsocketURL = okcoinWebsocketURLChina
o.setCurrencyPairFormats()
o.Requester = request.New(o.Name,
request.NewRateLimit(time.Second, okcoinAuthRate),
request.NewRateLimit(time.Second, okcoinUnauthRate),
common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
o.ConfigCurrencyPairFormat.Delimiter = ""
o.ConfigCurrencyPairFormat.Uppercase = true
o.RequestCurrencyPairFormat.Uppercase = false
o.RequestCurrencyPairFormat.Delimiter = ""
}
o.Name = "OKCOIN International"
o.Enabled = true
o.AuthenticatedAPISupport = exch.AuthenticatedAPISupport
o.AssetTypes = append(o.AssetTypes, o.FuturesValues...)
o.APIUrlDefault = okcoinAPIURL
o.APIUrl = o.APIUrlDefault
o.WebsocketURL = okcoinWebsocketURL
o.Requester = request.New(o.Name,
request.NewRateLimit(time.Second, okcoinAuthRate),
request.NewRateLimit(time.Second, okcoinUnauthRate),
common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
o.ConfigCurrencyPairFormat.Delimiter = "_"
o.ConfigCurrencyPairFormat.Uppercase = true
o.RequestCurrencyPairFormat.Uppercase = false
o.RequestCurrencyPairFormat.Delimiter = "_"
o.SupportsAutoPairUpdating = true
o.SetAPIKeys(exch.APIKey, exch.APISecret, "", false)
o.SetHTTPClientTimeout(exch.HTTPTimeout)
o.SetHTTPClientUserAgent(exch.HTTPUserAgent)

View File

@@ -995,47 +995,6 @@
}
]
},
{
"name": "OKCOIN China",
"enabled": true,
"verbose": false,
"websocket": false,
"useSandbox": false,
"restPollingDelay": 10,
"httpTimeout": 15000000000,
"httpUserAgent": "",
"authenticatedApiSupport": false,
"apiKey": "Key",
"apiSecret": "Secret",
"apiUrl": "NON_DEFAULT_HTTP_LINK_TO_EXCHANGE_API",
"apiUrlSecondary": "NON_DEFAULT_HTTP_LINK_TO_EXCHANGE_API",
"proxyAddress": "",
"websocketUrl": "NON_DEFAULT_HTTP_LINK_TO_WEBSOCKET_EXCHANGE_API",
"availablePairs": "BTCCNY,LTCCNY",
"enabledPairs": "BTCCNY,LTCCNY",
"baseCurrencies": "CNY",
"assetTypes": "SPOT",
"supportsAutoPairUpdates": false,
"pairsLastUpdated": 1545884823,
"configCurrencyPairFormat": {
"uppercase": true
},
"requestCurrencyPairFormat": {
"uppercase": false,
"delimiter": "_"
},
"bankAccounts": [
{
"bankName": "",
"bankAddress": "",
"accountName": "",
"accountNumber": "",
"swiftCode": "",
"iban": "",
"supportedCurrencies": ""
}
]
},
{
"name": "OKCOIN International",
"enabled": true,

View File

@@ -42,7 +42,6 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader
| Kraken | Yes | NA | NA |
| LakeBTC | Yes | No | NA |
| LocalBitcoins | Yes | NA | NA |
| OKCoin China | Yes | Yes | No |
| OKCoin International | Yes | Yes | No |
| OKEX | Yes | Yes | No |
| Poloniex | Yes | Yes | NA |