exchanges: Update ModifyOrder comments for clarity (#2044)

Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
This commit is contained in:
Ryan O'Hara-Reid
2025-09-30 11:23:10 +10:00
committed by GitHub
parent b12a274c2c
commit 0b60693ff5
27 changed files with 43 additions and 62 deletions

View File

@@ -99,7 +99,7 @@ if err != nil {
// Handle error
}
// ModifyOrder will allow of changing orderbook placement and limit to market conversion
// ModifyOrder modifies an existing order
updatedOrder, err := ok.ModifyOrder(...)
if err != nil {
// Handle error

View File

@@ -364,7 +364,7 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return nil, common.ErrNotYetImplemented
}
// ModifyOrder will allow changing of orderbook placements and limit to market conversions
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
if err := action.Validate(); err != nil {
return nil, err

View File

@@ -1013,9 +1013,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return resp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -541,9 +541,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return &submitOrderResponse, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -614,8 +614,7 @@ func (e *Exchange) SubmitOrder(ctx context.Context, o *order.Submit) (*order.Sub
return resp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
if err := action.Validate(); err != nil {
return nil, err

View File

@@ -306,9 +306,8 @@ func (e *Exchange) SubmitOrder(_ context.Context, _ *order.Submit) (*order.Submi
return nil, common.ErrNotYetImplemented
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -445,9 +445,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(orderID)
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -653,8 +653,7 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(response.OrderID)
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
if err := action.Validate(); err != nil {
return nil, err

View File

@@ -468,9 +468,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(strconv.FormatInt(response.ID, 10))
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -478,8 +478,7 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return submitResp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
if err := action.Validate(); err != nil {
return nil, err

View File

@@ -483,9 +483,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(orderID)
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -938,7 +938,7 @@ func getOrderTypeString(oType order.Type) string {
}
}
// ModifyOrder will allow of changing orderbook placement and limit to market conversion
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
arg, err := e.deriveAmendOrderArguments(action)
if err != nil {

View File

@@ -498,7 +498,7 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return subResp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to market conversion
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, m *order.Modify) (*order.ModifyResponse, error) {
if m == nil {
return nil, common.ErrNilPointer

View File

@@ -552,9 +552,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, o *order.Submit) (*order.Sub
return resp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -634,8 +634,7 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return resp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
if err := action.Validate(); err != nil {
return nil, err

View File

@@ -438,9 +438,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(strconv.FormatInt(response, 10))
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -1020,8 +1020,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
}
}
// ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -482,9 +482,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(strconv.FormatInt(response, 10))
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -476,9 +476,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, o *order.Submit) (*order.Sub
return resp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -1102,9 +1102,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return resp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -766,8 +766,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return resp, nil
}
// ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -818,9 +818,8 @@ func MarginModeToString(mType margin.Type) string {
}
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -400,9 +400,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(tempResp.OrderID)
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}

View File

@@ -117,7 +117,7 @@ if err != nil {
// Handle error
}
// ModifyOrder will allow of changing orderbook placement and limit to market conversion
// ModifyOrder modifies an existing order
updatedOrder, err := ok.ModifyOrder(...)
if err != nil {
// Handle error

View File

@@ -1103,7 +1103,7 @@ func (e *Exchange) marginTypeToString(m margin.Type) string {
return ""
}
// ModifyOrder will allow of changing orderbook placement and limit to market conversion
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
if err := action.Validate(); err != nil {
return nil, err

View File

@@ -532,8 +532,7 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(strconv.FormatInt(response.OrderNumber, 10))
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) {
if err := action.Validate(); err != nil {
return nil, err

View File

@@ -361,9 +361,8 @@ func (e *Exchange) SubmitOrder(ctx context.Context, s *order.Submit) (*order.Sub
return s.DeriveSubmitResponse(strconv.FormatInt(response, 10))
}
// ModifyOrder will allow of changing orderbook placement and limit to
// market conversion
func (e *Exchange) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error) {
// ModifyOrder modifies an existing order
func (e *Exchange) ModifyOrder(context.Context, *order.Modify) (*order.ModifyResponse, error) {
return nil, common.ErrFunctionNotSupported
}