mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-05 07:26:47 +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:
@@ -512,9 +512,9 @@ func (b *Bithumb) SubmitOrder(ctx context.Context, s *order.Submit) (order.Submi
|
||||
|
||||
// ModifyOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *Bithumb) ModifyOrder(ctx context.Context, action *order.Modify) (order.Modify, error) {
|
||||
func (b *Bithumb) ModifyOrder(ctx context.Context, action *order.Modify) (*order.Modify, error) {
|
||||
if err := action.Validate(); err != nil {
|
||||
return order.Modify{}, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
o, err := b.ModifyTrade(ctx,
|
||||
@@ -523,20 +523,18 @@ func (b *Bithumb) ModifyOrder(ctx context.Context, action *order.Modify) (order.
|
||||
action.Side.Lower(),
|
||||
action.Amount,
|
||||
int64(action.Price))
|
||||
|
||||
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: o.Data[0].ContID,
|
||||
|
||||
Price: float64(int64(action.Price)),
|
||||
Amount: action.Amount,
|
||||
Side: action.Side,
|
||||
Price: float64(int64(action.Price)),
|
||||
Amount: action.Amount,
|
||||
Side: action.Side,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user