mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1508 from c9s/edwin/okx/fix-query-open-order-param
FIX: [okx] fix query open order time param
This commit is contained in:
commit
41529264b7
|
@ -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"`
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user