mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
max: group the request building statement
This commit is contained in:
parent
d5fe13272e
commit
3cfc810f8d
|
@ -24,6 +24,7 @@ var log = logrus.WithField("exchange", "max")
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
_ = types.ExchangeTradeHistoryService(&Exchange{})
|
_ = types.ExchangeTradeHistoryService(&Exchange{})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Exchange struct {
|
type Exchange struct {
|
||||||
|
@ -290,13 +291,14 @@ func (e *Exchange) queryClosedOrdersByLastOrderID(
|
||||||
walletType = maxapi.WalletTypeMargin
|
walletType = maxapi.WalletTypeMargin
|
||||||
}
|
}
|
||||||
|
|
||||||
req := e.v3client.NewGetWalletOrderHistoryRequest(walletType).Market(market)
|
|
||||||
if lastOrderID == 0 {
|
if lastOrderID == 0 {
|
||||||
lastOrderID = 1
|
lastOrderID = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
req.FromID(lastOrderID)
|
req := e.v3client.NewGetWalletOrderHistoryRequest(walletType).
|
||||||
req.Limit(1000)
|
Market(market).
|
||||||
|
FromID(lastOrderID).
|
||||||
|
Limit(1000)
|
||||||
|
|
||||||
maxOrders, err := req.Do(ctx)
|
maxOrders, err := req.Do(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user