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

View File

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

View File

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