From 99121d19c030bef2fd1b993618ebdcf3ddc30cbc Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 5 Aug 2022 11:45:31 +0800 Subject: [PATCH] exchange/max: fix order trades query field name --- pkg/exchange/max/exchange.go | 2 +- .../max/maxapi/v3/get_order_trades_request.go | 2 +- .../v3/get_order_trades_request_requestgen.go | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index cccf4c065..16944bf5a 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -178,7 +178,7 @@ func (e *Exchange) QueryOrderTrades(ctx context.Context, q types.OrderQuery) ([] 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 { return nil, err } diff --git a/pkg/exchange/max/maxapi/v3/get_order_trades_request.go b/pkg/exchange/max/maxapi/v3/get_order_trades_request.go index 0657bdcc4..4ab982b02 100644 --- a/pkg/exchange/max/maxapi/v3/get_order_trades_request.go +++ b/pkg/exchange/max/maxapi/v3/get_order_trades_request.go @@ -14,6 +14,6 @@ func (s *OrderService) NewGetOrderTradesRequest() *GetOrderTradesRequest { type GetOrderTradesRequest struct { client requestgen.AuthenticatedAPIClient - id *uint64 `param:"order_id,omitempty"` + orderID *uint64 `param:"order_id,omitempty"` clientOrderID *string `param:"client_oid,omitempty"` } diff --git a/pkg/exchange/max/maxapi/v3/get_order_trades_request_requestgen.go b/pkg/exchange/max/maxapi/v3/get_order_trades_request_requestgen.go index 6b0e11978..10bd1cd44 100644 --- a/pkg/exchange/max/maxapi/v3/get_order_trades_request_requestgen.go +++ b/pkg/exchange/max/maxapi/v3/get_order_trades_request_requestgen.go @@ -12,8 +12,8 @@ import ( "regexp" ) -func (g *GetOrderTradesRequest) Id(id uint64) *GetOrderTradesRequest { - g.id = &id +func (g *GetOrderTradesRequest) OrderID(orderID uint64) *GetOrderTradesRequest { + g.orderID = &orderID 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 func (g *GetOrderTradesRequest) GetParameters() (map[string]interface{}, error) { var params = map[string]interface{}{} - // check id field -> json key order_id - if g.id != nil { - id := *g.id + // check orderID field -> json key order_id + if g.orderID != nil { + orderID := *g.orderID - // assign parameter of id - params["order_id"] = id + // assign parameter of orderID + params["order_id"] = orderID } else { } // check clientOrderID field -> json key client_oid