diff --git a/pkg/exchange/okex/okexapi/get_open_orders_request.go b/pkg/exchange/okex/okexapi/get_open_orders_request.go index 0eb942c79..448745caa 100644 --- a/pkg/exchange/okex/okexapi/get_open_orders_request.go +++ b/pkg/exchange/okex/okexapi/get_open_orders_request.go @@ -28,10 +28,10 @@ type GetOpenOrdersRequest struct { // Pagination of data to return records newer than the requested ordId before *string `param:"before,query"` // Filter with a begin timestamp. Unix timestamp format in milliseconds, e.g. 1597026383085 - begin *time.Time `param:"begin,query"` + begin *time.Time `param:"begin,query,timestamp"` // Filter with an end timestamp. Unix timestamp format in milliseconds, e.g. 1597026383085 - end *time.Time `param:"end,query"` + end *time.Time `param:"end,query,timestamp"` limit *string `param:"limit,query"` } diff --git a/pkg/exchange/okex/okexapi/get_open_orders_request_requestgen.go b/pkg/exchange/okex/okexapi/get_open_orders_request_requestgen.go index c97836a32..1dc968508 100644 --- a/pkg/exchange/okex/okexapi/get_open_orders_request_requestgen.go +++ b/pkg/exchange/okex/okexapi/get_open_orders_request_requestgen.go @@ -12,13 +12,13 @@ import ( "time" ) -func (g *GetOpenOrdersRequest) InstrumentID(instrumentID string) *GetOpenOrdersRequest { - g.instrumentID = &instrumentID +func (g *GetOpenOrdersRequest) InstrumentType(instrumentType InstrumentType) *GetOpenOrdersRequest { + g.instrumentType = instrumentType return g } -func (g *GetOpenOrdersRequest) InstrumentType(instrumentType InstrumentType) *GetOpenOrdersRequest { - g.instrumentType = instrumentType +func (g *GetOpenOrdersRequest) InstrumentID(instrumentID string) *GetOpenOrdersRequest { + g.instrumentID = &instrumentID return g } @@ -65,14 +65,6 @@ func (g *GetOpenOrdersRequest) Limit(limit string) *GetOpenOrdersRequest { // GetQueryParameters builds and checks the query parameters and returns url.Values func (g *GetOpenOrdersRequest) GetQueryParameters() (url.Values, error) { var params = map[string]interface{}{} - // check instrumentID field -> json key instId - if g.instrumentID != nil { - instrumentID := *g.instrumentID - - // assign parameter of instrumentID - params["instId"] = instrumentID - } else { - } // check instrumentType field -> json key instType instrumentType := g.instrumentType @@ -89,6 +81,14 @@ func (g *GetOpenOrdersRequest) GetQueryParameters() (url.Values, error) { // assign parameter of instrumentType params["instType"] = instrumentType + // check instrumentID field -> json key instId + if g.instrumentID != nil { + instrumentID := *g.instrumentID + + // assign parameter of instrumentID + params["instId"] = instrumentID + } else { + } // check orderType field -> json key ordType if g.orderType != nil { orderType := *g.orderType