mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Remove OKCoin China exchange support
This commit is contained in:
@@ -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 |
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -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)
|
||||
|
||||
41
testdata/configtest.json
vendored
41
testdata/configtest.json
vendored
@@ -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,
|
||||
|
||||
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user