binance: make asset parameter optional

This commit is contained in:
c9s 2020-10-12 17:15:33 +08:00
parent 92a5eac412
commit 4ce716d6ad

View File

@ -62,8 +62,12 @@ func (e *Exchange) QueryWithdrawHistory(ctx context.Context, asset string, since
endTime = until endTime = until
} }
withdraws, err := e.Client.NewListWithdrawsService(). req := e.Client.NewListWithdrawsService()
Asset(asset). if len(asset) > 0 {
req.Asset(asset)
}
withdraws, err := req.
StartTime(startTime.UnixNano() / int64(time.Millisecond)). StartTime(startTime.UnixNano() / int64(time.Millisecond)).
EndTime(endTime.UnixNano() / int64(time.Millisecond)). EndTime(endTime.UnixNano() / int64(time.Millisecond)).
Do(ctx) Do(ctx)
@ -130,8 +134,12 @@ func (e *Exchange) QueryDepositHistory(ctx context.Context, asset string, since,
endTime = until endTime = until
} }
deposits, err := e.Client.NewListDepositsService(). req := e.Client.NewListDepositsService()
Asset(asset). if len(asset) > 0 {
req.Asset(asset)
}
deposits, err := req.
StartTime(startTime.UnixNano() / int64(time.Millisecond)). StartTime(startTime.UnixNano() / int64(time.Millisecond)).
EndTime(endTime.UnixNano() / int64(time.Millisecond)). EndTime(endTime.UnixNano() / int64(time.Millisecond)).
Do(ctx) Do(ctx)