mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value (#441)
* fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value * removed gctcli executable and added it to gitignore * removed nonce from conibasepro send payload * fixed typo in executable name * Bump github.com/grpc-ecosystem/grpc-gateway from 1.12.2 to 1.13.0 (#442) Bumps [github.com/grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) from 1.12.2 to 1.13.0. - [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases) - [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CHANGELOG.md) - [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v1.12.2...v1.13.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Minor general cleanup and bug fixes (#443) * Bugfix, remove non-needed code and cleanup some code * Run go mod tidy * Remove non-needed test and fix tautological err * Fix Huobi interim var reference * (Logger) Rename package to log (#444) * renamed package to log to stop side import requirement * reverted comment changes * reverted comment changes * one more reverting wording back to logger * wording changes on comments * Bump github.com/gorilla/mux from 1.7.3 to 1.7.4 (#445) Bumps [github.com/gorilla/mux](https://github.com/gorilla/mux) from 1.7.3 to 1.7.4. - [Release notes](https://github.com/gorilla/mux/releases) - [Commits](https://github.com/gorilla/mux/compare/v1.7.3...v1.7.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * (QOL) Improve test setup for logger, improve test coverage for database (#447) * Improved test setup for logger, improved test coverage for database * removed some new lines * add new line * removed database config detailS * removed lines * code cleanup * Bump github.com/d5/tengo/v2 from 2.0.2 to 2.0.4 (#449) Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.0.2 to 2.0.4. - [Release notes](https://github.com/d5/tengo/releases) - [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml) - [Commits](https://github.com/d5/tengo/compare/v2.0.2...v2.0.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump github.com/d5/tengo/v2 from 2.0.4 to 2.0.5 (#450) Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/d5/tengo/releases) - [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml) - [Commits](https://github.com/d5/tengo/compare/v2.0.4...v2.0.5) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Adrian Gallagher <thrasher@addictionsoftware.com> Co-authored-by: Andrew <andrew@disvelop.net>
This commit is contained in:
committed by
GitHub
parent
5e85a9e842
commit
def3cdf226
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,6 +15,7 @@ vendor/
|
||||
|
||||
# Binaries for programs and plugins
|
||||
gocryptotrader
|
||||
cmd/gctcli/gctcli
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user