kucoin: fix kline query param

This commit is contained in:
c9s 2021-12-26 02:39:44 +08:00
parent be10019007
commit b79ab5d68d
2 changed files with 5 additions and 5 deletions

View File

@ -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 {

View File

@ -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"`