mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-19 23:16:48 +00:00
localbitcoins fixes (#177)
* General LocalBitcoin fixes * Added override variables to config for exchange packages to allow different API URL's
This commit is contained in:
@@ -54,6 +54,7 @@ const (
|
||||
WarningExchangeAuthAPIDefaultOrEmptyValues = "WARNING -- Exchange %s: Authenticated API support disabled due to default/empty APIKey/Secret/ClientID values."
|
||||
WarningCurrencyExchangeProvider = "WARNING -- Currency exchange provider invalid valid. Reset to Fixer."
|
||||
WarningPairsLastUpdatedThresholdExceeded = "WARNING -- Exchange %s: Last manual update of available currency pairs has exceeded %d days. Manual update required!"
|
||||
APIURLDefaultMessage = "NON_DEFAULT_HTTP_LINK_TO_EXCHANGE_API"
|
||||
)
|
||||
|
||||
// Variables here are used for configuration
|
||||
@@ -123,6 +124,8 @@ type ExchangeConfig struct {
|
||||
APIKey string `json:"apiKey"`
|
||||
APISecret string `json:"apiSecret"`
|
||||
APIAuthPEMKey string `json:"apiAuthPemKey,omitempty"`
|
||||
APIURL string `json:"apiUrl"`
|
||||
APIURLSecondary string `json:"apiUrlSecondary"`
|
||||
ClientID string `json:"clientId,omitempty"`
|
||||
AvailablePairs string `json:"availablePairs"`
|
||||
EnabledPairs string `json:"enabledPairs"`
|
||||
@@ -618,6 +621,20 @@ func (c *Config) CheckExchangeConfigValues() error {
|
||||
c.Exchanges[i].Name = "CoinbasePro"
|
||||
}
|
||||
|
||||
if exch.APIURL != APIURLDefaultMessage {
|
||||
if exch.APIURL == "" {
|
||||
// Set default if nothing set
|
||||
c.Exchanges[i].APIURL = APIURLDefaultMessage
|
||||
}
|
||||
}
|
||||
|
||||
if exch.APIURLSecondary != APIURLDefaultMessage {
|
||||
if exch.APIURLSecondary == "" {
|
||||
// Set default if nothing set
|
||||
c.Exchanges[i].APIURLSecondary = APIURLDefaultMessage
|
||||
}
|
||||
}
|
||||
|
||||
if exch.Enabled {
|
||||
if exch.Name == "" {
|
||||
return fmt.Errorf(ErrExchangeNameEmpty, i)
|
||||
|
||||
Reference in New Issue
Block a user