mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
binance: fix QueryOrderTrades
This commit is contained in:
parent
b4e71dd5bb
commit
c6e4fcf0c2
|
@ -77,7 +77,6 @@ type Exchange struct {
|
|||
client2 *binanceapi.RestClient
|
||||
}
|
||||
|
||||
|
||||
var timeSetterOnce sync.Once
|
||||
|
||||
func New(key, secret string) *Exchange {
|
||||
|
@ -725,7 +724,11 @@ func (e *Exchange) QueryOrderTrades(ctx context.Context, q types.OrderQuery) ([]
|
|||
return nil, err
|
||||
}
|
||||
|
||||
remoteTrades, err := e.client.NewListTradesService().OrderId(orderID).Do(ctx)
|
||||
if len(q.Symbol) == 0 {
|
||||
return nil, errors.New("binance: symbol parameter is a mandatory parameter for querying order trades")
|
||||
}
|
||||
|
||||
remoteTrades, err := e.client.NewListTradesService().Symbol(q.Symbol).OrderId(orderID).Do(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -734,7 +737,7 @@ func (e *Exchange) QueryOrderTrades(ctx context.Context, q types.OrderQuery) ([]
|
|||
for _, t := range remoteTrades {
|
||||
localTrade, err := toGlobalTrade(*t, e.IsMargin)
|
||||
if err != nil {
|
||||
log.WithError(err).Errorf("can not convert binance trade: %+v", t)
|
||||
log.WithError(err).Errorf("binance: can not convert trade: %+v", t)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user