max: replace time type fields

This commit is contained in:
c9s 2023-04-11 18:46:29 +08:00
parent d95daba3f0
commit 4944fdda2d
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 8 additions and 7 deletions

View File

@ -690,7 +690,7 @@ func (e *Exchange) QueryWithdrawHistory(ctx context.Context, asset string, since
txIDs[d.TxID] = struct{}{}
withdraw := types.Withdraw{
Exchange: types.ExchangeMax,
ApplyTime: types.Time(time.Unix(d.CreatedAt, 0)),
ApplyTime: types.Time(d.CreatedAt),
Asset: toGlobalCurrency(d.Currency),
Amount: d.Amount,
Address: "",
@ -710,7 +710,7 @@ func (e *Exchange) QueryWithdrawHistory(ctx context.Context, asset string, since
startTime = endTime
} else {
// its in descending order, so we get the first record
startTime = time.Unix(withdraws[0].CreatedAt, 0)
startTime = withdraws[0].CreatedAt.Time()
}
}

View File

@ -8,6 +8,7 @@ import (
"github.com/c9s/requestgen"
"github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/pkg/types"
)
type AccountService struct {
@ -147,11 +148,11 @@ type Withdraw struct {
// "failed", "pending", "confirmed",
// "kgi_manually_processing", "kgi_manually_confirmed", "kgi_possible_failed",
// "sygna_verifying"
State string `json:"state"`
Confirmations int `json:"confirmations"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Notes string `json:"notes"`
State string `json:"state"`
Confirmations int `json:"confirmations"`
CreatedAt types.MillisecondTimestamp `json:"created_at"`
UpdatedAt types.MillisecondTimestamp `json:"updated_at"`
Notes string `json:"notes"`
}
//go:generate GetRequest -url "v2/withdrawals" -type GetWithdrawHistoryRequest -responseType []Withdraw