use lower case in error string and add comment for IOC, FOK

This commit is contained in:
Alan.sung 2023-08-22 17:23:16 +08:00
parent a4aa9c2eda
commit a0946fbd42
2 changed files with 5 additions and 4 deletions

View File

@ -168,10 +168,9 @@ func toGlobalOrders(orderDetails []okexapi.OrderDetails) ([]types.Order, error)
o, err := toGlobalOrder(&orderDetail)
if err != nil {
return nil, err
} else {
orders = append(orders, *o)
log.WithError(err).Error("order convert error")
}
orders = append(orders, *o)
}
return orders, nil
@ -210,6 +209,8 @@ func toLocalOrderType(orderType types.OrderType) (okexapi.OrderType, error) {
}
func toGlobalOrderType(orderType okexapi.OrderType) (types.OrderType, error) {
// Okex IOC and FOK only implement limit order
// reference: https://www.okx.com/cn/help-center/360025135731
switch orderType {
case okexapi.OrderTypeMarket:
return types.OrderTypeMarket, nil

View File

@ -26,7 +26,7 @@ var log = logrus.WithFields(logrus.Fields{
"exchange": ID,
})
var ErrSymbolRequired = errors.New("Symbol is required parameter")
var ErrSymbolRequired = errors.New("symbol is a required parameter")
type Exchange struct {
key, secret, passphrase string