From b79ab5d68d0bd608fadd84cf82c3699cfb3503ce Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 26 Dec 2021 02:39:44 +0800 Subject: [PATCH] kucoin: fix kline query param --- .../kucoin/kucoinapi/get_k_lines_request_accessors.go | 8 ++++---- pkg/exchange/kucoin/kucoinapi/marketdata.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/exchange/kucoin/kucoinapi/get_k_lines_request_accessors.go b/pkg/exchange/kucoin/kucoinapi/get_k_lines_request_accessors.go index 15b01b724..f659d1265 100644 --- a/pkg/exchange/kucoin/kucoinapi/get_k_lines_request_accessors.go +++ b/pkg/exchange/kucoin/kucoinapi/get_k_lines_request_accessors.go @@ -39,20 +39,20 @@ func (g *GetKLinesRequest) GetParameters() (map[string]interface{}, error) { // assign parameter of symbol params["symbol"] = symbol - // check interval field -> json key interval + // check interval field -> json key type interval := g.interval switch interval { case "1min", "3min", "5min", "15min", "30min", "1hour", "2hour", "4hour", "6hour", "8hour", "12hour", "1day", "1week": - params["interval"] = interval + params["type"] = interval default: - return params, fmt.Errorf("interval value %v is invalid", interval) + return params, fmt.Errorf("type value %v is invalid", interval) } // assign parameter of interval - params["interval"] = interval + params["type"] = interval // check startAt field -> json key startAt if g.startAt != nil { diff --git a/pkg/exchange/kucoin/kucoinapi/marketdata.go b/pkg/exchange/kucoin/kucoinapi/marketdata.go index c6033f2a8..68fedc001 100644 --- a/pkg/exchange/kucoin/kucoinapi/marketdata.go +++ b/pkg/exchange/kucoin/kucoinapi/marketdata.go @@ -296,7 +296,7 @@ type GetKLinesRequest struct { symbol string `param:"symbol"` - interval string `param:"interval" validValues:"1min,3min,5min,15min,30min,1hour,2hour,4hour,6hour,8hour,12hour,1day,1week"` + interval string `param:"type" validValues:"1min,3min,5min,15min,30min,1hour,2hour,4hour,6hour,8hour,12hour,1day,1week"` startAt *time.Time `param:"startAt,seconds"`