From 3cfc810f8d737192f9d954096fe05861c579f5e2 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 14 Nov 2023 16:09:47 +0800 Subject: [PATCH] max: group the request building statement --- pkg/exchange/max/exchange.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index b8c947b66..d50279f4b 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -24,6 +24,7 @@ var log = logrus.WithField("exchange", "max") func init() { _ = types.ExchangeTradeHistoryService(&Exchange{}) + } type Exchange struct { @@ -290,13 +291,14 @@ func (e *Exchange) queryClosedOrdersByLastOrderID( walletType = maxapi.WalletTypeMargin } - req := e.v3client.NewGetWalletOrderHistoryRequest(walletType).Market(market) if lastOrderID == 0 { lastOrderID = 1 } - req.FromID(lastOrderID) - req.Limit(1000) + req := e.v3client.NewGetWalletOrderHistoryRequest(walletType). + Market(market). + FromID(lastOrderID). + Limit(1000) maxOrders, err := req.Do(ctx) if err != nil {