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

@@ -3,6 +3,7 @@ package coinut
import (
"bytes"
"errors"
"fmt"
"log"
"time"
@@ -271,6 +272,10 @@ func (c *COINUT) GetOpenPosition(instrumentID int) ([]CoinutOpenPosition, error)
//to-do: user position update via websocket
func (c *COINUT) SendAuthenticatedHTTPRequest(apiRequest string, params map[string]interface{}, result interface{}) (err error) {
if !c.AuthenticatedAPISupport {
return fmt.Errorf(exchange.WarningAuthenticatedRequestWithoutCredentialsSet, c.Name)
}
timestamp := time.Now().Unix()
payload := []byte("")