Kraken: use configured endpoint for futures (#1071)

* fix: use configured endpoint for kraken futures

* cleanup

* Update kraken_futures.go

* remove redundant constant
This commit is contained in:
E Sequeira
2022-11-03 03:03:30 +00:00
committed by GitHub
parent c2d45635a9
commit 136dac8152
3 changed files with 8 additions and 3 deletions

View File

@@ -25,8 +25,7 @@ import (
const (
krakenAPIURL = "https://api.kraken.com"
krakenFuturesURL = "https://futures.kraken.com"
futuresURL = "https://futures.kraken.com/derivatives"
krakenFuturesURL = "https://futures.kraken.com/derivatives"
krakenSpotVersion = "0"
krakenFuturesVersion = "3"
)

View File

@@ -316,6 +316,12 @@ func (k *Kraken) SendFuturesAuthRequest(ctx context.Context, method, path string
"Nonce": nonce,
}
var futuresURL string
futuresURL, err = k.API.Endpoints.GetURL(exchange.RestFutures)
if err != nil {
return nil, err
}
return &request.Item{
Method: method,
Path: futuresURL + common.EncodeURLValues(path, data),

View File

@@ -182,7 +182,7 @@ func (k *Kraken) SetDefaults() {
k.API.Endpoints = k.NewEndpoints()
err = k.API.Endpoints.SetDefaultEndpoints(map[exchange.URL]string{
exchange.RestSpot: krakenAPIURL,
exchange.RestFutures: futuresURL,
exchange.RestFutures: krakenFuturesURL,
exchange.WebsocketSpot: krakenWSURL,
})
if err != nil {