mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
make currency parameter optional
This commit is contained in:
parent
931ce434ef
commit
92a5eac412
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user