pkg/exchange: fix okx query open order time param

This commit is contained in:
Edwin 2024-01-23 14:26:40 +08:00
parent 0e5ff14d1c
commit 7841813fe0
2 changed files with 14 additions and 14 deletions

View File

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

View File

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