mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-06 07:26:47 +00:00
gateio: fix spot/futures order issues (#1524)
* gateio: fix spot deployment issue * fix status bug add test * to actual return type * fix linter * ch type * glorious: nits * rm space * glorious: nits --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -331,6 +331,7 @@ const (
|
||||
Pending
|
||||
Cancelling
|
||||
Liquidated
|
||||
STP
|
||||
)
|
||||
|
||||
// Type enforces a standard for order types across the code base
|
||||
|
||||
@@ -815,6 +815,10 @@ func (s Status) String() string {
|
||||
return "PENDING"
|
||||
case Cancelling:
|
||||
return "CANCELLING"
|
||||
case Liquidated:
|
||||
return "LIQUIDATED"
|
||||
case STP:
|
||||
return "SELF_TRADE_PREVENTION"
|
||||
default:
|
||||
return "UNKNOWN"
|
||||
}
|
||||
@@ -1141,7 +1145,7 @@ func StringToOrderStatus(status string) (Status, error) {
|
||||
return PartiallyFilledCancelled, nil
|
||||
case Open.String():
|
||||
return Open, nil
|
||||
case Closed.String():
|
||||
case Closed.String(), "POSITION_CLOSED":
|
||||
return Closed, nil
|
||||
case Cancelled.String(), "CANCELED", "ORDER_CANCELLED":
|
||||
return Cancelled, nil
|
||||
@@ -1161,6 +1165,12 @@ func StringToOrderStatus(status string) (Status, error) {
|
||||
return MarketUnavailable, nil
|
||||
case Cancelling.String():
|
||||
return Cancelling, nil
|
||||
case Liquidated.String():
|
||||
return Liquidated, nil
|
||||
case AutoDeleverage.String(), "AUTO_DELEVERAGED":
|
||||
return AutoDeleverage, nil
|
||||
case STP.String(), "STP":
|
||||
return STP, nil
|
||||
default:
|
||||
return UnknownStatus, fmt.Errorf("'%s' %w", status, errUnrecognisedOrderStatus)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user