max: update deposit and withdraw types

This commit is contained in:
c9s 2021-03-14 11:01:59 +08:00
parent 3f0290479b
commit be672c89e6

View File

@ -14,6 +14,7 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/time/rate"
"github.com/c9s/bbgo/pkg/datatype"
maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi"
"github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/pkg/types"
@ -456,7 +457,8 @@ func (e *Exchange) QueryWithdrawHistory(ctx context.Context, asset string, since
txIDs[d.TxID] = struct{}{}
allWithdraws = append(allWithdraws, types.Withdraw{
ApplyTime: time.Unix(d.CreatedAt, 0),
Exchange: types.ExchangeMax,
ApplyTime: datatype.Time(time.Unix(d.CreatedAt, 0)),
Asset: toGlobalCurrency(d.Currency),
Amount: util.MustParseFloat(d.Amount),
Address: "",
@ -505,13 +507,14 @@ func (e *Exchange) QueryDepositHistory(ctx context.Context, asset string, since,
}
allDeposits = append(allDeposits, types.Deposit{
Time: time.Unix(d.CreatedAt, 0),
Amount: util.MustParseFloat(d.Amount),
Asset: toGlobalCurrency(d.Currency),
Address: "", // not supported
AddressTag: "", // not supported
TransactionID: d.TxID,
Status: toGlobalDepositStatus(d.State),
Exchange: types.ExchangeMax,
Time: datatype.Time(time.Unix(d.CreatedAt, 0)),
Amount: util.MustParseFloat(d.Amount),
Asset: toGlobalCurrency(d.Currency),
Address: "", // not supported
AddressTag: "", // not supported
TransactionID: d.TxID,
Status: toGlobalDepositStatus(d.State),
})
}