mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-20 07:26:46 +00:00
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:
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user