mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 07:26:48 +00:00
btcm: add modify order functionality, change return to pointer (#940)
* btcm: add modify order functionality, change return to pointer * glorious: nits * glorious: nits * btcm: Adjust function name * thrasher: nits * thrasher: nits cont...
This commit is contained in:
@@ -682,9 +682,9 @@ func (f *FTX) SubmitOrder(ctx context.Context, s *order.Submit) (order.SubmitRes
|
||||
|
||||
// ModifyOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (f *FTX) ModifyOrder(ctx context.Context, action *order.Modify) (order.Modify, error) {
|
||||
func (f *FTX) ModifyOrder(ctx context.Context, action *order.Modify) (*order.Modify, error) {
|
||||
if err := action.Validate(); err != nil {
|
||||
return order.Modify{}, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if action.TriggerPrice != 0 {
|
||||
@@ -696,14 +696,13 @@ func (f *FTX) ModifyOrder(ctx context.Context, action *order.Modify) (order.Modi
|
||||
action.Price,
|
||||
0)
|
||||
if err != nil {
|
||||
return order.Modify{}, err
|
||||
return nil, err
|
||||
}
|
||||
return order.Modify{
|
||||
Exchange: action.Exchange,
|
||||
AssetType: action.AssetType,
|
||||
Pair: action.Pair,
|
||||
ID: strconv.FormatInt(a.ID, 10),
|
||||
|
||||
return &order.Modify{
|
||||
Exchange: action.Exchange,
|
||||
AssetType: action.AssetType,
|
||||
Pair: action.Pair,
|
||||
ID: strconv.FormatInt(a.ID, 10),
|
||||
Price: action.Price,
|
||||
Amount: action.Amount,
|
||||
TriggerPrice: action.TriggerPrice,
|
||||
@@ -719,7 +718,7 @@ func (f *FTX) ModifyOrder(ctx context.Context, action *order.Modify) (order.Modi
|
||||
action.Price,
|
||||
action.Amount)
|
||||
if err != nil {
|
||||
return order.Modify{}, err
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
o, err = f.ModifyPlacedOrder(ctx,
|
||||
@@ -728,17 +727,16 @@ func (f *FTX) ModifyOrder(ctx context.Context, action *order.Modify) (order.Modi
|
||||
action.Price,
|
||||
action.Amount)
|
||||
if err != nil {
|
||||
return order.Modify{}, err
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return order.Modify{
|
||||
return &order.Modify{
|
||||
Exchange: action.Exchange,
|
||||
AssetType: action.AssetType,
|
||||
Pair: action.Pair,
|
||||
ID: strconv.FormatInt(o.ID, 10),
|
||||
|
||||
Price: action.Price,
|
||||
Amount: action.Amount,
|
||||
Price: action.Price,
|
||||
Amount: action.Amount,
|
||||
}, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user