exchange/max: fix order trades query field name

This commit is contained in:
c9s 2022-08-05 11:45:31 +08:00
parent b4dcdc4031
commit 99121d19c0
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
3 changed files with 9 additions and 9 deletions

View File

@ -178,7 +178,7 @@ func (e *Exchange) QueryOrderTrades(ctx context.Context, q types.OrderQuery) ([]
return nil, err return nil, err
} }
maxTrades, err := e.v3order.NewGetOrderTradesRequest().Id(uint64(orderID)).Do(ctx) maxTrades, err := e.v3order.NewGetOrderTradesRequest().OrderID(uint64(orderID)).Do(ctx)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -14,6 +14,6 @@ func (s *OrderService) NewGetOrderTradesRequest() *GetOrderTradesRequest {
type GetOrderTradesRequest struct { type GetOrderTradesRequest struct {
client requestgen.AuthenticatedAPIClient client requestgen.AuthenticatedAPIClient
id *uint64 `param:"order_id,omitempty"` orderID *uint64 `param:"order_id,omitempty"`
clientOrderID *string `param:"client_oid,omitempty"` clientOrderID *string `param:"client_oid,omitempty"`
} }

View File

@ -12,8 +12,8 @@ import (
"regexp" "regexp"
) )
func (g *GetOrderTradesRequest) Id(id uint64) *GetOrderTradesRequest { func (g *GetOrderTradesRequest) OrderID(orderID uint64) *GetOrderTradesRequest {
g.id = &id g.orderID = &orderID
return g return g
} }
@ -37,12 +37,12 @@ func (g *GetOrderTradesRequest) GetQueryParameters() (url.Values, error) {
// GetParameters builds and checks the parameters and return the result in a map object // GetParameters builds and checks the parameters and return the result in a map object
func (g *GetOrderTradesRequest) GetParameters() (map[string]interface{}, error) { func (g *GetOrderTradesRequest) GetParameters() (map[string]interface{}, error) {
var params = map[string]interface{}{} var params = map[string]interface{}{}
// check id field -> json key order_id // check orderID field -> json key order_id
if g.id != nil { if g.orderID != nil {
id := *g.id orderID := *g.orderID
// assign parameter of id // assign parameter of orderID
params["order_id"] = id params["order_id"] = orderID
} else { } else {
} }
// check clientOrderID field -> json key client_oid // check clientOrderID field -> json key client_oid