Prevent authenticated calls when authenticated API support is disabled

This commit is contained in:
Adrian Gallagher
2017-08-21 13:10:57 +10:00
parent 4f34b58d55
commit 4eaa9d0ec9
21 changed files with 93 additions and 6 deletions

View File

@@ -509,6 +509,10 @@ func (k *Kraken) CancelOrder(orderID int64) {
}
func (k *Kraken) SendAuthenticatedHTTPRequest(method string, values url.Values) (interface{}, error) {
if !k.AuthenticatedAPISupport {
return nil, fmt.Errorf(exchange.WarningAuthenticatedRequestWithoutCredentialsSet, k.Name)
}
path := fmt.Sprintf("/%s/private/%s", KRAKEN_API_VERSION, method)
values.Set("nonce", strconv.FormatInt(time.Now().UnixNano(), 10))
secret, err := common.Base64Decode(k.APISecret)