diff --git a/.gitignore b/.gitignore index 09c57015..d4714c73 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ vendor/ # Binaries for programs and plugins gocryptotrader +cmd/gctcli/gctcli *.exe *.exe~ *.dll diff --git a/exchanges/coinbasepro/coinbasepro.go b/exchanges/coinbasepro/coinbasepro.go index dea502e7..c234616b 100644 --- a/exchanges/coinbasepro/coinbasepro.go +++ b/exchanges/coinbasepro/coinbasepro.go @@ -9,6 +9,7 @@ import ( "net/url" "strconv" "strings" + "time" "github.com/thrasher-corp/gocryptotrader/common" "github.com/thrasher-corp/gocryptotrader/common/crypto" @@ -729,7 +730,7 @@ func (c *CoinbasePro) SendHTTPRequest(path string, result interface{}) error { }) } -// SendAuthenticatedHTTPRequest sends an authenticated HTTP reque +// SendAuthenticatedHTTPRequest sends an authenticated HTTP request func (c *CoinbasePro) SendAuthenticatedHTTPRequest(method, path string, params map[string]interface{}, result interface{}) (err error) { if !c.AllowAuthenticatedRequest() { return fmt.Errorf(exchange.WarningAuthenticatedRequestWithoutCredentialsSet, @@ -749,7 +750,7 @@ func (c *CoinbasePro) SendAuthenticatedHTTPRequest(method, path string, params m } } - n := c.Requester.GetNonce(false).String() + n := strconv.FormatInt(time.Now().Unix(), 10) message := n + method + "/" + path + string(payload) hmac := crypto.GetHMAC(crypto.HashSHA256, []byte(message), []byte(c.API.Credentials.Secret)) headers := make(map[string]string) @@ -766,7 +767,6 @@ func (c *CoinbasePro) SendAuthenticatedHTTPRequest(method, path string, params m Body: bytes.NewBuffer(payload), Result: result, AuthRequest: true, - NonceEnabled: true, Verbose: c.Verbose, HTTPDebugging: c.HTTPDebugging, HTTPRecording: c.HTTPRecording, diff --git a/exchanges/coinbasepro/coinbasepro_wrapper.go b/exchanges/coinbasepro/coinbasepro_wrapper.go index 31764024..8bd684cc 100644 --- a/exchanges/coinbasepro/coinbasepro_wrapper.go +++ b/exchanges/coinbasepro/coinbasepro_wrapper.go @@ -401,14 +401,14 @@ func (c *CoinbasePro) SubmitOrder(s *order.Submit) (order.SubmitResponse, error) response, err = c.PlaceMarketOrder("", s.Amount, s.Amount, - s.OrderSide.String(), + s.OrderSide.Lower(), c.FormatExchangeCurrency(s.Pair, asset.Spot).String(), "") case order.Limit: response, err = c.PlaceLimitOrder("", s.Price, s.Amount, - s.OrderSide.String(), + s.OrderSide.Lower(), "", "", c.FormatExchangeCurrency(s.Pair, asset.Spot).String(),