diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index 927a746f5..8d3d9eb7a 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -99,8 +99,12 @@ func (e *Exchange) QueryWithdrawHistory(ctx context.Context, asset string, since } log.Infof("querying withdraw %s: %s <=> %s", asset, startTime, endTime) - withdraws, err := e.client.AccountService.NewGetWithdrawalHistoryRequest(). - Currency(toLocalCurrency(asset)). + req := e.client.AccountService.NewGetWithdrawalHistoryRequest() + if len(asset) > 0 { + req.Currency(toLocalCurrency(asset)) + } + + withdraws, err := req. From(startTime.Unix()). To(endTime.Unix()). Do(ctx) @@ -165,8 +169,12 @@ func (e *Exchange) QueryDepositHistory(ctx context.Context, asset string, since, } log.Infof("querying deposit history %s: %s <=> %s", asset, startTime, endTime) - deposits, err := e.client.AccountService.NewGetDepositHistoryRequest(). - Currency(toLocalCurrency(asset)). + req := e.client.AccountService.NewGetDepositHistoryRequest() + if len(asset) > 0 { + req.Currency(toLocalCurrency(asset)) + } + + deposits, err := req. From(startTime.Unix()). To(endTime.Unix()).Do(ctx) diff --git a/pkg/exchange/max/maxapi/account.go b/pkg/exchange/max/maxapi/account.go index 7977f3502..2a43f2fbb 100644 --- a/pkg/exchange/max/maxapi/account.go +++ b/pkg/exchange/max/maxapi/account.go @@ -126,7 +126,7 @@ type Deposit struct { type GetDepositHistoryRequestParams struct { *PrivateRequestParams - Currency string `json:"currency"` + Currency string `json:"currency,omitempty"` From int64 `json:"from,omitempty"` // seconds To int64 `json:"to,omitempty"` // seconds State string `json:"state,omitempty"` // submitting, submitted, rejected, accepted, checking, refunded, canceled, suspect @@ -212,7 +212,7 @@ type Withdraw struct { type GetWithdrawHistoryRequestParams struct { *PrivateRequestParams - Currency string `json:"currency"` + Currency string `json:"currency,omitempty"` From int64 `json:"from,omitempty"` // seconds To int64 `json:"to,omitempty"` // seconds State string `json:"state,omitempty"` // submitting, submitted, rejected, accepted, checking, refunded, canceled, suspect