fix account currency translation

This commit is contained in:
c9s 2020-11-17 14:24:26 +08:00
parent 95b0910a09
commit ed6d6342e7
2 changed files with 7 additions and 1 deletions

View File

@ -134,6 +134,10 @@ func (environ *Environment) Init(ctx context.Context) (err error) {
session.Account.UpdateBalances(balances)
session.Account.BindStream(session.Stream)
session.Stream.OnBalanceUpdate(func(balances types.BalanceMap) {
log.Infof("balance update: %+v", balances)
})
// update last prices
session.Stream.OnKLineClosed(func(kline types.KLine) {
log.Infof("kline closed: %+v", kline)

View File

@ -1,6 +1,8 @@
package max
import (
"strings"
"github.com/pkg/errors"
"github.com/valyala/fastjson"
@ -183,7 +185,7 @@ func (m *BalanceMessage) Balance() (*types.Balance, error) {
}
return &types.Balance{
Currency: m.Currency,
Currency: strings.ToUpper(m.Currency),
Locked: locked,
Available: available,
}, nil